Community
Participate
Working Groups
Got the follow NPE during build. Could not reproduce java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.util.CharOperation.concatWith (CharOperation.java:164) at org.eclipse.jdt.internal.core.newbuilder.NameEnvironment.assembleName (NameEnvironment.java:139) at org.eclipse.jdt.internal.core.newbuilder.ClasspathDirectory.directoryList (ClasspathDirectory.java:35) at org.eclipse.jdt.internal.core.newbuilder.ClasspathDirectory.isPackage (ClasspathDirectory.java:90) at org.eclipse.jdt.internal.core.newbuilder.NameEnvironment.isPackage (NameEnvironment.java:180) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.isPackage (LookupEnvironment.java:526) at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.findPackage (PackageBinding.java:57) at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage (PackageBinding.java:162) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findOnDemandImport (CompilationUnitScope.java:321) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findSingleTypeImpo rt(CompilationUnitScope.java:370) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInImports (CompilationUnitScope.java:259) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes (CompilationUnitScope.java:295) at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:446) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:261) at org.eclipse.jdt.internal.core.newbuilder.AbstractImageBuilder.compile (AbstractImageBuilder.java:211) at org.eclipse.jdt.internal.core.newbuilder.AbstractImageBuilder.compile (AbstractImageBuilder.java:157) at org.eclipse.jdt.internal.core.newbuilder.IncrementalImageBuilder.build (IncrementalImageBuilder.java:97) at org.eclipse.jdt.internal.core.newbuilder.JavaBuilder.buildDeltas (JavaBuilder.java:123) at org.eclipse.jdt.internal.core.newbuilder.JavaBuilder.build (JavaBuilder.java:74) at org.eclipse.core.internal.events.BuildManager$2.run (BuildManager.java:356) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:821) at org.eclipse.core.runtime.Platform.run(Platform.java:395) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:114) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:179) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:189) at org.eclipse.core.internal.events.BuildManager$1.run (BuildManager.java:138) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:821) at org.eclipse.core.runtime.Platform.run(Platform.java:395) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:152) at org.eclipse.core.internal.events.BuildManager.build (BuildManager.java:214) at org.eclipse.core.internal.resources.Workspace.build (Workspace.java:130) at org.eclipse.ui.internal.GlobalBuildAction.build (GlobalBuildAction.java:57) at org.eclipse.ui.internal.GlobalBuildAction$1.run (GlobalBuildAction.java:141) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:98)
Forgot to enter build number: 20011218
Seems as if the package name was 'new char[][]{null}'
CharOperation.concatWith(char[][] array, char[] name, char separator) protects itself from 'array' or 'name' being null. Somehow we were passed a char[][] with null in one of the slots.
I cannot see how/where a compoundName of a PackageBinding was corrupted.
*** Bug 7824 has been marked as a duplicate of this bug. ***
We now have 2 separate NPE stack traces both ending up at: CharOperation.concatWith(char[][] array, char[] name, char separator) called from NameEnvironment.assembleName. But concatWith protects itself from either argument being null: char[] concatWith(char[][] array, char[] name, char separator) { int nameLength = name == null ? 0 : name.length; if (nameLength == 0) return concatWith(array, separator); int length = array == null ? 0 : array.length; if (length == 0) return name; ... } So the array of char[][] must have a null char[]... but I haven't been able to find any code where we manipulate compound package names.
This may also have been another case of the faulty VM JIT. Closing will reopen if anyone sees it again.