Community
Participate
Working Groups
It is only scratching the surface. The real problem should be fixed in jdt.core by Bug 563771. This workaround may avoid the Jenkins build to fail randomly on SaveParticipantTest. It restores the save actions configuration after each test.
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/178773
Here a stacktrace for the problem: !ENTRY org.eclipse.jdt.ui 4 2 2021-04-11 13:35:59.717 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ui". !STACK 0 java.lang.NullPointerException at org.eclipse.ltk.internal.core.refactoring.UndoManager2.addUndo(UndoManager2.java:176) at org.eclipse.jdt.internal.corext.fix.CleanUpPostSaveListener.saved(CleanUpPostSaveListener.java:424) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$4.run(CompilationUnitDocumentProvider.java:1642) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.notifyPostSaveListeners(CompilationUnitDocumentProvider.java:1636) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.commitWorkingCopy(CompilationUnitDocumentProvider.java:1420) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$3.execute(CompilationUnitDocumentProvider.java:1495) at org.eclipse.ui.editors.text.TextFileDocumentProvider$DocumentProviderOperation.run(TextFileDocumentProvider.java:133) at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:71) at org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:110) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:131) at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:76) at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:66) at org.eclipse.ui.editors.text.TextFileDocumentProvider.executeOperation(TextFileDocumentProvider.java:461) at org.eclipse.ui.editors.text.TextFileDocumentProvider.saveDocument(TextFileDocumentProvider.java:764) at org.eclipse.ui.texteditor.AbstractTextEditor.performSave(AbstractTextEditor.java:5007) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSave(CompilationUnitEditor.java:1262) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave(CompilationUnitEditor.java:1316) at org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.editCUInEditor(SaveParticipantTest.java:75) at org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testFormatChangesBug207965_2(SaveParticipantTest.java:461) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) 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.ExternalResource$1.evaluate(ExternalResource.java:54) 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:529) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:117) at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness.lambda$0(PlatformUITestHarness.java:45) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4001) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3629) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:53) at org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:47) at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1461) at org.eclipse.equinox.launcher.Main.main(Main.java:1434) Another one maybe resulting from the first one: Reason: A save participant caused problems. !STACK 0 java.lang.IllegalStateException: Error dialog is supposed to be shown now at org.eclipse.jface.dialogs.ErrorDialog.open(ErrorDialog.java:341) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.openSaveListenerWarningDialog(CompilationUnitEditor.java:1397) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.openSaveErrorDialog(CompilationUnitEditor.java:1332) at org.eclipse.ui.texteditor.AbstractTextEditor.handleExceptionOnSave(AbstractTextEditor.java:5063) at org.eclipse.ui.texteditor.AbstractTextEditor.performSave(AbstractTextEditor.java:5013) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSave(CompilationUnitEditor.java:1262) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave(CompilationUnitEditor.java:1316) at org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.editCUInEditor(SaveParticipantTest.java:75) at org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testFormatChangesBug207965_2(SaveParticipantTest.java:461) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) 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.ExternalResource$1.evaluate(ExternalResource.java:54) 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:529) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:117) at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness.lambda$0(PlatformUITestHarness.java:45) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4001) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3629) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:53) at org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:47) at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1461) at org.eclipse.equinox.launcher.Main.main(Main.java:1434) !SUBENTRY 1 org.eclipse.jdt.ui 4 10006 2021-04-11 13:35:59.769 !MESSAGE A save participant caused problems. !SUBENTRY 2 org.eclipse.jdt.ui 4 10006 2021-04-11 13:35:59.769 !MESSAGE The save participant 'Code Clean Up' caused an exception: java.lang.NullPointerException. See the error log for details.
Another possibility is that Bug 423416 (that has been autoclosed without solution) is causing issues. I did not try that but if that is the case it could help to let each test use a different classname and not all E1.java.
SaveParticipantTest.testFormatChangeBug560429 failed in I20210825-1800. cen64-gtk3-java16_linux.gtk.x86_64_16 expected:<...; import java.util.[List; public class A { public A() { List<List<Integer>> mylistlist=new ArrayList<>(); for (List<Integer> list : mylistlist) { for (Integer integer : list) { int foo= integer].intValue(); } ...> but was:<...; import java.util.[Iterator; import java.util.List; public class A { public A() { List<List<Integer>> mylistlist=new ArrayList<>(); for (Iterator<List<Integer>> mylistlistiterator= mylistlist.iterator(); mylistlistiterator.hasNext(); ) { for (Iterator<Integer> mylistiterator= mylistlistiterator.next().iterator(); mylistiterator.hasNext(); ) { int foo= mylistiterator.next()].intValue(); } ...> org.junit.ComparisonFailure: expected:<...; import java.util.[List; public class A { public A() { List<List<Integer>> mylistlist=new ArrayList<>(); for (List<Integer> list : mylistlist) { for (Integer integer : list) { int foo= integer].intValue(); } ...> but was:<...; import java.util.[Iterator; import java.util.List; public class A { public A() { List<List<Integer>> mylistlist=new ArrayList<>(); for (Iterator<List<Integer>> mylistlistiterator= mylistlist.iterator(); mylistlistiterator.hasNext(); ) { for (Iterator<Integer> mylistiterator= mylistlistiterator.next().iterator(); mylistiterator.hasNext(); ) { int foo= mylistiterator.next()].intValue(); } ...> at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testFormatChangeBug560429(SaveParticipantTest.java:1124) ...
org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testFormatChangeBug488229_3 failed on Mac in the build I20220223-1800 with the below error expected:<...; public class E1 { [ /** * Method foo * * @param a * - integer input * * @return integer */ public int foo(int a) { return 0; ]} }> but was:<...; public class E1 { [ /** * Method foo * @param a - integer input * @return integer */ public int foo( int a ) { return 0; ]} }> org.junit.ComparisonFailure: expected:<...; public class E1 { [ /** * Method foo * * @param a * - integer input * * @return integer */ public int foo(int a) { return 0; ]} }> but was:<...; public class E1 { [ /** * Method foo * @param a - integer input * @return integer */ public int foo( int a ) { return 0; ]} }> at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testFormatChangeBug488229_3(SaveParticipantTest.java:990) https://download.eclipse.org/eclipse/downloads/drops4/I20220223-1800/testresults/html/org.eclipse.jdt.ui.tests_ep423I-unit-mac64-java17_macosx.cocoa.x86_64_17.html
org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testFormatChangeBug488229_1 failed on Mac in the build I20220302-1800 with the below error expected:<...; public class E1 { [ /** * Method foo * * @param a * - integer input * @return integer */ public int foo(int a) { return 0; ]} }> but was:<...; public class E1 { [ /** * Method foo * @param a - integer input * @return integer */ public int foo( int a ) { return 0; ]} }> org.junit.ComparisonFailure: expected:<...; public class E1 { [ /** * Method foo * * @param a * - integer input * @return integer */ public int foo(int a) { return 0; ]} }> but was:<...; public class E1 { [ /** * Method foo * @param a - integer input * @return integer */ public int foo( int a ) { return 0; ]} }> at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testFormatChangeBug488229_1(SaveParticipantTest.java:852) https://download.eclipse.org/eclipse/downloads/drops4/I20220302-1800/testresults/html/org.eclipse.jdt.ui.tests_ep423I-unit-mac64-java17_macosx.cocoa.x86_64_17.html
org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testFormatChangeBug560429 failed on Windows in the build I20220519-0130 with the below error expected:<...; import java.util.[List; public class A { public A() { List<List<Integer>> mylistlist=new ArrayList<>(); for (List<Integer> list : mylistlist) { for (Integer integer : list) { int foo= integer].intValue(); } ...> but was:<...; import java.util.[Iterator; import java.util.List; public class A { public A() { List<List<Integer>> mylistlist=new ArrayList<>(); for (Iterator<List<Integer>> mylistlistiterator= mylistlist.iterator(); mylistlistiterator.hasNext(); ) { for (Iterator<Integer> mylistiterator= mylistlistiterator.next().iterator(); mylistiterator.hasNext(); ) { int foo= mylistiterator.next()].intValue(); } ...> org.junit.ComparisonFailure: expected:<...; import java.util.[List; public class A { public A() { List<List<Integer>> mylistlist=new ArrayList<>(); for (List<Integer> list : mylistlist) { for (Integer integer : list) { int foo= integer].intValue(); } ...> but was:<...; import java.util.[Iterator; import java.util.List; public class A { public A() { List<List<Integer>> mylistlist=new ArrayList<>(); for (Iterator<List<Integer>> mylistlistiterator= mylistlist.iterator(); mylistlistiterator.hasNext(); ) { for (Iterator<Integer> mylistiterator= mylistlistiterator.next().iterator(); mylistiterator.hasNext(); ) { int foo= mylistiterator.next()].intValue(); } ...> at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at org.eclipse.jdt.ui.tests.quickfix.SaveParticipantTest.testFormatChangeBug560429(SaveParticipantTest.java:1124) https://download.eclipse.org/eclipse/downloads/drops4/I20220519-0130/testresults/html/org.eclipse.jdt.ui.tests_ep424I-unit-win32-java11_win32.win32.x86_64_11.html
Moved to https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/79