View | Details | Raw Unified | Return to bug 248661 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/ClasspathTests.java (+33 lines)
Lines 5938-5942 Link Here
5938
		JavaCore.removeClasspathVariable("MyVar", null);
5938
		JavaCore.removeClasspathVariable("MyVar", null);
5939
	}		
5939
	}		
5940
}
5940
}
5941
/**
5942
 * @bug 248661:Axis2: Missing required libraries in Axis 2 WS Client Projects
5943
 * @test that a variable classpath entry that is mappped to a folder/jar with external path (but still
5944
 * inside the project folder) can be validated using both system absolute path and relative path. 
5945
 * 
5946
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=248661"
5947
 */
5948
public void testBug248661() throws Exception {
5949
	IFolder folder = null;
5950
	try {
5951
		IJavaProject proj =  this.createJavaProject("P", new String[] {}, "bin");
5952
		IPath folderPath = proj.getResource().getFullPath().append("classes");
5953
		folder = createFolder(folderPath);
5954
		assertNotNull(folder);
5955
		IClasspathEntry[] classpath = new IClasspathEntry[1];
5956
		classpath[0] = JavaCore.newVariableEntry(folderPath, null, null);
5957
		setClasspath(proj, classpath);
5958
		
5959
		IClasspathEntry cpe = JavaCore.newLibraryEntry(folder.getFullPath(), null, null);
5960
		IJavaModelStatus status = JavaConventions.validateClasspathEntry(proj, cpe, true);
5961
		assertEquals(IJavaModelStatus.OK, status.getCode());
5962
		
5963
		cpe = JavaCore.newLibraryEntry(folder.getLocation(), null, null);
5964
		status = JavaConventions.validateClasspathEntry(proj, cpe, true);
5965
		assertEquals(IJavaModelStatus.OK, status.getCode());
5966
	}
5967
	finally{
5968
		if (folder != null) {
5969
			org.eclipse.jdt.core.tests.util.Util.delete(folder);
5970
		}
5971
		this.deleteProject("P");
5972
	}
5973
}
5941
5974
5942
}
5975
}
(-)model/org/eclipse/jdt/internal/core/ClasspathEntry.java (+6 lines)
Lines 1960-1965 Link Here
1960
	private static IJavaModelStatus validateLibraryEntry(IPath path, IJavaProject project, String container, IPath sourceAttachment, String entryPathMsg) {
1960
	private static IJavaModelStatus validateLibraryEntry(IPath path, IJavaProject project, String container, IPath sourceAttachment, String entryPathMsg) {
1961
		if (path.isAbsolute() && !path.isEmpty()) {
1961
		if (path.isAbsolute() && !path.isEmpty()) {
1962
			Object target = JavaModel.getTarget(path, true);
1962
			Object target = JavaModel.getTarget(path, true);
1963
			if (target == null) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=248661
1964
				IPath workspaceRoot = ResourcesPlugin.getWorkspace().getRoot().getLocation();
1965
				if (workspaceRoot.isPrefixOf(path)) {
1966
					target = JavaModel.getTarget(path.makeRelativeTo(workspaceRoot).makeAbsolute(), true);
1967
				}
1968
			}
1963
			if (target != null && !JavaCore.IGNORE.equals(project.getOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, true))) {
1969
			if (target != null && !JavaCore.IGNORE.equals(project.getOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, true))) {
1964
				long projectTargetJDK = CompilerOptions.versionToJdkLevel(project.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true));
1970
				long projectTargetJDK = CompilerOptions.versionToJdkLevel(project.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true));
1965
				long libraryJDK = Util.getJdkLevel(target);
1971
				long libraryJDK = Util.getJdkLevel(target);

Return to bug 248661