### 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.115
diff -u -r1.115 ClasspathEntry.java
--- model/org/eclipse/jdt/internal/core/ClasspathEntry.java 7 Mar 2009 00:58:57 -0000 1.115
+++ model/org/eclipse/jdt/internal/core/ClasspathEntry.java 17 Apr 2009 18:51:42 -0000
@@ -17,6 +17,7 @@
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
+import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -912,7 +913,7 @@
if (manifest == null)
return null;
// non-null implies regular file
- reader = new BufferedReader(new InputStreamReader(zip.getInputStream(manifest)));
+ reader = new BufferedReader(new InputStreamReader(zip.getInputStream(manifest), Charset.forName(org.eclipse.jdt.internal.compiler.util.Util.UTF_8)));
ManifestAnalyzer analyzer = new ManifestAnalyzer();
boolean success = analyzer.analyzeManifestContents(reader);
calledFileNames = analyzer.getCalledFileNames();
@@ -1462,7 +1463,7 @@
*
The project output location path cannot be null, must be absolute and located inside the project.
* Specific output locations (specified on source entries) can be null, if not they must be located inside the project,
* A project entry cannot refer to itself directly (that is, a project cannot prerequisite itself).
- * Classpath entries or output locations cannot coincidate or be nested in each other, except for the following scenarii listed below:
+ * Classpath entries or output locations cannot coincidate or be nested in each other, except for the following scenarii listed below:
* - A source folder can coincidate with its own output location, in which case this output can then contain library archives.
* However, a specific output location cannot coincidate with any library or a distinct source folder than the one referring to it.
* - A source/library folder can be nested in any source folder as long as the nested folder is excluded from the enclosing one.
@@ -1581,8 +1582,8 @@
}
// check nesting across output locations
for (int i = 1 /*no check for default output*/ ; i < outputCount; i++) {
- IPath customOutput = outputLocations[i];
- int index;
+ IPath customOutput = outputLocations[i];
+ int index;
// check nesting
if ((index = Util.indexOfEnclosingPath(customOutput, outputLocations, outputCount)) != -1 && index != i) {
if (index == 0) {
@@ -1681,26 +1682,26 @@
}
// prevent nesting output location inside entry unless enclosing is a source entry which explicitly exclude the output location
- char[][] inclusionPatterns = ((ClasspathEntry)entry).fullInclusionPatternChars();
- char[][] exclusionPatterns = ((ClasspathEntry)entry).fullExclusionPatternChars();
- for (int j = 0; j < outputCount; j++){
- IPath currentOutput = outputLocations[j];
- if (entryPath.equals(currentOutput)) continue;
+ char[][] inclusionPatterns = ((ClasspathEntry)entry).fullInclusionPatternChars();
+ char[][] exclusionPatterns = ((ClasspathEntry)entry).fullExclusionPatternChars();
+ for (int j = 0; j < outputCount; j++){
+ IPath currentOutput = outputLocations[j];
+ if (entryPath.equals(currentOutput)) continue;
if (entryPath.isPrefixOf(currentOutput)) {
if (kind != IClasspathEntry.CPE_SOURCE || !Util.isExcluded(currentOutput, inclusionPatterns, exclusionPatterns, true)) {
return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_cannotNestOutputInEntry, new String[] {currentOutput.makeRelative().toString(), entryPath.makeRelative().toString()}));
}
}
- }
+ }
- // prevent nesting entry inside output location - when distinct from project or a source folder
- for (int j = 0; j < outputCount; j++){
- if (allowNestingInOutputLocations[j]) continue;
- IPath currentOutput = outputLocations[j];
+ // prevent nesting entry inside output location - when distinct from project or a source folder
+ for (int j = 0; j < outputCount; j++){
+ if (allowNestingInOutputLocations[j]) continue;
+ IPath currentOutput = outputLocations[j];
if (currentOutput.isPrefixOf(entryPath)) {
return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_cannotNestEntryInOutput, new String[] {entryPath.makeRelative().toString(), currentOutput.makeRelative().toString()}));
}
- }
+ }
}
// ensure that no specific output is coincidating with another source folder (only allowed if matching current source folder)
// 36465 - for 2.0 backward compatibility, only check specific output locations (the default can still coincidate)
@@ -1921,7 +1922,7 @@
// project source folder
case IClasspathEntry.CPE_SOURCE :
if (((entry.getInclusionPatterns() != null && entry.getInclusionPatterns().length > 0)
- || (entry.getExclusionPatterns() != null && entry.getExclusionPatterns().length > 0))
+ || (entry.getExclusionPatterns() != null && entry.getExclusionPatterns().length > 0))
&& JavaCore.DISABLED.equals(project.getOption(JavaCore.CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS, true))) {
return new JavaModelStatus(IJavaModelStatusConstants.DISABLED_CP_EXCLUSION_PATTERNS, project, path);
}
@@ -2014,21 +2015,21 @@
}
} else if (target instanceof File){
File file = JavaModel.getFile(target);
- if (file == null) {
- 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
+ if (file == null) {
+ 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){
- 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()}));
- }
- }
+ 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) {
Index: batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java,v
retrieving revision 1.50
diff -u -r1.50 ClasspathJar.java
--- batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java 7 Mar 2009 00:59:05 -0000 1.50
+++ batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java 17 Apr 2009 18:51:42 -0000
@@ -14,6 +14,7 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;
@@ -53,7 +54,7 @@
ArrayList result = new ArrayList();
ZipEntry manifest = this.zipFile.getEntry("META-INF/MANIFEST.MF"); //$NON-NLS-1$
if (manifest != null) { // non-null implies regular file
- reader = new BufferedReader(new InputStreamReader(this.zipFile.getInputStream(manifest)));
+ reader = new BufferedReader(new InputStreamReader(this.zipFile.getInputStream(manifest), Charset.forName(Util.UTF_8)));
ManifestAnalyzer analyzer = new ManifestAnalyzer();
boolean success = analyzer.analyzeManifestContents(reader);
List calledFileNames = analyzer.getCalledFileNames();