Buggy code:
if ( severity != ( ( ( Integer ) ( cycleMarker . getAttribute ( IMarker . SEVERITY ) ) ) . intValue ( ) ) ) cycleMarker . setAttribute ( IMarker . SEVERITY , severity ) ; } ArrayList sLocations = new ArrayList ( classpathEntries . length ) ; ArrayList bLocations = new ArrayList ( classpathEntries . length ) ; nextEntry : for ( int i = 0 , l = classpathEntries . length ; i < l ; i ++ ) { ClasspathEntry entry = ( ( ClasspathEntry ) ( classpathEntries [ i ] ) ) ; IPath path = entry . getPath ( ) ; Object target = JavaModel . getTarget ( root , path , true ) ; if ( target == null ) continue nextEntry ; switch ( entry . getEntryKind ( ) ) { case IClasspathEntry . CPE_SOURCE : if ( ! ( target instanceof IContainer ) ) continue nextEntry ; IPath outputPath = ( ( entry . getOutputLocation ( ) ) != null ) ? entry . getOutputLocation ( ) : javaProject . getOutputLocation ( ) ; IContainer outputFolder = ( ( outputPath . segmentCount ( ) ) == 1 ) ? ( ( IContainer ) ( javaProject . getProject ( ) ) ) : ( ( IContainer ) ( root . getFolder ( outputPath ) ) ) ; if ( ! ( outputFolder . exists ( ) ) ) createFolder ( outputFolder , javaProject . getProject ( ) ) ; sLocations . add ( ClasspathLocation . forSourceFolder ( ( ( IContainer ) ( target ) ) , outputFolder , entry . fullExclusionPatternChars ( ) ) ) ; continue nextEntry ; case IClasspathEntry . CPE_PROJECT : if ( ! ( target instanceof IProject ) ) continue nextEntry ; IProject prereqProject = ( ( IProject ) ( target ) ) ; if ( ! ( prereqProject . isAccessible ( ) ) ) continue nextEntry ; JavaProject prereqJavaProject = ( ( JavaProject ) ( JavaCore . create ( prereqProject ) ) ) ; IClasspathEntry [ ] prereqClasspathEntries = prereqJavaProject . getExpandedClasspath ( true , true ) ; ArrayList seen = new ArrayList ( ) ; for ( int j = 0 , m = prereqClasspathEntries . length ; j < m ; j ++ ) { ClasspathEntry e = ( ( ClasspathEntry ) ( prereqClasspathEntries [ j ] ) ) ; Object t = JavaModel . getTarget ( root , e . getPath ( ) , true ) ; if ( ( t instanceof IContainer ) && ( ( e . getEntryKind ( ) ) == ( IClasspathEntry . CPE_SOURCE ) ) ) { IPath prereqOutputPath = ( ( e . getOutputLocation ( ) ) != null ) ? e . getOutputLocation ( ) : prereqJavaProject . getOutputLocation ( ) ; IContainer binaryFolder = ( ( prereqOutputPath . segmentCount ( ) ) == 1 ) ? ( ( IContainer ) ( prereqProject ) ) : ( ( IContainer ) ( root . getFolder ( prereqOutputPath ) ) ) ; if ( ( binaryFolder . exists ( ) ) && ( ! ( seen . contains ( binaryFolder ) ) ) ) { seen . add ( binaryFolder ) ; ClasspathLocation bLocation = ClasspathLocation . forBinaryFolder ( binaryFolder , true ) ; bLocations . add ( bLocation ) ; if ( binaryLocationsPerProject != null ) { ClasspathLocation [ ] existingLocations = ( ( ClasspathLocation [ ] ) ( binaryLocationsPerProject . get ( prereqProject ) ) ) ; if ( existingLocations == null ) { existingLocations = new ClasspathLocation [ ] { bLocation } ; } else { int size = existingLocations . length ; System . arraycopy ( existingLocations , 0 , ( existingLocations = new ClasspathLocation [ size + 1 ] ) , 0 , size ) ; existingLocations [ size ] = bLocation ; } binaryLocationsPerProject . put ( prereqProject , existingLocations ) ; } } } } continue nextEntry ; case IClasspathEntry . CPE_LIBRARY : if ( target instanceof IResource ) { IResource resource = ( ( IResource ) ( target ) ) ; ClasspathLocation bLocation = null ; if ( resource instanceof IFile ) { String extension = path . getFileExtension ( ) ; if ( ! ( ( JAR_EXTENSION . equalsIgnoreCase ( extension ) ) || ( ZIP_EXTENSION . equalsIgnoreCase ( extension ) ) ) ) continue nextEntry ; bLocation = ClasspathLocation . forLibrary ( ( ( IFile ) ( resource ) ) ) ; } else <START_BUG> if ( resource instanceof IFolder ) { <END_BUG> bLocation = ClasspathLocation . forBinaryFolder ( ( ( IContainer ) ( target ) ) , false ) ; } bLocations . add ( bLocation ) ; if ( binaryLocationsPerProject != null ) { IProject p = resource . getProject ( ) ; ClasspathLocation [ ] existingLocations = ( ( ClasspathLocation [ ] ) ( binaryLocationsPerProject . get ( p ) ) ) ; if ( existingLocations == null ) { existingLocations = new ClasspathLocation [ ] { bLocation } ; } else { int size = existingLocations . length ; System . arraycopy ( existingLocations , 0 , ( existingLocations = new ClasspathLocation [ size + 1 ] ) , 0 , size ) ; existingLocations [ size ] = bLocation ; } binaryLocationsPerProject . put ( p , existingLocations ) ; } } else if ( target instanceof File ) { String extension = path . getFileExtension ( ) ; if ( ! ( ( JAR_EXTENSION . equalsIgnoreCase ( extension ) ) || ( ZIP_EXTENSION . equalsIgnoreCase ( extension ) ) ) ) continue nextEntry ; bLocations . add ( ClasspathLocation . forLibrary ( path . toString ( ) ) ) ; } continue nextEntry ; } } ArrayList outputFolders = new ArrayList ( 1 ) ; this . sourceLocations = new ClasspathMultiDirectory [ sLocations . size ( ) ] ; if ( ! ( sLocations . isEmpty ( ) ) ) { sLocations . toArray ( this . sourceLocations ) ;

Fix:
if ( resource instanceof IContainer ) {