### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java,v retrieving revision 1.2 diff -u -r1.2 ClasspathLocation.java --- batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java 1 Jun 2005 09:06:28 -0000 1.2 +++ batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java 6 Dec 2005 16:11:18 -0000 @@ -10,6 +10,9 @@ *******************************************************************************/ package org.eclipse.jdt.internal.compiler.batch; +import java.io.File; + +import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.internal.compiler.env.AccessRestriction; import org.eclipse.jdt.internal.compiler.env.AccessRuleSet; import org.eclipse.jdt.internal.compiler.util.SuffixConstants; @@ -29,16 +32,21 @@ * * @param qualifiedBinaryFileName * tested type specification, formed as: - * "org/eclipse/jdt/core/JavaCore.class" + * "org/eclipse/jdt/core/JavaCore.class"; on systems that + * use \ as File.separator, the + * "org\eclipse\jdt\core\JavaCore.class" is accepted as well * @return the first access rule which is violated when accessing a given * type, or null if none applies */ AccessRestriction fetchAccessRestriction(String qualifiedBinaryFileName) { if (this.accessRuleSet == null) return null; - return this.accessRuleSet - .getViolatedRestriction( - qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length() - SUFFIX_CLASS.length) - .toCharArray()); + char [] qualifiedTypeName = qualifiedBinaryFileName. + substring(0, qualifiedBinaryFileName.length() - SUFFIX_CLASS.length) + .toCharArray(); + if (File.separatorChar == '\\') { + CharOperation.replace(qualifiedTypeName, File.separatorChar, '/'); + } + return this.accessRuleSet.getViolatedRestriction(qualifiedTypeName); } } Index: compiler/org/eclipse/jdt/internal/compiler/env/AccessRuleSet.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/AccessRuleSet.java,v retrieving revision 1.7 diff -u -r1.7 AccessRuleSet.java --- compiler/org/eclipse/jdt/internal/compiler/env/AccessRuleSet.java 6 Dec 2005 11:56:53 -0000 1.7 +++ compiler/org/eclipse/jdt/internal/compiler/env/AccessRuleSet.java 6 Dec 2005 16:11:18 -0000 @@ -58,17 +58,10 @@ * Select the first access rule which is violated when accessing a given type, * or null if no 'non accessible' access rule applies. * @param targetTypeFilePath the target type file path, formed as: - * "org/eclipse/jdt/core/JavaCore"; on systems that use '\' as their file - * separator, the alternative format: "org\eclipse\jdt\core\JavaCore" is - * accepted as well; the use of a mix of separators is tolerated but - * discouraged. + * "org/eclipse/jdt/core/JavaCore" * @return the first access restriction that applies if any, null else */ public AccessRestriction getViolatedRestriction(char[] targetTypeFilePath) { - if (File.separatorChar == '\\') { - targetTypeFilePath = CharOperation.replaceOnCopy(targetTypeFilePath, - File.separatorChar, '/'); - } for (int i = 0, length = this.accessRules.length; i < length; i++) { AccessRule accessRule = this.accessRules[i]; if (CharOperation.pathMatch(accessRule.pattern, targetTypeFilePath,