Index: SearchableEnvironment.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java,v retrieving revision 1.48 diff -u -r1.48 SearchableEnvironment.java --- SearchableEnvironment.java 10 Dec 2004 14:14:01 -0000 1.48 +++ SearchableEnvironment.java 15 Dec 2004 12:47:29 -0000 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.jdt.internal.core; +import java.util.Map; + import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.jdt.core.*; @@ -100,14 +102,17 @@ if (this.checkAccessRestrictions && (isBinary || !type.getJavaProject().equals(this.project))) { PackageFragmentRoot root = (PackageFragmentRoot)type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); - ClasspathEntry entry = (ClasspathEntry) this.nameLookup.rootToResolvedEntries.get(root); - if (entry != null) { // reverse map always contains resolved CP entry - accessRestriction = entry.getImportRestriction(); - if (accessRestriction != null) { - // TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly - char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray()); - char[] typeChars = typeName.toCharArray(); - accessRestriction = accessRestriction.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/'), null); + Map map = this.nameLookup.rootToResolvedEntries; + if (map != null) { //bug 81122 + ClasspathEntry entry = (ClasspathEntry) map.get(root); + if (entry != null) { // reverse map always contains resolved CP entry + accessRestriction = entry.getImportRestriction(); + if (accessRestriction != null) { + // TODO (philippe) improve char[] <-> String conversions to avoid performing them on the fly + char[][] packageChars = CharOperation.splitOn('.', packageName.toCharArray()); + char[] typeChars = typeName.toCharArray(); + accessRestriction = accessRestriction.getViolatedRestriction(CharOperation.concatWith(packageChars, typeChars, '/'), null); + } } } }