Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 119607 Details for
Bug 232816
[buildpath] Misleading problem text for missing jar in user library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch with review comments incorporated
patch.txt (text/plain), 28.86 KB, created by
Srikanth Sankaran
on 2008-12-05 05:50:50 EST
(
hide
)
Description:
Patch with review comments incorporated
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2008-12-05 05:50:50 EST
Size:
28.86 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ClasspathTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java,v >retrieving revision 1.193 >diff -u -r1.193 ClasspathTests.java >--- src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 28 Oct 2008 21:25:36 -0000 1.193 >+++ src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 5 Dec 2008 10:47:51 -0000 >@@ -40,6 +40,9 @@ > import org.eclipse.core.runtime.Path; > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.content.IContentDescription; >+import org.eclipse.core.runtime.preferences.IEclipsePreferences; >+import org.eclipse.core.runtime.preferences.InstanceScope; >+import org.eclipse.jdt.core.ClasspathContainerInitializer; > import org.eclipse.jdt.core.IAccessRule; > import org.eclipse.jdt.core.IClasspathAttribute; > import org.eclipse.jdt.core.IClasspathContainer; >@@ -59,6 +62,7 @@ > import org.eclipse.jdt.internal.core.ClasspathEntry; > import org.eclipse.jdt.internal.core.JavaModelManager; > import org.eclipse.jdt.internal.core.JavaProject; >+import org.eclipse.jdt.internal.core.UserLibraryClasspathContainer; > import org.eclipse.team.core.RepositoryProvider; > > public class ClasspathTests extends ModifyingResourceTests { >@@ -160,6 +164,238 @@ > return result; > } > >+/* https://bugs.eclipse.org/bugs/show_bug.cgi?id=232816: Misleading problem text for missing jar in user >+ * library. We now mention the container name in this and related diagnostics so the context and connection is clearer. >+ * The bunch of tests with names of the form test232816*() test several paths in the function >+ * org.eclipse.jdt.internal.core.ClasspathEntry.validateLibraryEntry(IPath, IJavaProject, String, IPath, String) >+ * with the sole objective of eliciting the various messages under the different conditions (internal/external, >+ * file/folder, problem with library/sources etc). The tests probably make not much sense other than to trigger >+ * errors. >+ */ >+ >+public void test232816() throws Exception { >+ >+ IJavaProject p = null; >+ try { >+ p = createJavaProject("P"); >+ JavaCore.setClasspathContainer( >+ new Path("container/default"), >+ new IJavaProject[]{ p }, >+ new IClasspathContainer[] { >+ new TestContainer(new Path("container/default"), >+ new IClasspathEntry[]{ >+ JavaCore.newLibraryEntry(new Path(getExternalResourcePath("libjar.jar")), new Path("/P0/SBlah"), new Path("/P0"))}) >+ }, >+ null); >+ >+ IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default")); >+ >+ IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true); >+ assertStatus( >+ "should have complained about missing library", >+ "The container \'container/default\' references non existing library \'" + getExternalResourcePath("libjar.jar") + "'", >+ status); >+ } finally { >+ deleteProject("P"); >+ } >+} >+ >+ >+public void test232816a() throws Exception { >+ >+ IJavaProject p = null; >+ try { >+ p = createJavaProject("P"); >+ addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0], >+ new String[] { >+ "META-INF/MANIFEST.MF", >+ "Manifest-Version: 1.0\n" + >+ "Class-Path: lib2.jar\n", >+ }, >+ JavaCore.VERSION_1_4); >+ refreshExternalArchives(p); >+ >+ JavaCore.setClasspathContainer( >+ new Path("container/default"), >+ new IJavaProject[]{ p }, >+ new IClasspathContainer[] { >+ new TestContainer(new Path("container/default"), >+ new IClasspathEntry[]{ >+ JavaCore.newLibraryEntry(new Path(getExternalResourcePath("lib1.jar")), new Path("/P0/SBlah"), new Path("/P0"))}) >+ }, >+ null); >+ >+ IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default")); >+ >+ IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true); >+ assertStatus( >+ "should have complained about source attachment", >+ "Invalid source attachment: '/P0/SBlah' for required library \'" + getExternalResourcePath("lib1.jar") + "' in the container 'container/default'", >+ status); >+ } finally { >+ deleteProject("P"); >+ deleteExternalResource("lib1.jar"); >+ } >+} >+ >+public void test232816b() throws Exception { >+ >+ try { >+ IJavaProject p = createJavaProject("Project"); >+ // Create new user library "SomeUserLibrary" >+ ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(JavaCore.USER_LIBRARY_CONTAINER_ID); >+ String libraryName = "SomeUserLibrary"; >+ IPath containerPath = new Path(JavaCore.USER_LIBRARY_CONTAINER_ID); >+ UserLibraryClasspathContainer containerSuggestion = new UserLibraryClasspathContainer(libraryName); >+ initializer.requestClasspathContainerUpdate(containerPath.append(libraryName), null, containerSuggestion); >+ >+ // Modify user library >+ IEclipsePreferences preferences = new InstanceScope().getNode(JavaCore.PLUGIN_ID); >+ String propertyName = JavaModelManager.CP_USERLIBRARY_PREFERENCES_PREFIX+"SomeUserLibrary"; >+ StringBuffer propertyValue = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<userlibrary systemlibrary=\"false\" version=\"1\">\r\n<archive"); >+ //String jarFullPath = getWorkspaceRoot().getLocation().append(jarFile.getFullPath()).toString(); >+ propertyValue.append(" path=\"" + "c:\\non\\existent\\bogus\\library.jar"); >+ propertyValue.append("\"/>\r\n</userlibrary>\r\n"); >+ preferences.put(propertyName, propertyValue.toString()); >+ preferences.flush(); >+ >+ >+ IClasspathEntry[] entries = p.getRawClasspath(); >+ int length = entries.length; >+ System.arraycopy(entries, 0, entries = new IClasspathEntry[length+1], 0, length); >+ entries[length] = JavaCore.newContainerEntry(containerSuggestion.getPath()); >+ p.setRawClasspath(entries, null); >+ >+ assertMarkers("Failed to find marker", "The user library 'SomeUserLibrary' references non existing library 'C:\\non\\existent\\bogus\\library.jar'", p); >+ } finally { >+ deleteProject("Project"); >+ } >+} >+ >+ >+public void test232816c() throws CoreException { >+ >+ IJavaProject p = null; >+ try { >+ >+ p = this.createJavaProject("P0", new String[] {"src0", "src1"}, "bin0"); >+ >+ JavaCore.setClasspathContainer( >+ new Path("container/default"), >+ new IJavaProject[]{ p }, >+ new IClasspathContainer[] { >+ new TestContainer(new Path("container/default"), >+ new IClasspathEntry[]{ >+ JavaCore.newLibraryEntry(new Path("/P0/JUNK"), new Path("/P0/SBlah"), new Path("/P0"))}) >+ }, >+ null); >+ >+ IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default")); >+ >+ IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true); >+ assertStatus( >+ "should have complained about missing library", >+ "The container 'container/default' references non existing library 'JUNK'", >+ status); >+ >+ } finally { >+ deleteProject ("P0"); >+ } >+} >+ >+ >+public void test232816d() throws CoreException { >+ >+ IJavaProject p = null; >+ try { >+ >+ p = this.createJavaProject("P0", new String[] {"src0", "src1"}, "bin0"); >+ >+ JavaCore.setClasspathContainer( >+ new Path("container/default"), >+ new IJavaProject[]{ p }, >+ new IClasspathContainer[] { >+ new TestContainer(new Path("container/default"), >+ new IClasspathEntry[]{ >+ JavaCore.newLibraryEntry(new Path("/P0/src0"), new Path("/P0/SBlah"), new Path("/P0"))}) >+ }, >+ null); >+ >+ IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default")); >+ >+ IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true); >+ assertStatus( >+ "should have complained about source attachment", >+ "Invalid source attachment: '/P0/SBlah' for required library '/P0/src0' in the container 'container/default'", >+ status); >+ >+ } finally { >+ deleteProject ("P0"); >+ } >+} >+ >+public void test232816e() throws CoreException { >+ >+ IJavaProject p = null; >+ try { >+ >+ p = this.createJavaProject("P0", new String[] {"src0", "src1"}, "bin0"); >+ createFile("/P0/src0/X.class", ""); >+ JavaCore.setClasspathContainer( >+ new Path("container/default"), >+ new IJavaProject[]{ p }, >+ new IClasspathContainer[] { >+ new TestContainer(new Path("container/default"), >+ new IClasspathEntry[]{ >+ JavaCore.newLibraryEntry(new Path("/P0/src0/X.class"), new Path("/P0/SBlah"), new Path("/P0"))}) >+ }, >+ null); >+ >+ IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default")); >+ >+ IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true); >+ assertStatus( >+ "should have complained about source attachment", >+ "Invalid source attachment: '/P0/SBlah' for required library '/P0/src0/X.class' in the container 'container/default'", >+ status); >+ >+ } finally { >+ deleteProject ("P0"); >+ } >+} >+ >+public void test232816f() throws Exception { >+ >+ IJavaProject p = null; >+ try { >+ p = createJavaProject("P"); >+ >+ p.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4); >+ p.setOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, JavaCore.WARNING); >+ >+ JavaCore.setClasspathContainer( >+ new Path("container/default"), >+ new IJavaProject[]{ p }, >+ new IClasspathContainer[] { >+ new TestContainer(new Path("container/default"), >+ new IClasspathEntry[]{ >+ JavaCore.newLibraryEntry(getExternalJCLPath("1.5"), new Path("/P0/SBlah"), new Path("/P0"))}) >+ }, >+ null); >+ >+ IClasspathEntry newClasspath = JavaCore.newContainerEntry(new Path("container/default")); >+ >+ IJavaModelStatus status = JavaConventions.validateClasspathEntry(p, newClasspath, true); >+ assertStatus( >+ "should have complained about jdk level mismatch", >+ "Incompatible .class files version in required binaries. Project 'P' is targeting a 1.4 runtime, but is compiled against \'" + getExternalJCLPath("1.5") + "' (from the container 'container/default') which requires a 1.5 runtime", >+ status); >+ } finally { >+ deleteProject("P"); >+ } >+} >+ >+ > /* > * Ensures that adding a library entry for an existing external library folder doesn't generate a marker > */ >@@ -2341,7 +2577,7 @@ > setClasspath(p, new IClasspathEntry[] {JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER"))}); > assertMarkers( > "Unexpected markers", >- "Project \'P\' is missing required library: \'"+ getExternalPath() + "nonExisting.jar\'", >+ "The container 'Test container' references non existing library \'" + getExternalPath() + "nonExisting.jar\'", > p); > } finally { > deleteProject("P"); >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/core/IJavaModelStatusConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java,v >retrieving revision 1.42 >diff -u -r1.42 IJavaModelStatusConstants.java >--- model/org/eclipse/jdt/core/IJavaModelStatusConstants.java 27 Jun 2008 16:04:01 -0000 1.42 >+++ model/org/eclipse/jdt/core/IJavaModelStatusConstants.java 5 Dec 2008 10:47:54 -0000 >@@ -334,4 +334,12 @@ > * @since 3.4 > */ > public static final int BAD_TEXT_EDIT_LOCATION = 1011; >+ >+ /** >+ * Status constant indicating that a project is requiring some library from a container >+ * for which the classfile JDK version level is more recent than the project JDK target >+ * level setting. This can indicate some binary incompatibility issues later on. >+ * @since 3.5 >+ */ >+ public static final int INCOMPATIBLE_JDK_LEVEL_IN_CONTAINER = 1012; > } >Index: model/org/eclipse/jdt/internal/core/ClasspathEntry.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java,v >retrieving revision 1.109 >diff -u -r1.109 ClasspathEntry.java >--- model/org/eclipse/jdt/internal/core/ClasspathEntry.java 28 Oct 2008 21:25:29 -0000 1.109 >+++ model/org/eclipse/jdt/internal/core/ClasspathEntry.java 5 Dec 2008 10:47:55 -0000 >@@ -1745,6 +1745,10 @@ > * @return a java model status describing the problem related to this classpath entry if any, a status object with code <code>IStatus.OK</code> if the entry is fine > */ > public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer){ >+ return validateClasspathEntry(project, entry, null, checkSourceAttachment, referredByContainer); >+ } >+ >+ private static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, IClasspathContainer entryContainer, boolean checkSourceAttachment, boolean referredByContainer){ > > IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); > IPath path = entry.getPath(); >@@ -1796,7 +1800,7 @@ > if (description == null) description = path.makeRelative().toString(); > return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CP_CONTAINER_ENTRY, project, path); > } >- IJavaModelStatus containerEntryStatus = validateClasspathEntry(project, containerEntry, checkSourceAttachment, true/*referred by container*/); >+ IJavaModelStatus containerEntryStatus = validateClasspathEntry(project, containerEntry, container, checkSourceAttachment, true/*referred by container*/); > if (!containerEntryStatus.isOK()){ > return containerEntryStatus; > } >@@ -1825,7 +1829,7 @@ > } > > // get validation status >- IJavaModelStatus status = validateClasspathEntry(project, entry, checkSourceAttachment, false/*not referred by container*/); >+ IJavaModelStatus status = validateClasspathEntry(project, entry, null, checkSourceAttachment, false/*not referred by container*/); > if (!status.isOK()) return status; > > // return deprecation status if any >@@ -1847,7 +1851,15 @@ > // (these entries are considered optional since the user cannot act on them) > // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=252392 > >- IJavaModelStatus status = validateLibraryEntry(path, project, checkSourceAttachment ? entry.getSourceAttachmentPath() : null, entryPathMsg); >+ String containerInfo = null; >+ if (entryContainer != null) { >+ if (entryContainer instanceof UserLibraryClasspathContainer) { >+ containerInfo = Messages.bind(Messages.classpath_userLibraryInfo, new String[] {entryContainer.getDescription()}); >+ } else { >+ containerInfo = Messages.bind(Messages.classpath_containerInfo, new String[] {entryContainer.getDescription()}); >+ } >+ } >+ IJavaModelStatus status = validateLibraryEntry(path, project, containerInfo, checkSourceAttachment ? entry.getSourceAttachmentPath() : null, entryPathMsg); > if (!status.isOK()) > return status; > break; >@@ -1916,14 +1928,21 @@ > return JavaModelStatus.VERIFIED_OK; > } > >- private static IJavaModelStatus validateLibraryEntry(IPath path, IJavaProject project, IPath sourceAttachment, String entryPathMsg) { >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=232816, Now we have the facility to include a container >+ // name in diagnostics. If the parameter ``container'' is not null, it is used to point to the library >+ // more fully. >+ private static IJavaModelStatus validateLibraryEntry(IPath path, IJavaProject project, String container, IPath sourceAttachment, String entryPathMsg) { > if (path.isAbsolute() && !path.isEmpty()) { > Object target = JavaModel.getTarget(path, true); > if (target != null && !JavaCore.IGNORE.equals(project.getOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, true))) { > long projectTargetJDK = CompilerOptions.versionToJdkLevel(project.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true)); > long libraryJDK = Util.getJdkLevel(target); > if (libraryJDK != 0 && libraryJDK > projectTargetJDK) { >- return new JavaModelStatus(IJavaModelStatusConstants.INCOMPATIBLE_JDK_LEVEL, project, path, CompilerOptions.versionFromJdkLevel(libraryJDK)); >+ if (container != null) { >+ return new JavaModelStatus(IJavaModelStatusConstants.INCOMPATIBLE_JDK_LEVEL_IN_CONTAINER, Messages.bind(Messages.classpath_incompatibleLibraryJDKLevelInContainer, new String [] {project.getElementName(), CompilerOptions.versionFromJdkLevel(projectTargetJDK), path.toString(), container, CompilerOptions.versionFromJdkLevel(libraryJDK)})); >+ } else { >+ return new JavaModelStatus(IJavaModelStatusConstants.INCOMPATIBLE_JDK_LEVEL, project, path, CompilerOptions.versionFromJdkLevel(libraryJDK)); >+ } > } > } > if (target instanceof IResource){ >@@ -1933,39 +1952,67 @@ > if (sourceAttachment != null > && !sourceAttachment.isEmpty() > && JavaModel.getTarget(sourceAttachment, true) == null){ >- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundSourceAttachment, new String [] {sourceAttachment.toString(), path.toString(), project.getElementName()})); >+ if (container != null) { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundSourceAttachmentInContainedLibrary, new String [] {sourceAttachment.toString(), path.toString(), container})); >+ } else { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundSourceAttachment, new String [] {sourceAttachment.toString(), path.toString(), project.getElementName()})); >+ } > } > break; > case IResource.FOLDER : // internal binary folder > if (sourceAttachment != null > && !sourceAttachment.isEmpty() > && JavaModel.getTarget(sourceAttachment, true) == null){ >- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundSourceAttachment, new String [] {sourceAttachment.toString(), path.toString(), project.getElementName()})); >+ if (container != null) { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundSourceAttachmentInContainedLibrary, new String [] {sourceAttachment.toString(), path.toString(), container})); >+ } else { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundSourceAttachment, new String [] {sourceAttachment.toString(), path.toString(), project.getElementName()})); >+ } > } > } > } else if (target instanceof File){ > File file = JavaModel.getFile(target); > if (file == null) { >- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_illegalExternalFolder, new String[] {path.toOSString(), project.getElementName()})); >+ if (container != null) { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_illegalExternalFolderInContainer, new String[] {path.toOSString(), container})); >+ } else { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_illegalExternalFolder, new String[] {path.toOSString(), project.getElementName()})); >+ } > } else if (sourceAttachment != null > && !sourceAttachment.isEmpty() > && JavaModel.getTarget(sourceAttachment, true) == null){ >- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundSourceAttachment, new String [] {sourceAttachment.toString(), path.toOSString(), project.getElementName()})); >- } >+ if (container != null) { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundSourceAttachmentInContainedLibrary, new String [] {sourceAttachment.toString(), path.toOSString(), container})); >+ } else { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundSourceAttachment, new String [] {sourceAttachment.toString(), path.toOSString(), project.getElementName()})); >+ } >+ } > } else { > boolean isExternal = path.getDevice() != null || !ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0)).exists(); > if (isExternal) { >- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibrary, new String[] {path.toOSString(), project.getElementName()})); >+ if (container != null) { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibraryInContainer, new String[] {path.toOSString(), container})); >+ } else { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibrary, new String[] {path.toOSString(), project.getElementName()})); >+ } > } else { > if (entryPathMsg == null) > entryPathMsg = project.getElementName().equals(path.segment(0)) ? path.removeFirstSegments(1).makeRelative().toString() : path.toString(); >- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibrary, new String[] {entryPathMsg, project.getElementName()})); >+ if (container!= null) { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibraryInContainer, new String[] {entryPathMsg, container})); >+ } else { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundLibrary, new String[] {entryPathMsg, project.getElementName()})); >+ } > } > } > } else { > if (entryPathMsg == null) > entryPathMsg = project.getElementName().equals(path.segment(0)) ? path.removeFirstSegments(1).makeRelative().toString() : path.toString(); >- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_illegalLibraryPath, new String[] {entryPathMsg, project.getElementName()})); >+ if (container != null) { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_illegalLibraryPathInContainer, new String[] {entryPathMsg, container})); >+ } else { >+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_illegalLibraryPath, new String[] {entryPathMsg, project.getElementName()})); >+ } > } > return JavaModelStatus.VERIFIED_OK; > } >Index: model/org/eclipse/jdt/internal/core/util/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties,v >retrieving revision 1.73 >diff -u -r1.73 messages.properties >--- model/org/eclipse/jdt/internal/core/util/messages.properties 10 Oct 2008 07:28:57 -0000 1.73 >+++ model/org/eclipse/jdt/internal/core/util/messages.properties 5 Dec 2008 10:47:56 -0000 >@@ -145,8 +145,10 @@ > classpath_illegalContainerPath = Illegal classpath container path: ''{0}'' in project ''{1}'', must have at least one segment (containerID+hints) > classpath_illegalEntryInClasspathFile = Illegal entry in ''.classpath'' of project ''{0}'' file: {1} > classpath_illegalLibraryPath = Illegal path for required library: ''{0}'' in project ''{1}'' >+classpath_illegalLibraryPathInContainer = Illegal path for required library: ''{0}'' in the {1} > classpath_illegalLibraryArchive = Illegal type of archive for required library: ''{0}'' in project ''{1}'' > classpath_illegalExternalFolder = Required library cannot denote external folder: ''{0}'' for project ''{1}'' >+classpath_illegalExternalFolderInContainer = Required library cannot denote external folder: ''{0}'' in the {1} > classpath_illegalProjectPath = Illegal path for required project: ''{0}'' in project ''{1}'' > classpath_illegalSourceFolderPath = Illegal path for required source folder: ''{0}'' in project ''{1}'' > classpath_illegalVariablePath = Illegal classpath variable path: ''{0}'' in project ''{1}'', must have at least one segment >@@ -155,10 +157,14 @@ > classpath_mustEndWithSlash = End exclusion filter ''{0}'' with / to fully exclude ''{1}'' > classpath_unboundContainerPath = Unbound classpath container: ''{0}'' in project ''{1}'' > classpath_unboundLibrary = Project ''{1}'' is missing required library: ''{0}'' >+classpath_userLibraryInfo = user library ''{0}'' >+classpath_containerInfo = container ''{0}'' >+classpath_unboundLibraryInContainer = The {1} references non existing library ''{0}'' > classpath_unboundProject = Project ''{1}'' is missing required Java project: ''{0}'' > classpath_settingOutputLocationProgress = Setting output location for: ''{0}'' > classpath_settingProgress = Setting classpath for: {0} >-classpath_unboundSourceAttachment = Invalid source attachment: ''{0}'' for required library ''{1}'' in project ''{1}'' >+classpath_unboundSourceAttachment = Invalid source attachment: ''{0}'' for required library ''{1}'' in project ''{2}'' >+classpath_unboundSourceAttachmentInContainedLibrary = Invalid source attachment: ''{0}'' for required library ''{1}'' in the {2} > classpath_unboundSourceFolder = Project ''{1}'' is missing required source folder: ''{0}'' > classpath_unboundVariablePath = Unbound classpath variable: ''{0}'' in project ''{1}'' > classpath_unknownKind = Unknown kind: ''{0}'' >@@ -166,6 +172,7 @@ > classpath_disabledInclusionExclusionPatterns = Inclusion or exclusion patterns are disabled in project ''{1}'', cannot selectively include or exclude from entry: ''{0}'' > classpath_disabledMultipleOutputLocations = Multiple output locations are disabled in project ''{1}'', cannot associate entry: ''{0}'' with a specific output > classpath_incompatibleLibraryJDKLevel = Incompatible .class files version in required binaries. Project ''{0}'' is targeting a {1} runtime, but is compiled against ''{2}'' which requires a {3} runtime >+classpath_incompatibleLibraryJDKLevelInContainer = Incompatible .class files version in required binaries. Project ''{0}'' is targeting a {1} runtime, but is compiled against ''{2}'' (from the {3}) which requires a {4} runtime > classpath_duplicateEntryExtraAttribute = Duplicate extra attribute: ''{0}'' in classpath entry ''{1}'' for project ''{2}'' > classpath_deprecated_variable = Classpath variable ''{0}'' in project ''{1}'' is deprecated: {2} > >Index: model/org/eclipse/jdt/internal/core/util/Messages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java,v >retrieving revision 1.24 >diff -u -r1.24 Messages.java >--- model/org/eclipse/jdt/internal/core/util/Messages.java 10 Oct 2008 07:28:57 -0000 1.24 >+++ model/org/eclipse/jdt/internal/core/util/Messages.java 5 Dec 2008 10:47:55 -0000 >@@ -149,8 +149,10 @@ > public static String classpath_illegalContainerPath; > public static String classpath_illegalEntryInClasspathFile; > public static String classpath_illegalLibraryPath; >+ public static String classpath_illegalLibraryPathInContainer; > public static String classpath_illegalLibraryArchive; > public static String classpath_illegalExternalFolder; >+ public static String classpath_illegalExternalFolderInContainer; > public static String classpath_illegalProjectPath; > public static String classpath_illegalSourceFolderPath; > public static String classpath_illegalVariablePath; >@@ -159,10 +161,14 @@ > public static String classpath_mustEndWithSlash; > public static String classpath_unboundContainerPath; > public static String classpath_unboundLibrary; >+ public static String classpath_userLibraryInfo; >+ public static String classpath_containerInfo; >+ public static String classpath_unboundLibraryInContainer; > public static String classpath_unboundProject; > public static String classpath_settingOutputLocationProgress; > public static String classpath_settingProgress; > public static String classpath_unboundSourceAttachment; >+ public static String classpath_unboundSourceAttachmentInContainedLibrary; > public static String classpath_unboundSourceFolder; > public static String classpath_unboundVariablePath; > public static String classpath_unknownKind; >@@ -170,6 +176,7 @@ > public static String classpath_disabledInclusionExclusionPatterns; > public static String classpath_disabledMultipleOutputLocations; > public static String classpath_incompatibleLibraryJDKLevel; >+ public static String classpath_incompatibleLibraryJDKLevelInContainer; > public static String classpath_duplicateEntryExtraAttribute; > public static String classpath_deprecated_variable; > public static String file_notFound;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 232816
:
119358
|
119607
|
119748