Lines 12-17
Link Here
|
12 |
package org.eclipse.jdt.internal.core.search; |
12 |
package org.eclipse.jdt.internal.core.search; |
13 |
|
13 |
|
14 |
import org.eclipse.core.runtime.Path; |
14 |
import org.eclipse.core.runtime.Path; |
|
|
15 |
import org.eclipse.jdt.core.IAccessRule; |
15 |
import org.eclipse.jdt.core.IClassFile; |
16 |
import org.eclipse.jdt.core.IClassFile; |
16 |
import org.eclipse.jdt.core.ICompilationUnit; |
17 |
import org.eclipse.jdt.core.ICompilationUnit; |
17 |
import org.eclipse.jdt.core.IJavaElement; |
18 |
import org.eclipse.jdt.core.IJavaElement; |
Lines 20-25
Link Here
|
20 |
import org.eclipse.jdt.core.IType; |
21 |
import org.eclipse.jdt.core.IType; |
21 |
import org.eclipse.jdt.core.JavaModelException; |
22 |
import org.eclipse.jdt.core.JavaModelException; |
22 |
import org.eclipse.jdt.core.compiler.CharOperation; |
23 |
import org.eclipse.jdt.core.compiler.CharOperation; |
|
|
24 |
import org.eclipse.jdt.core.compiler.IProblem; |
23 |
import org.eclipse.jdt.core.search.IJavaSearchScope; |
25 |
import org.eclipse.jdt.core.search.IJavaSearchScope; |
24 |
import org.eclipse.jdt.core.search.TypeNameMatchRequestor; |
26 |
import org.eclipse.jdt.core.search.TypeNameMatchRequestor; |
25 |
import org.eclipse.jdt.core.search.TypeNameRequestor; |
27 |
import org.eclipse.jdt.core.search.TypeNameRequestor; |
Lines 80-85
Link Here
|
80 |
* @see org.eclipse.jdt.internal.core.search.IRestrictedAccessTypeRequestor#acceptType(int, char[], char[], char[][], java.lang.String, org.eclipse.jdt.internal.compiler.env.AccessRestriction) |
82 |
* @see org.eclipse.jdt.internal.core.search.IRestrictedAccessTypeRequestor#acceptType(int, char[], char[], char[][], java.lang.String, org.eclipse.jdt.internal.compiler.env.AccessRestriction) |
81 |
*/ |
83 |
*/ |
82 |
public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) { |
84 |
public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) { |
|
|
85 |
|
86 |
// Get type |
83 |
try { |
87 |
try { |
84 |
IType type = null; |
88 |
IType type = null; |
85 |
if (this.handleFactory != null) { |
89 |
if (this.handleFactory != null) { |
Lines 108-117
Link Here
|
108 |
? createTypeFromPath(path, new String(simpleTypeName), enclosingTypeNames) |
112 |
? createTypeFromPath(path, new String(simpleTypeName), enclosingTypeNames) |
109 |
: createTypeFromJar(path, separatorIndex); |
113 |
: createTypeFromJar(path, separatorIndex); |
110 |
} |
114 |
} |
|
|
115 |
|
116 |
// Accept match if the type has been found |
111 |
if (type != null) { |
117 |
if (type != null) { |
112 |
// hierarchy scopes require one more check: |
118 |
// hierarchy scopes require one more check: |
113 |
if (!(this.scope instanceof HierarchyScope) || ((HierarchyScope)this.scope).enclosesFineGrained(type)) { |
119 |
if (!(this.scope instanceof HierarchyScope) || ((HierarchyScope)this.scope).enclosesFineGrained(type)) { |
114 |
this.requestor.acceptTypeNameMatch(new JavaSearchTypeNameMatch(type, modifiers)); |
120 |
|
|
|
121 |
// Create the match |
122 |
final JavaSearchTypeNameMatch match = new JavaSearchTypeNameMatch(type, modifiers); |
123 |
|
124 |
// Update match accessibility |
125 |
if(access != null) { |
126 |
switch (access.getProblemId()) { |
127 |
case IProblem.ForbiddenReference: |
128 |
match.setAccessibility(IAccessRule.K_NON_ACCESSIBLE); |
129 |
break; |
130 |
case IProblem.DiscouragedReference: |
131 |
match.setAccessibility(IAccessRule.K_DISCOURAGED); |
132 |
break; |
133 |
} |
134 |
} |
135 |
|
136 |
// Accept match |
137 |
this.requestor.acceptTypeNameMatch(match); |
115 |
} |
138 |
} |
116 |
} |
139 |
} |
117 |
} catch (JavaModelException e) { |
140 |
} catch (JavaModelException e) { |