6666import org .eclipse .core .runtime .SubMonitor ;
6767import org .eclipse .core .runtime .jobs .Job ;
6868import org .eclipse .core .tests .resources .util .FileStoreAutoDeleteExtension ;
69- import org .junit .function .ThrowingRunnable ;
7069import org .junit .jupiter .api .AfterEach ;
7170import org .junit .jupiter .api .Assertions ;
7271import org .junit .jupiter .api .BeforeEach ;
7372import org .junit .jupiter .api .Test ;
7473import org .junit .jupiter .api .extension .RegisterExtension ;
74+ import org .junit .jupiter .api .function .Executable ;
7575import org .osgi .framework .Bundle ;
7676import org .osgi .framework .BundleContext ;
7777import org .osgi .framework .FrameworkUtil ;
@@ -102,7 +102,7 @@ public void resourceChanged(IResourceChangeEvent event) {
102102 }
103103 }
104104
105- private static final ThrowingRunnable NOOP_RUNNABLE = () -> {
105+ private static final Executable NOOP_RUNNABLE = () -> {
106106 };
107107 protected static final String VERIFIER_NAME = "TestListener" ;
108108 IFile file1 ; //below folder1
@@ -272,7 +272,7 @@ public void tearDown() throws Exception {
272272 */
273273 @ Test
274274 public void test_1GDK9OG () throws Throwable {
275- final AtomicReference <ThrowingRunnable > listenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
275+ final AtomicReference <Executable > listenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
276276 // create the resource change listener
277277 IResourceChangeListener listener = event -> {
278278 try {
@@ -324,7 +324,7 @@ public void run(IProgressMonitor monitor) throws CoreException {
324324 // cleanup: ensure that the listener is removed
325325 getWorkspace ().removeResourceChangeListener (listener );
326326 }
327- listenerInMainThreadCallback .get ().run ();
327+ listenerInMainThreadCallback .get ().execute ();
328328 }
329329
330330 @ Test
@@ -403,7 +403,7 @@ public void testAddProject() throws CoreException {
403403 */
404404 @ Test
405405 public void testBug45996 () throws Throwable {
406- final AtomicReference <ThrowingRunnable > listenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
406+ final AtomicReference <Executable > listenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
407407 // create the resource change listener
408408 IResourceChangeListener listener = event -> {
409409 try {
@@ -447,7 +447,7 @@ public void run(IProgressMonitor monitor) throws CoreException {
447447 // cleanup: ensure that the listener is removed
448448 getWorkspace ().removeResourceChangeListener (listener );
449449 }
450- listenerInMainThreadCallback .get ().run ();
450+ listenerInMainThreadCallback .get ().execute ();
451451 }
452452
453453 @ Test
@@ -721,7 +721,7 @@ public void testDeleteMoveFile() throws CoreException {
721721
722722 @ Test
723723 public void testDeleteProject () throws Throwable {
724- final AtomicReference <ThrowingRunnable > listenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
724+ final AtomicReference <Executable > listenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
725725 //test that marker deltas are fired when projects are deleted
726726 verifier .reset ();
727727 final IMarker marker = project1 .createMarker (IMarker .TASK );
@@ -760,7 +760,7 @@ public void resourceChanged(IResourceChangeEvent event) {
760760 } finally {
761761 getWorkspace ().removeResourceChangeListener (listener );
762762 }
763- listenerInMainThreadCallback .get ().run ();
763+ listenerInMainThreadCallback .get ().execute ();
764764 }
765765
766766 @ Test
@@ -968,16 +968,16 @@ public void resourceChanged(final IResourceChangeEvent event) {
968968 */
969969 @ Test
970970 public void testHiddenPhantomChanges () throws Throwable {
971- final AtomicReference <ThrowingRunnable > listenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
971+ final AtomicReference <Executable > listenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
972972 final IWorkspace workspace = getWorkspace ();
973973 final IFolder phantomFolder = project1 .getFolder ("PhantomFolder" );
974974 final IFile phantomFile = folder1 .getFile ("PhantomFile" );
975975 final IResource [] phantomResources = new IResource [] {phantomFolder , phantomFile };
976976 final QualifiedName partner = new QualifiedName ("Test" , "Infected" );
977977 IResourceChangeListener listener = event -> {
978- ThrowingRunnable oldCallback = listenerInMainThreadCallback .get ();
978+ Executable oldCallback = listenerInMainThreadCallback .get ();
979979 listenerInMainThreadCallback .set (() -> {
980- oldCallback .run ();
980+ oldCallback .execute ();
981981 // make sure the delta doesn't include the phantom members
982982 assertNotDeltaIncludes (event .getDelta (), phantomResources );
983983 // make sure a visitor does not find phantom members
@@ -1011,7 +1011,7 @@ public void testHiddenPhantomChanges() throws Throwable {
10111011 } finally {
10121012 workspace .removeResourceChangeListener (listener );
10131013 }
1014- listenerInMainThreadCallback .get ().run ();
1014+ listenerInMainThreadCallback .get ().execute ();
10151015 }
10161016
10171017 /**
@@ -1020,15 +1020,15 @@ public void testHiddenPhantomChanges() throws Throwable {
10201020 */
10211021 @ Test
10221022 public void testHiddenTeamPrivateChanges () throws Throwable {
1023- final AtomicReference <ThrowingRunnable > listenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
1023+ final AtomicReference <Executable > listenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
10241024 IWorkspace workspace = getWorkspace ();
10251025 final IFolder teamPrivateFolder = project1 .getFolder ("TeamPrivateFolder" );
10261026 final IFile teamPrivateFile = folder1 .getFile ("TeamPrivateFile" );
10271027 final IResource [] privateResources = new IResource [] {teamPrivateFolder , teamPrivateFile };
10281028 IResourceChangeListener listener = event -> {
1029- ThrowingRunnable oldCallback = listenerInMainThreadCallback .get ();
1029+ Executable oldCallback = listenerInMainThreadCallback .get ();
10301030 listenerInMainThreadCallback .set (() -> {
1031- oldCallback .run ();
1031+ oldCallback .execute ();
10321032 // make sure the delta doesn't include the team private members
10331033 assertNotDeltaIncludes (event .getDelta (), privateResources );
10341034 // make sure a visitor does not find team private members
@@ -1066,7 +1066,7 @@ public void testHiddenTeamPrivateChanges() throws Throwable {
10661066 } finally {
10671067 workspace .removeResourceChangeListener (listener );
10681068 }
1069- listenerInMainThreadCallback .get ().run ();
1069+ listenerInMainThreadCallback .get ().execute ();
10701070 }
10711071
10721072 @ Test
@@ -1321,7 +1321,7 @@ public void resourceChanged(IResourceChangeEvent event) {
13211321
13221322 @ Test
13231323 public void testAutoPublishService () throws Throwable {
1324- final AtomicReference <ThrowingRunnable > logListenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
1324+ final AtomicReference <Executable > logListenerInMainThreadCallback = new AtomicReference <>(NOOP_RUNNABLE );
13251325 class Loggy implements LogListener {
13261326 public boolean done = false ;
13271327 @ Override
@@ -1392,7 +1392,7 @@ public void resourceChanged(IResourceChangeEvent event) {
13921392 assertEquals (IResourceChangeEvent .POST_CHANGE , listener1 .eventType );
13931393 assertEquals (IResourceChangeEvent .POST_BUILD , listener2 .eventType );
13941394 assertEquals (IResourceChangeEvent .POST_CHANGE , listener3 .eventType );
1395- logListenerInMainThreadCallback .get ().run ();
1395+ logListenerInMainThreadCallback .get ().execute ();
13961396 }
13971397
13981398 public boolean waitUntil (BooleanSupplier condition ) {
0 commit comments