Buggy code:
public static final String VARIABLE_INITIALIZER_PERF = ( JavaCore . PLUGIN_ID ) + "//perf//variableinitializer" ; public static final String CONTAINER_INITIALIZER_PERF = ( JavaCore . PLUGIN_ID ) + "//perf//containerinitializer" ; public static final String RECONCILE_PERF = ( JavaCore . PLUGIN_ID ) + "//perf//reconcile" ; private static final String INDEXED_SECONDARY_TYPES = "#@*_indexing<seq2seq4repair_space>secondary<seq2seq4repair_space>cache_*@#" ; public static boolean PERF_VARIABLE_INITIALIZER = false ; public static boolean PERF_CONTAINER_INITIALIZER = false ; public static final ICompilationUnit [ ] NO_WORKING_COPY = new ICompilationUnit [ 0 ] ; HashSet optionNames = new HashSet ( 20 ) ; Hashtable optionsCache ; public final IEclipsePreferences [ ] preferencesLookup = new IEclipsePreferences [ 2 ] ; static final int PREF_INSTANCE = 0 ; static final int PREF_DEFAULT = 1 ; static final Object [ ] [ ] NO_PARTICIPANTS = new Object [ 0 ] [ ] ; public static class CompilationParticipants { private static final int MAX_SOURCE_LEVEL = 7 ; private Object [ ] [ ] registeredParticipants = null ; private HashSet managedMarkerTypes ; public CompilationParticipant [ ] getCompilationParticipants ( IJavaProject project ) { } public HashSet managedMarkerTypes ( ) { } private synchronized Object [ ] [ ] getRegisteredParticipants ( ) { } private int indexForSourceLevel ( String sourceLevel ) { } private int sortParticipants ( ArrayList group , IConfigurationElement [ ] configElements , int index ) { } } public final JavaModelManager . CompilationParticipants compilationParticipants = new JavaModelManager . CompilationParticipants ( ) ; public ThreadLocal abortOnMissingSource = new ThreadLocal ( ) ; private ExternalFoldersManager externalFoldersManager = new ExternalFoldersManager ( ) ; public static boolean conflictsWithOutputLocation ( IPath folderPath , JavaProject project ) { } public synchronized IClasspathContainer containerGet ( IJavaProject project , IPath containerPath ) { } public synchronized IClasspathContainer containerGetDefaultToPreviousSession ( IJavaProject project , IPath containerPath ) { } private synchronized Map containerClone ( IJavaProject project ) { } private boolean containerIsInitializationInProgress ( IJavaProject project , IPath containerPath ) { } private void containerAddInitializationInProgress ( IJavaProject project , IPath containerPath ) { } public synchronized void containerPut ( IJavaProject project , IPath containerPath , IClasspathContainer container ) { } public synchronized void containerRemove ( IJavaProject project ) { } public boolean containerPutIfInitializingWithSameEntries ( IPath containerPath , IJavaProject [ ] projects , IClasspathContainer [ ] respectiveContainers ) { } private void verbose_missbehaving_container ( IPath containerPath , IJavaProject [ ] projects , IClasspathContainer [ ] respectiveContainers , final IClasspathContainer container , final IClasspathEntry [ ] newEntries , final IClasspathEntry [ ] oldEntries ) { } void verbose_missbehaving_container ( IJavaProject project , IPath containerPath , IClasspathEntry [ ] classpathEntries ) { } private void containerRemoveInitializationInProgress ( IJavaProject project , IPath containerPath ) { } private synchronized void containersReset ( String [ ] containerIDs ) { } public static IJavaElement create ( IResource resource , IJavaProject project ) { } public static IJavaElement create ( IFile file , IJavaProject project ) { } public static IJavaElement create ( IFolder folder , IJavaProject project ) { } public static IClassFile createClassFileFrom ( IFile file , IJavaProject project ) { } public static ICompilationUnit createCompilationUnitFrom ( IFile file , IJavaProject project ) { } public static IPackageFragmentRoot createJarPackageFragmentRootFrom ( IFile file , IJavaProject project ) { } public static IJavaElement determineIfOnClasspath ( IResource resource , IJavaProject project ) { IPath resourcePath = resource . getFullPath ( ) ; <START_BUG> boolean isExternal = ExternalFoldersManager . isExternal ( resourcePath ) ; <END_BUG> if ( isExternal ) resourcePath = resource . getLocation ( ) ; try { JavaProjectElementInfo projectInfo = ( ( JavaProjectElementInfo ) ( JavaModelManager . getJavaModelManager ( ) . getInfo ( project ) ) ) ; JavaProjectElementInfo . ProjectCache projectCache = ( projectInfo == null ) ? null : projectInfo . projectCache ; HashtableOfArrayToObject allPkgFragmentsCache = ( projectCache == null ) ? null : projectCache . allPkgFragmentsCache ; IClasspathEntry [ ] entries = ( Util . isJavaLikeFileName ( resourcePath . lastSegment ( ) ) ) ? project . getRawClasspath ( ) : ( ( JavaProject ) ( project ) ) . getResolvedClasspath ( ) ; int length = entries . length ; if ( length > 0 ) { String sourceLevel = project . getOption ( JavaCore . COMPILER_SOURCE , true ) ; String complianceLevel = project . getOption ( JavaCore . COMPILER_COMPLIANCE , true ) ; for ( int i = 0 ; i < length ; i ++ ) { IClasspathEntry entry = entries [ i ] ; if ( ( entry . getEntryKind ( ) ) == ( IClasspathEntry . CPE_PROJECT ) ) continue ; IPath rootPath = entry . getPath ( ) ; if ( rootPath . equals ( resourcePath ) ) { return project . getPackageFragmentRoot ( resource ) ; } else if ( rootPath . isPrefixOf ( resourcePath ) ) { if ( ! ( Util . isExcluded ( resource , ( ( ClasspathEntry ) ( entry ) ) . fullInclusionPatternChars ( ) , ( ( ClasspathEntry ) ( entry ) ) . fullExclusionPatternChars ( ) ) ) ) { PackageFragmentRoot root = ( isExternal ) ? new ExternalPackageFragmentRoot ( rootPath , ( ( JavaProject ) ( project ) ) ) : ( ( PackageFragmentRoot ) ( ( ( JavaProject ) ( project ) ) . getFolderPackageFragmentRoot ( rootPath ) ) ) ; if ( root == null ) return null ; IPath pkgPath = resourcePath . removeFirstSegments ( rootPath . segmentCount ( ) ) ; if ( ( resource . getType ( ) ) == ( IResource . FILE ) ) { pkgPath = pkgPath . removeLastSegments ( 1 ) ; } String [ ] pkgName = pkgPath . segments ( ) ; if ( ( allPkgFragmentsCache != null ) && ( allPkgFragmentsCache . containsKey ( pkgName ) ) ) return root . getPackageFragment ( pkgName ) ; if ( ( ( pkgName . length ) != 0 ) && ( ( JavaConventions . validatePackageName ( Util . packageName ( pkgPath , sourceLevel , complianceLevel ) , sourceLevel , complianceLevel ) . getSeverity ( ) ) == ( IStatus . ERROR ) ) ) { return null ;

Fix:
boolean isExternal = ExternalFoldersManager . isInternalPathForExternalFolder ( resourcePath ) ;