Bug 45520 - Potential NPE
Summary: Potential NPE
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-24 12:40 EDT by Olivier Thomann CLA
Modified: 2003-11-20 09:51 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.