View | Details | Raw Unified | Return to bug 81122
Collapse All | Expand All

(-)SearchableEnvironment.java (-8 / +13 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.core;
11
package org.eclipse.jdt.internal.core;
12
12
13
import java.util.Map;
14
13
import org.eclipse.core.runtime.IProgressMonitor;
15
import org.eclipse.core.runtime.IProgressMonitor;
14
import org.eclipse.core.runtime.OperationCanceledException;
16
import org.eclipse.core.runtime.OperationCanceledException;
15
import org.eclipse.jdt.core.*;
17
import org.eclipse.jdt.core.*;
Lines 100-113 Link Here
100
			
102
			
101
			if (this.checkAccessRestrictions && (isBinary || !type.getJavaProject().equals(this.project))) {
103
			if (this.checkAccessRestrictions && (isBinary || !type.getJavaProject().equals(this.project))) {
102
				PackageFragmentRoot root = (PackageFragmentRoot)type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
104
				PackageFragmentRoot root = (PackageFragmentRoot)type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
103
				ClasspathEntry entry = (ClasspathEntry) this.nameLookup.rootToResolvedEntries.get(root);
105
				Map map = this.nameLookup.rootToResolvedEntries;
104
				if (entry != null) { // reverse map always contains resolved CP entry
106
				if (map != null) { //bug 81122
105
					accessRestriction = entry.getImportRestriction();
107
					ClasspathEntry entry = (ClasspathEntry) map.get(root);
106
					if (accessRestriction != null) {
108
					if (entry != null) { // reverse map always contains resolved CP entry
107
						// TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly
109
						accessRestriction = entry.getImportRestriction();
108
						char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray());
110
						if (accessRestriction != null) {
109
						char[] typeChars = typeName.toCharArray();
111
							// TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly
110
						accessRestriction = accessRestriction.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/'), null);
112
							char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray());
113
							char[] typeChars = typeName.toCharArray();
114
							accessRestriction = accessRestriction.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/'), null);
115
						}
111
					}
116
					}
112
				}
117
				}
113
			}
118
			}

Return to bug 81122