Lines 10-15
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.jdt.internal.compiler.batch; |
11 |
package org.eclipse.jdt.internal.compiler.batch; |
12 |
|
12 |
|
|
|
13 |
import java.io.File; |
14 |
|
15 |
import org.eclipse.jdt.core.compiler.CharOperation; |
13 |
import org.eclipse.jdt.internal.compiler.env.AccessRestriction; |
16 |
import org.eclipse.jdt.internal.compiler.env.AccessRestriction; |
14 |
import org.eclipse.jdt.internal.compiler.env.AccessRuleSet; |
17 |
import org.eclipse.jdt.internal.compiler.env.AccessRuleSet; |
15 |
import org.eclipse.jdt.internal.compiler.util.SuffixConstants; |
18 |
import org.eclipse.jdt.internal.compiler.util.SuffixConstants; |
Lines 29-44
Link Here
|
29 |
* |
32 |
* |
30 |
* @param qualifiedBinaryFileName |
33 |
* @param qualifiedBinaryFileName |
31 |
* tested type specification, formed as: |
34 |
* tested type specification, formed as: |
32 |
* "org/eclipse/jdt/core/JavaCore.class" |
35 |
* "org/eclipse/jdt/core/JavaCore.class"; on systems that |
|
|
36 |
* use \ as File.separator, the |
37 |
* "org\eclipse\jdt\core\JavaCore.class" is accepted as well |
33 |
* @return the first access rule which is violated when accessing a given |
38 |
* @return the first access rule which is violated when accessing a given |
34 |
* type, or null if none applies |
39 |
* type, or null if none applies |
35 |
*/ |
40 |
*/ |
36 |
AccessRestriction fetchAccessRestriction(String qualifiedBinaryFileName) { |
41 |
AccessRestriction fetchAccessRestriction(String qualifiedBinaryFileName) { |
37 |
if (this.accessRuleSet == null) |
42 |
if (this.accessRuleSet == null) |
38 |
return null; |
43 |
return null; |
39 |
return this.accessRuleSet |
44 |
char [] qualifiedTypeName = qualifiedBinaryFileName. |
40 |
.getViolatedRestriction( |
45 |
substring(0, qualifiedBinaryFileName.length() - SUFFIX_CLASS.length) |
41 |
qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length() - SUFFIX_CLASS.length) |
46 |
.toCharArray(); |
42 |
.toCharArray()); |
47 |
if (File.separatorChar == '\\') { |
|
|
48 |
CharOperation.replace(qualifiedTypeName, File.separatorChar, '/'); |
49 |
} |
50 |
return this.accessRuleSet.getViolatedRestriction(qualifiedTypeName); |
43 |
} |
51 |
} |
44 |
} |
52 |
} |