Bug 45520

Summary: Potential NPE
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Olivier Thomann CLA 2003-10-24 12:40:20 EDT
Checking head contents, there are potential NPE:
In org.eclipse.jdt.core.JavaCore:
1) public static IClasspathEntry newContainerEntry(IPath containerPath, boolean
isExported) {
			
	if (containerPath == null || containerPath.segmentCount() < 1) {
		Assert.isTrue(
			false,
			"Illegal classpath container path: \'" +
containerPath.makeRelative().toString() + "\', must have at least one segment
(containerID+hints)"); //$NON-NLS-1$//$NON-NLS-2$
		}

It is possible to get to containerPath.makeRelative() with a null containerPath.

2) Same problem in:
	public static IClasspathEntry newVariableEntry(
		IPath variablePath,
		IPath variableSourceAttachmentPath,
		IPath variableSourceAttachmentRootPath,
		boolean isExported) {
			
		if (variablePath == null || variablePath.segmentCount() < 1) {
			Assert.isTrue(
				false,
				"Illegal classpath variable path: \'" +
variablePath.makeRelative().toString() + "\', must have at least one segment");
//$NON-NLS-1$//$NON-NLS-2$
		}

3) AnnotationFieldReference line 87
s.binding = new ProblemFieldBinding((ReferenceBinding) this.receiverType, token,
fieldBinding.problemId());
fieldBinding can be null.
Comment 1 Philipe Mulet CLA 2003-10-27 09:02:14 EST
Fixed
Comment 2 David Audel CLA 2003-11-20 09:51:52 EST
Verified.