Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WizardPageSupport fails for DataBindingContext with a Realm #2359

Open
basilevs opened this issue Oct 3, 2024 · 0 comments
Open

WizardPageSupport fails for DataBindingContext with a Realm #2359

basilevs opened this issue Oct 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@basilevs
Copy link
Contributor

basilevs commented Oct 3, 2024

Following test fails in org.eclipse.core.databinding 1.13.300
Paste it into WizardPageSupportTest.java to reproduce.

public class org.eclipse.jface.tests.databinding.wizard.WizardPageSupportTest extends AbstractSWTTestCase {
	@Test
	public void testBackgroundRealm() {
		IWizardPage page = new WizardPage("Page") {
			@Override
			public void createControl(Composite parent) {
				setControl(parent);
				DataBindingContext dbc = new DataBindingContext(new org.eclipse.core.tests.databinding.observable.LockRealm());
				WizardPageSupport.create(this, dbc); // Should not throw an exception
			}
		};
		loadWizardPage(page);
	}
}

Error trace:

java.lang.RuntimeException: org.eclipse.core.runtime.AssertionFailedException: assertion failed: Getter called outside realm of observable org.eclipse.core.internal.databinding.observable.UnmodifiableObservableList@59f93db8
	at org.eclipse.jface.tests.databinding.BindingTestSetup.log(BindingTestSetup.java:56)
	at org.eclipse.core.databinding.observable.Realm$1.handleException(Realm.java:147)
	at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:88)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:49)
	at org.eclipse.core.databinding.observable.Realm.safeRun(Realm.java:159)
	at org.eclipse.core.databinding.observable.Realm.exec(Realm.java:177)
	at org.eclipse.core.databinding.observable.value.ComputedValue.computeValueForListeners(ComputedValue.java:302)
	at org.eclipse.core.databinding.observable.value.ComputedValue.addValueChangeListener(ComputedValue.java:321)
	at org.eclipse.jface.databinding.dialog.DialogPageSupport.init(DialogPageSupport.java:144)
	at org.eclipse.jface.databinding.dialog.DialogPageSupport.<init>(DialogPageSupport.java:105)
	at org.eclipse.jface.databinding.wizard.WizardPageSupport.<init>(WizardPageSupport.java:47)
	at org.eclipse.jface.databinding.wizard.WizardPageSupport.create(WizardPageSupport.java:66)
	at org.eclipse.jface.tests.databinding.wizard.WizardPageSupportTest$4.createControl(WizardPageSupportTest.java:198)
	at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:180)
	at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:744)
	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:637)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1092)
	at org.eclipse.jface.tests.databinding.wizard.WizardPageSupportTest.loadWizardPage(WizardPageSupportTest.java:252)
	at org.eclipse.jface.tests.databinding.wizard.WizardPageSupportTest.testBackgroundRealm(WizardPageSupportTest.java:201)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:530)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:758)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:453)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:83)
	at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.start(CoreTestApplication.java:28)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:679)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:616)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1492)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1465)
Caused by: org.eclipse.core.runtime.AssertionFailedException: assertion failed: Getter called outside realm of observable org.eclipse.core.internal.databinding.observable.UnmodifiableObservableList@59f93db8
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:119)
	at org.eclipse.core.databinding.observable.ObservableTracker.getterCalled(ObservableTracker.java:258)
	at org.eclipse.core.databinding.observable.DecoratingObservable.getterCalled(DecoratingObservable.java:66)
	at org.eclipse.core.internal.databinding.observable.UnmodifiableObservableList.iterator(UnmodifiableObservableList.java:73)
	at org.eclipse.jface.databinding.dialog.MaxSeverityValidationStatusProvider.calculate(MaxSeverityValidationStatusProvider.java:37)
	at org.eclipse.jface.databinding.dialog.MaxSeverityValidationStatusProvider.calculate(MaxSeverityValidationStatusProvider.java:1)
	at org.eclipse.core.databinding.observable.value.ComputedValue$PrivateInterface.run(ComputedValue.java:168)
	at org.eclipse.core.databinding.observable.ObservableTracker.runAndMonitor(ObservableTracker.java:113)
	at org.eclipse.core.databinding.observable.value.ComputedValue.doGetValue(ComputedValue.java:196)
	at org.eclipse.core.databinding.observable.value.AbstractObservableValue.getValue(AbstractObservableValue.java:92)
	at org.eclipse.core.databinding.observable.value.ComputedValue.lambda$0(ComputedValue.java:309)
	at org.eclipse.core.databinding.observable.Realm$1.run(Realm.java:155)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	... 59 more

The problem is probably org.eclipse.jface.databinding.dialog.MaxSeverityValidationStatusProvider.MaxSeverityValidationStatusProvider(DataBindingContext) - it fails to propagate validation realm to the superclass.

@basilevs basilevs added the bug Something isn't working label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant