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

IllegalArgumentException WorkingSetModel.setWorkingSets #1863

Open
jukzi opened this issue Dec 18, 2024 · 4 comments
Open

IllegalArgumentException WorkingSetModel.setWorkingSets #1863

jukzi opened this issue Dec 18, 2024 · 4 comments
Labels
bug Something isn't working test junit test related things

Comments

@jukzi
Copy link
Contributor

jukzi commented Dec 18, 2024

1452 tests failed in
https://download.eclipse.org/eclipse/downloads/drops4/I20241217-1800/testresults/html/org.eclipse.jdt.ui.tests_ep435I-unit-win32-x86_64-java21_win32.win32.x86_64_21.html

most like this:

org.opentest4j.MultipleFailuresError: Multiple Failures (2 failures)
org.eclipse.core.internal.resources.ResourceException: Resource '/TestSetupProject' does not exist.
org.eclipse.jdt.core.JavaModelException: TestSetupProject does not exist
Suppressed: org.eclipse.core.internal.resources.ResourceException: Resource '/TestSetupProject' does not exist.
at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:364)
at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:238)
at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:183)
at org.eclipse.core.internal.resources.Folder.assertCreateRequirements(Folder.java:43)
at org.eclipse.core.internal.resources.Folder.create(Folder.java:101)
at org.eclipse.core.internal.resources.Folder.create(Folder.java:129)
at org.eclipse.jdt.internal.ui.util.ResourcesUtility.createFolder(ResourcesUtility.java:77)
at org.eclipse.jdt.internal.ui.util.CoreUtility.createFolder(CoreUtility.java:64)
at org.eclipse.jdt.testplugin.JavaProjectHelper.addSourceContainer(JavaProjectHelper.java:732)
at org.eclipse.jdt.testplugin.JavaProjectHelper.addSourceContainer(JavaProjectHelper.java:710)
at org.eclipse.jdt.testplugin.JavaProjectHelper.addSourceContainer(JavaProjectHelper.java:696)
at org.eclipse.jdt.testplugin.JavaProjectHelper.addSourceContainer(JavaProjectHelper.java:683)
at org.eclipse.jdt.testplugin.JavaProjectHelper.addSourceContainer(JavaProjectHelper.java:671)
at org.eclipse.jdt.ui.tests.quickfix.UtilitiesTest.setUp(UtilitiesTest.java:74)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
Caused by: java.lang.Exception: Resource '/TestSetupProject' does not exist.
at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
... 15 more
Suppressed: Java Model Exception: Error in Java Model (code 969): TestSetupProject does not exist
at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:546)
at org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:2535)
at org.eclipse.jdt.internal.core.JavaProject.getPerProjectInfo(JavaProject.java:2329)
at org.eclipse.jdt.internal.core.JavaProject.getOutputLocation(JavaProject.java:2144)
at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3512)
at org.eclipse.jdt.testplugin.JavaProjectHelper.lambda$1(JavaProjectHelper.java:604)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2457)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2477)
at org.eclipse.jdt.testplugin.JavaProjectHelper.clear(JavaProjectHelper.java:612)
at org.eclipse.jdt.ui.tests.quickfix.UtilitiesTest.tearDown(UtilitiesTest.java:79)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)

I could not find a special error in the logfiles that would be the root cause. But there is a IllegalArgumentException logged that i could not reproduce locally:

https://download.eclipse.org/eclipse/downloads/drops4/I20241217-1800/testresults/ep435I-unit-win32-x86_64-java21_win32.win32.x86_64_21/org.eclipse.jdt.ui.tests.AutomatedSuite.txt

java.lang.IllegalArgumentException: 
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:68)
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:52)
	at org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.setWorkingSets(WorkingSetModel.java:429)
	at org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.workingSetManagerChanged(WorkingSetModel.java:616)
	at org.eclipse.ui.internal.AbstractWorkingSetManager$5.run(AbstractWorkingSetManager.java:378)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.lambda$1(AbstractWorkingSetManager.java:386)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.firePropertyChange(AbstractWorkingSetManager.java:391)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.internalAddWorkingSet(AbstractWorkingSetManager.java:235)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.addWorkingSet(AbstractWorkingSetManager.java:227)
	at org.eclipse.ui.internal.WorkingSetManager.addWorkingSet(WorkingSetManager.java:66)
	at org.eclipse.jdt.ui.tests.packageview.WorkingSetDropAdapterTest.createJavaWorkingSets(WorkingSetDropAdapterTest.java:185)
	at org.eclipse.jdt.ui.tests.packageview.WorkingSetDropAdapterTest.testRearrange2(WorkingSetDropAdapterTest.java:193)

However that IllegalArgumentException happened on other build too. like
https://download.eclipse.org/eclipse/downloads/drops4/I20241217-1800/testresults/ep435I-unit-linux-x86_64-java21_linux.gtk.x86_64_21/org.eclipse.jdt.ui.tests.AutomatedSuite.txt

@jukzi
Copy link
Contributor Author

jukzi commented Dec 19, 2024

Both
https://download.eclipse.org/eclipse/downloads/drops4/I20241218-1800/testresults/ep435I-unit-win32-x86_64-java21_win32.win32.x86_64_21/org.eclipse.jdt.ui.tests.AutomatedSuite.txt
and
https://download.eclipse.org/eclipse/downloads/drops4/I20241218-1800/testresults/ep435I-unit-linux-x86_64-java21_linux.gtk.x86_64_21/org.eclipse.jdt.ui.tests.AutomatedSuite.txt
show now the same following enhanced Exception:

