Buggy code:
public class NameEnvironment implements INameEnvironment { ClasspathLocation [ ] classpathLocations ; String [ ] initialTypeNames ; String [ ] additionalSourceFilenames ; public NameEnvironment ( ClasspathLocation [ ] classpathLocations ) { } public NameEnvironment ( IJavaProject javaProject ) { } public static ClasspathLocation [ ] computeLocations ( IWorkspaceRoot workspaceRoot , IJavaProject javaProject , String outputFolderLocation , ArrayList sourceFolders , SimpleLookupTable prereqOutputFolders ) throws JavaModelException { <START_BUG> IClasspathEntry [ ] classpathEntries = ( ( JavaProject ) ( javaProject ) ) . getExpandedClasspath ( true ) ; <END_BUG> int cpCount = 0 ; int max = classpathEntries . length ; ClasspathLocation [ ] classpathLocations = new ClasspathLocation [ max ] ; boolean firstSourceFolder = true ; nextEntry : for ( int i = 0 ; i < max ; i ++ ) { IClasspathEntry entry = classpathEntries [ i ] ; Object target = JavaModel . getTarget ( workspaceRoot , entry . getPath ( ) , true ) ; if ( target == null ) continue nextEntry ; if ( target instanceof IResource ) { IResource resource = ( ( IResource ) ( target ) ) ; switch ( entry . getEntryKind ( ) ) { case IClasspathEntry . CPE_SOURCE : if ( ( outputFolderLocation == null ) || ( ! ( resource instanceof IContainer ) ) ) continue nextEntry ; if ( sourceFolders != null ) { sourceFolders . add ( resource ) ; classpathLocations [ ( cpCount ++ ) ] = ClasspathLocation . forSourceFolder ( resource . getLocation ( ) . toString ( ) , outputFolderLocation ) ; } else if ( firstSourceFolder ) { firstSourceFolder = false ; classpathLocations [ ( cpCount ++ ) ] = ClasspathLocation . forBinaryFolder ( outputFolderLocation ) ; } continue nextEntry ; case IClasspathEntry . CPE_PROJECT : if ( ! ( resource instanceof IProject ) ) continue nextEntry ; IProject prereqProject = ( ( IProject ) ( resource ) ) ; IPath outputLocation = JavaCore . create ( prereqProject ) . getOutputLocation ( ) ; IResource prereqOutputFolder ; if ( prereqProject . getFullPath ( ) . equals ( outputLocation ) ) { prereqOutputFolder = prereqProject ; } else { prereqOutputFolder = workspaceRoot . findMember ( outputLocation ) ; if ( ( ( prereqOutputFolder == null ) || ( ! ( prereqOutputFolder . exists ( ) ) ) ) || ( ! ( prereqOutputFolder instanceof IFolder ) ) ) continue nextEntry ; } if ( prereqOutputFolders != null ) prereqOutputFolders . put ( prereqProject , prereqOutputFolder ) ; classpathLocations [ ( cpCount ++ ) ] = ClasspathLocation . forBinaryFolder ( prereqOutputFolder . getLocation ( ) . toString ( ) ) ; continue nextEntry ; case IClasspathEntry . CPE_LIBRARY : if ( resource instanceof IFile ) { String extension = entry . getPath ( ) . getFileExtension ( ) ; if ( ! ( ( JAR_EXTENSION . equalsIgnoreCase ( extension ) ) || ( ZIP_EXTENSION . equalsIgnoreCase ( extension ) ) ) ) continue nextEntry ; classpathLocations [ ( cpCount ++ ) ] = ClasspathLocation . forLibrary ( resource . getLocation ( ) . toString ( ) ) ; } else if ( resource instanceof IFolder ) { classpathLocations [ ( cpCount ++ ) ] = ClasspathLocation . forBinaryFolder ( resource . getLocation ( ) . toString ( ) ) ; } continue nextEntry ; } } else if ( target instanceof File ) { String extension = entry . getPath ( ) . getFileExtension ( ) ; if ( ! ( ( JAR_EXTENSION . equalsIgnoreCase ( extension ) ) || ( ZIP_EXTENSION . equalsIgnoreCase ( extension ) ) ) ) continue nextEntry ; classpathLocations [ ( cpCount ++ ) ] = ClasspathLocation . forLibrary ( entry . getPath ( ) . toString ( ) ) ; } } if ( cpCount < max ) System . arraycopy ( classpathLocations , 0 , ( classpathLocations = new ClasspathLocation [ cpCount ] ) , 0 , cpCount ) ; return classpathLocations ; } public static String assembleName ( char [ ] fileName , char [ ] [ ] packageName , char separator ) { } public static String assembleName ( String fileName , char [ ] [ ] packageName , char separator ) { } private NameEnvironmentAnswer findClass ( char [ ] name , char [ ] [ ] packageName ) { } public NameEnvironmentAnswer findType ( char [ ] [ ] compoundName ) { } public NameEnvironmentAnswer findType ( char [ ] name , char [ ] [ ] compoundName ) { } public boolean isPackage ( char [ ] [ ] compoundName , char [ ] packageName ) { } public void reset ( ) { } public void setNames ( String [ ] initialTypeNames , String [ ] additionalSourceFilenames ) { } }

Fix:
IClasspathEntry [ ] classpathEntries = ( ( JavaProject ) ( javaProject ) ) . getExpandedClasspath ( true , true ) ;