eclipse-m2e / m2e-core

Eclipse Public License 2.0
113 stars 115 forks source link

NPE in ProjectRegistryManager #1883

Open alexsuter opened 1 week ago

alexsuter commented 1 week ago

Sometimes this happens:

Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.core.runtime.IPath.toFile()" because the return value of "org.eclipse.core.resources.IFile.getLocation()" is null
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.c(ProjectRegistryManager.java:936)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.readProjectWithDependencies(ProjectRegistryManager.java:904)
    at org.eclipse.m2e.core.internal.project.registry.MavenProjectCache$CacheLine.lambda$1(MavenProjectCache.java:192)
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
    at org.eclipse.m2e.core.internal.project.registry.MavenProjectCache$CacheLine.getProject(MavenProjectCache.java:191)
    at org.eclipse.m2e.core.internal.project.registry.MavenProjectCache.getMavenProject(MavenProjectCache.java:105)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$24(ProjectRegistryManager.java:1101)
    at java.base/java.util.Map.computeIfAbsent(Map.java:1066)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.getMavenProject(ProjectRegistryManager.java:1100)
    ... 85 more

I can provide a pull request, but I'm not sure what's the solution.

mickaelistria commented 1 week ago

Do you manage to reproduce it deterministically (so that one can debug it)?

alexsuter commented 1 day ago

not so far... :(