aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-03-20 11:04:59 (EDT)
committerOleg Besedin2012-03-20 11:04:59 (EDT)
commitcff71eaf108769ede4388d536351361e28c50212 (patch)
treee82c9b86808a3a6c8f9c399b3662e9a225607eab
parenta10f1c10a72389d290e79d4a5ddfbcd38a06b67d (diff)
downloadeclipse.platform.runtime-cff71eaf108769ede4388d536351361e28c50212.zip
eclipse.platform.runtime-cff71eaf108769ede4388d536351361e28c50212.tar.gz
eclipse.platform.runtime-cff71eaf108769ede4388d536351361e28c50212.tar.bz2
Bug 374421 - Infinite recursion if context provider is not setv20120320-1504I20120321-0610
-rw-r--r--tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/ContextInjectionTest.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/ContextInjectionTest.java b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/ContextInjectionTest.java
index eac0fe7..0a5c884 100644
--- a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/ContextInjectionTest.java
+++ b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/ContextInjectionTest.java
@@ -20,6 +20,7 @@ import junit.framework.TestSuite;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.EclipseContextFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.contexts.RunAndTrack;
/**
* Tests for the basic context injection functionality
@@ -307,5 +308,20 @@ public class ContextInjectionTest extends TestCase {
assertEquals(testDouble, userObject.inputDouble);
assertTrue(userObject.finishOverrideCalled);
}
+
+ public void testBug374421() {
+ try {
+ IEclipseContext context = EclipseContextFactory.create();
+ context.runAndTrack(new RunAndTrack() {
+ public boolean changed(IEclipseContext context) {
+ IEclipseContext staticContext = EclipseContextFactory.create();
+ ContextInjectionFactory.make(Object.class, context, staticContext);
+ return true;
+ }
+ });
+ } catch (StackOverflowError e) {
+ fail("See bug 374421 for details.");
+ }
+ }
}