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 157369 Details for
Bug 300136
classpathentry OPTIONAL attribute not honored for var entries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed Patch
patch_300136.txt (text/plain), 5.77 KB, created by
Jay Arthanareeswaran
on 2010-01-26 23:07:47 EST
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2010-01-26 23:07:47 EST
Size:
5.77 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.122 >diff -u -r1.122 ClasspathEntry.java >--- model/org/eclipse/jdt/internal/core/ClasspathEntry.java 7 Jan 2010 20:18:49 -0000 1.122 >+++ model/org/eclipse/jdt/internal/core/ClasspathEntry.java 27 Jan 2010 04:02:27 -0000 >@@ -1758,8 +1758,14 @@ > */ > public static IJavaModelStatus validateClasspathEntry(IJavaProject project, IClasspathEntry entry, boolean checkSourceAttachment, boolean referredByContainer){ > IJavaModelStatus status = validateClasspathEntry(project, entry, null, checkSourceAttachment, referredByContainer); >- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171136, ignore class path errors from optional entries. >- if (status.getCode() == IJavaModelStatusConstants.INVALID_CLASSPATH && ((ClasspathEntry) entry).isOptional()) >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=171136 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136 >+ // Ignore class path errors from optional entries. >+ int statusCode = status.getCode(); >+ if ( (statusCode == IJavaModelStatusConstants.INVALID_CLASSPATH || >+ statusCode == IJavaModelStatusConstants.CP_CONTAINER_PATH_UNBOUND || >+ statusCode == IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND || >+ statusCode == IJavaModelStatusConstants.INVALID_PATH) && >+ ((ClasspathEntry) entry).isOptional()) > return JavaModelStatus.VERIFIED_OK; > return status; > } >#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.203 >diff -u -r1.203 ClasspathTests.java >--- src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 21 Aug 2009 05:17:28 -0000 1.203 >+++ src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 27 Jan 2010 04:02:35 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -5971,5 +5971,90 @@ > this.deleteProject("P"); > } > } >+/** >+ * @bug 300136:classpathentry OPTIONAL attribute not honored for var entries >+ * >+ * Test that classpath entries (CPE_LIB, CPE_CONTAINER and CPE_VARIABLE) that are marked as optional >+ * in the .classpath file are not reported for errors. >+ * >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136" >+ */ >+public void testBug300136() throws Exception { >+ boolean autoBuild = getWorkspace().isAutoBuilding(); >+ IWorkspaceDescription preferences = getWorkspace().getDescription(); >+ try { >+ preferences.setAutoBuilding(false); >+ IJavaProject project = createJavaProject("P"); >+ StringBuffer buffer = new StringBuffer( >+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + >+ "<classpath>\n" + >+ " <classpathentry kind=\"var\" path=\"TEST_LIB\">\n" + >+ " <attributes>\n" + >+ " <attribute name=\"optional\" value=\"true\"/>" + >+ " </attributes>\n" + >+ " </classpathentry>\n" + >+ " <classpathentry kind=\"var\" path=\"UNBOUND_VAR\">\n" + >+ " <attributes>\n" + >+ " <attribute name=\"optional\" value=\"true\"/>" + >+ " </attributes>\n" + >+ " </classpathentry>\n" + >+ " <classpathentry kind=\"con\" path=\"org.eclipse.jdt.core.tests.model.TEST_CONTAINER\">\n" + >+ " <attributes>\n" + >+ " <attribute name=\"optional\" value=\"true\"/>" + >+ " </attributes>\n" + >+ " </classpathentry>\n" + >+ " <classpathentry kind=\"output\" path=\"bin\"/>\n" + >+ "</classpath>" >+ ); >+ editFile( >+ "/P/.classpath", >+ buffer.toString() >+ ); >+ assertMarkers( >+ "Unexpected markers", >+ "", >+ project); >+ } finally { >+ preferences.setAutoBuilding(autoBuild); >+ deleteProject("P"); >+ } >+} >+/** >+ * Additional test for bug 300136 - Test that the the errors are reported when the >+ * optional attribute is not used. >+ * >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=300136" >+ */ >+public void testBug300136a() throws Exception { >+ boolean autoBuild = getWorkspace().isAutoBuilding(); >+ IWorkspaceDescription preferences = getWorkspace().getDescription(); >+ try { >+ preferences.setAutoBuilding(false); >+ IJavaProject project = createJavaProject("P"); >+ StringBuffer buffer = new StringBuffer( >+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + >+ "<classpath>\n" + >+ " <classpathentry kind=\"var\" path=\"TEST_LIB\" />\n" + >+ " <classpathentry kind=\"var\" path=\"UNBOUND_VAR\" />\n" + >+ " <classpathentry kind=\"con\" path=\"org.eclipse.jdt.core.tests.model.TEST_CONTAINER\">\n" + >+ " </classpathentry>\n" + >+ " <classpathentry kind=\"output\" path=\"bin\"/>\n" + >+ "</classpath>" >+ ); >+ editFile( >+ "/P/.classpath", >+ buffer.toString() >+ ); >+ assertMarkers( >+ "Unexpected markers", >+ "Project \'P\' is missing required library: \'\\lib\\tmp.jar\'\n" + >+ "Unbound classpath container: \'org.eclipse.jdt.core.tests.model.TEST_CONTAINER\' in project \'P\'\n" + >+ "Unbound classpath variable: \'UNBOUND_VAR\' in project \'P\'", >+ project); >+ } finally { >+ preferences.setAutoBuilding(autoBuild); >+ deleteProject("P"); >+ } >+} > > }
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
Flags:
jarthana
:
review?
Actions:
View
|
Diff
Attachments on
bug 300136
: 157369