java.lang.IllegalArgumentException: [ws3, Other Projects, ws1, ws2] has different order then [ws1, ws2, ws3]
	at org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.setWorkingSets(WorkingSetModel.java:433)
	at org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.workingSetManagerChanged(WorkingSetModel.java:622)
	at org.eclipse.ui.internal.AbstractWorkingSetManager$5.run(AbstractWorkingSetManager.java:378)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.lambda$1(AbstractWorkingSetManager.java:386)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.firePropertyChange(AbstractWorkingSetManager.java:391)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.internalAddWorkingSet(AbstractWorkingSetManager.java:235)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.addWorkingSet(AbstractWorkingSetManager.java:227)
	at org.eclipse.ui.internal.WorkingSetManager.addWorkingSet(WorkingSetManager.java:66)
	at org.eclipse.jdt.ui.tests.packageview.WorkingSetDropAdapterTest.createJavaWorkingSets(WorkingSetDropAdapterTest.java:185)
	at org.eclipse.jdt.ui.tests.packageview.WorkingSetDropAdapterTest.testRearrange2(WorkingSetDropAdapterTest.java:193)

java.lang.IllegalArgumentException: [ws3, Other Projects, ws1, ws2] has different order then [ws1, ws2, ws3]
	at org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.setWorkingSets(WorkingSetModel.java:433)
	at org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.workingSetManagerChanged(WorkingSetModel.java:622)
	at org.eclipse.ui.internal.AbstractWorkingSetManager$5.run(AbstractWorkingSetManager.java:378)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.lambda$1(AbstractWorkingSetManager.java:386)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.firePropertyChange(AbstractWorkingSetManager.java:391)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.internalAddWorkingSet(AbstractWorkingSetManager.java:235)
	at org.eclipse.ui.internal.AbstractWorkingSetManager.addWorkingSet(AbstractWorkingSetManager.java:227)
	at org.eclipse.ui.internal.WorkingSetManager.addWorkingSet(WorkingSetManager.java:66)
	at org.eclipse.jdt.ui.tests.packageview.WorkingSetDropAdapterTest.createJavaWorkingSets(WorkingSetDropAdapterTest.java:185)
	at org.eclipse.jdt.ui.tests.packageview.WorkingSetDropAdapterTest.testRearrange3(WorkingSetDropAdapterTest.java:206)

@jukzi
Copy link
Contributor Author

jukzi commented Dec 19, 2024

locally reproducible when running the whole WorkingSetDropAdapterTest

@jukzi
Copy link
Contributor Author

jukzi commented Dec 19, 2024

@jukzi jukzi added the bug Something isn't working label Dec 19, 2024
@jukzi
Copy link
Contributor Author

jukzi commented Dec 19, 2024

Stacktrace where fAllWorkingSets is set to (ws3,Other Projects) because fActiveWorkingSets already contains ws3:

Thread [main] (Suspended)	
	owns: org.eclipse.swt.widgets.RunnableLock  (id=193)	
	org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.getActiveAndAllWorkingSetsFromManagers() line: 386	
	org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.getAllWorkingSets() line: 374	
	org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.setActiveWorkingSets(org.eclipse.ui.IWorkingSet[]) line: 452	
	org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.setActiveWorkingSets(org.eclipse.ui.IWorkingSet[], boolean) line: 516	
	org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.setWorkingSets(org.eclipse.ui.IWorkingSet[], boolean, org.eclipse.ui.IWorkingSet[]) line: 439	
	org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel.workingSetManagerChanged(org.eclipse.jface.util.PropertyChangeEvent) line: 646	
	org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel$$Lambda.0x000001f9a0a1eb58.propertyChange(org.eclipse.jface.util.PropertyChangeEvent) line: not available	
	org.eclipse.ui.internal.AbstractWorkingSetManager$5.run() line: 378	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.ui.internal.WorkingSetManager(org.eclipse.ui.internal.AbstractWorkingSetManager).lambda$1(java.lang.Object[], org.eclipse.jface.util.PropertyChangeEvent) line: 386	
	org.eclipse.ui.internal.AbstractWorkingSetManager$$Lambda.0x000001f9a070eae0.run() line: not available	
	org.eclipse.ui.internal.WorkingSetManager(org.eclipse.ui.internal.AbstractWorkingSetManager).firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) line: 391	
	org.eclipse.ui.internal.WorkingSetManager(org.eclipse.ui.internal.AbstractWorkingSetManager).internalRemoveWorkingSet(org.eclipse.ui.IWorkingSet) line: 245	
	org.eclipse.ui.internal.WorkingSetManager.removeWorkingSet(org.eclipse.ui.IWorkingSet) line: 87	
	org.eclipse.jdt.ui.tests.packageview.WorkingSetDropAdapterTest.createJavaWorkingSets(java.lang.String[]) line: 179	
	org.eclipse.jdt.ui.tests.packageview.WorkingSetDropAdapterTest.testRearrange2() line: 193	

jukzi added a commit to jukzi/eclipse.jdt.ui that referenced this issue Dec 19, 2024
…lipse-jdt#1863

The getter getAllWorkingSets() illegally caches - i.e. modified its
state while that is unexpected during setWorkingSets()

eclipse-jdt#1863

tested by WorkingSetDropAdapterTest
jukzi added a commit that referenced this issue Dec 20, 2024


The getter getAllWorkingSets() illegally caches - i.e. modified its
state while that is unexpected during setWorkingSets()

#1863

tested by WorkingSetDropAdapterTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test junit test related things
Projects
None yet
Development

No branches or pull requests

1 participant