Bug 7082 - NPE during build
Summary: NPE during build
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M5   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 7824 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-12-19 03:59 EST by Dirk Baeumer CLA
Modified: 2002-04-23 08:48 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2001-12-19 03:59:12 EST
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)
Comment 1 Dirk Baeumer CLA 2001-12-19 03:59:33 EST
Forgot to enter build number: 20011218
Comment 2 Philipe Mulet CLA 2001-12-19 06:09:33 EST
Seems as if the package name was 'new char[][]{null}'
Comment 3 Kent Johnson CLA 2001-12-19 12:10:32 EST
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.

Comment 4 Kent Johnson CLA 2001-12-19 16:42:20 EST
I cannot see how/where a compoundName of a PackageBinding was corrupted.
Comment 5 Kent Johnson CLA 2002-01-17 11:15:23 EST
*** Bug 7824 has been marked as a duplicate of this bug. ***
Comment 6 Kent Johnson CLA 2002-01-17 11:56:04 EST
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.
Comment 7 Kent Johnson CLA 2002-04-10 16:37:28 EDT
This may also have been another case of the faulty VM JIT.

Closing will reopen if anyone sees it again.