eclipse-m2e / m2e-core

Eclipse Public License 2.0
113 stars 116 forks source link

Project with JUNIT 4 dependency cannot be opened since 2.6.2 #1825

Open damienchambe opened 2 months ago

damienchambe commented 2 months ago

I have two projects with JUNIT 4 dependency. Since the 2.6.2 update , i can not open the project in Package explorer view. it stays empty. In the error log :
Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".

java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IClasspathEntry.getEntryKind()" because "entry" is null
    at org.eclipse.jdt.internal.ui.packageview.ClassPathContainer.getChildren(ClassPathContainer.java:190)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.getContainerPackageFragmentRoots(PackageExplorerContentProvider.java:363)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.getChildren(PackageExplorerContentProvider.java:300)
    at org.eclipse.jdt.internal.ui.packageview.WorkingSetAwareContentProvider.getChildren(WorkingSetAwareContentProvider.java:79)
    at org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren(AbstractTreeViewer.java:1476)
    at org.eclipse.jface.viewers.TreeViewer.getRawChildren(TreeViewer.java:352)
    at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.hasFilteredChildren(ProblemTreeViewer.java:245)
    at org.eclipse.jdt.internal.ui.filters.EmptyLibraryContainerFilter.select(EmptyLibraryContainerFilter.java:32)
    at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.isFiltered(ProblemTreeViewer.java:295)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$PackageExplorerProblemTreeViewer.isFiltered(PackageExplorerPart.java:293)
    at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.filter(ProblemTreeViewer.java:261)
    at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.getFilteredChildren(ProblemTreeViewer.java:251)
    at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:1025)
    at org.eclipse.jface.viewers.ColumnViewer.getSortedChildren(ColumnViewer.java:821)
    at org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildren(AbstractTreeViewer.java:690)
    at org.eclipse.jface.viewers.AbstractTreeViewer.updateChildren(AbstractTreeViewer.java:2896)
    at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefreshStruct(AbstractTreeViewer.java:2031)
    at org.eclipse.jface.viewers.TreeViewer.internalRefreshStruct(TreeViewer.java:684)
    at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:2004)
    at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1961)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$PackageExplorerProblemTreeViewer.internalRefresh(PackageExplorerPart.java:272)
    at org.eclipse.jface.viewers.StructuredViewer.lambda$3(StructuredViewer.java:1486)
    at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1392)
    at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:367)
    at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1353)
    at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1486)
    at org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:533)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.lambda$1(PackageExplorerContentProvider.java:955)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.runUpdates(PackageExplorerContentProvider.java:210)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.runPendingUpdates(PackageExplorerContentProvider.java:202)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider$1.runInUIThread(PackageExplorerContentProvider.java:180)
    at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:148)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5040)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4520)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
    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.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1454)

eclipse 4.32, under linux.

I can resolve by removing the JUNIT 4 dependency. If I add it back the error show up again. But if I add JUNIT 5 it works

laeubi commented 2 months ago

This looks like: