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 57926 Details for
Bug 172207
[model] Marker for deprecated classpath variable should always have WARNING severity
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 4.04 KB, created by
Frederic Fusier
on 2007-01-31 13:25:58 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-01-31 13:25:58 EST
Size:
4.04 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java,v >retrieving revision 1.43 >diff -u -r1.43 ClasspathInitializerTests.java >--- src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java 19 Jan 2007 17:10:23 -0000 1.43 >+++ src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java 31 Jan 2007 18:23:57 -0000 >@@ -1198,6 +1198,46 @@ > } > > /** >+ * @bug 172207: [model] Marker for deprecated classpath variable should always have WARNING severity >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=172207" >+ */ >+public void testVariableInitializerBug172207() throws CoreException { >+ try { >+ // Create initializer >+ String varName = "TEST_DEPRECATED_READ_ONLY"; >+ String path = "/P1/lib.jar"; >+ VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] { varName, path })); >+ assertEquals("JavaCore classpath value should have been initialized", JavaCore.getClasspathVariable(varName).toString(), path); >+ >+ // verify that Classpath Variable is read-only >+ assertEquals("JavaCore classpath variable should be deprecated", "A deprecated and read-only initializer", JavaCore.getClasspathVariableDeprecationMessage(varName)); >+ assertTrue("JavaCore classpath variable should be read-only", JavaCore.isClasspathVariableReadOnly(varName)); >+ >+ // Create project >+ IJavaProject project = createJavaProject("P1"); >+ createFile("/P1/lib.jar", ""); >+ IClasspathEntry variable = JavaCore.newVariableEntry(new Path("TEST_DEPRECATED_READ_ONLY"), null, null); >+ IClasspathEntry[] entries = project.getRawClasspath(); >+ int length = entries.length; >+ System.arraycopy(entries, 0, entries = new IClasspathEntry[length+1], 0, length); >+ entries[length] = variable; >+ project.setRawClasspath(entries, null); >+ >+ // verify markers >+ waitForAutoBuild(); >+ IMarker[] markers = project.getProject().findMarkers(IJavaModelMarker.BUILDPATH_PROBLEM_MARKER, false, IResource.DEPTH_ZERO); >+ sortMarkers(markers); >+ assertMarkers("Unexpected marker(s)", >+ "Classpath variable 'TEST_DEPRECATED_READ_ONLY' in project P1 is deprecated: 'A deprecated and read-only initializer'", >+ markers); >+ assertEquals("Marker on deprecated variable should be a WARNING", IMarker.SEVERITY_WARNING, markers[0].getAttribute(IMarker.SEVERITY, -1)); >+ } finally { >+ VariablesInitializer.reset(); >+ deleteProject("P1"); >+ } >+} >+ >+/** > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=61872" > */ > public void testUserLibraryInitializer1() throws CoreException { >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavaProject.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java,v >retrieving revision 1.379 >diff -u -r1.379 JavaProject.java >--- model/org/eclipse/jdt/internal/core/JavaProject.java 31 Jan 2007 07:47:25 -0000 1.379 >+++ model/org/eclipse/jdt/internal/core/JavaProject.java 31 Jan 2007 18:24:06 -0000 >@@ -37,6 +37,7 @@ > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Path; > import org.eclipse.core.runtime.Preferences; > import org.eclipse.core.runtime.QualifiedName; >@@ -786,7 +787,8 @@ > default: > IPath path = status.getPath(); > if (path != null) arguments = new String[] { path.toString() }; >- if (JavaCore.ERROR.equals(getOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, true))) { >+ if (JavaCore.ERROR.equals(getOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, true)) && >+ status.getSeverity() != IStatus.WARNING) { > severity = IMarker.SEVERITY_ERROR; > } else { > severity = IMarker.SEVERITY_WARNING;
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 172207
: 57926