Buggy code:
public class JavaBuilder extends IncrementalProjectBuilder { IProject currentProject ; JavaProject javaProject ; IWorkspaceRoot workspaceRoot ; NameEnvironment nameEnvironment ; SimpleLookupTable binaryLocationsPerProject ; State lastState ; BuildNotifier notifier ; char [ ] [ ] extraResourceFileFilters ; String [ ] extraResourceFolderFilters ; public static boolean DEBUG = false ; static ArrayList builtProjects = null ; public static IMarker [ ] getProblemsFor ( IResource resource ) { } public static IMarker [ ] getTasksFor ( IResource resource ) { } public static void buildStarting ( ) { } public static void buildFinished ( ) { } public static void removeProblemsFor ( IResource resource ) { } public static void removeTasksFor ( IResource resource ) { } public static void removeProblemsAndTasksFor ( IResource resource ) { } public static State readState ( IProject project , DataInputStream in ) throws IOException { } public static void writeState ( Object state , DataOutputStream out ) throws IOException { } protected IProject [ ] build ( int kind , Map ignored , IProgressMonitor monitor ) throws CoreException { } private void buildAll ( ) { } private void buildDeltas ( SimpleLookupTable deltas ) { } protected void clean ( IProgressMonitor monitor ) throws CoreException { } private void cleanup ( ) { } private void clearLastState ( ) { } boolean filterExtraResource ( IResource resource ) { } private SimpleLookupTable findDeltas ( ) { } public State getLastState ( IProject project ) { } private IProject [ ] getRequiredProjects ( boolean includeBinaryPrerequisites ) { } private boolean hasClasspathChanged ( ) { } private boolean hasStructuralDelta ( ) { } private void initializeBuilder ( ) throws CoreException { this . javaProject = ( ( JavaProject ) ( JavaCore . create ( currentProject ) ) ) ; this . workspaceRoot = currentProject . getWorkspace ( ) . getRoot ( ) ; String projectName = currentProject . getName ( ) ; if ( ( ( JavaBuilder . builtProjects ) == null ) || ( JavaBuilder . builtProjects . contains ( projectName ) ) ) { org . eclipse . jdt . internal . core . JavaModel . flushExternalFileCache ( ) ; JavaBuilder . builtProjects = new ArrayList ( ) ; } JavaBuilder . builtProjects . add ( projectName ) ; this . binaryLocationsPerProject = new SimpleLookupTable ( 3 ) ; this . nameEnvironment = new NameEnvironment ( workspaceRoot , javaProject , binaryLocationsPerProject ) ; String filterSequence = javaProject . getOption ( JavaCore . CORE_JAVA_BUILD_RESOURCE_COPY_FILTER , true ) ; char [ ] [ ] filters = ( ( filterSequence != null ) && ( ( filterSequence . length ( ) ) > 0 ) ) ? CharOperation . splitAndTrimOn ( ',' , filterSequence . toCharArray ( ) ) : null ; if ( filters == null ) { this . extraResourceFileFilters = null ; this . extraResourceFolderFilters = null ; } else { int fileCount = 0 ; int folderCount = 0 ; for ( int i = 0 , l = filters . length ; i < l ; i ++ ) { char [ ] f = filters [ i ] ; if ( ( f . length ) == 0 ) continue ; if ( ( f [ ( ( f . length ) - 1 ) ] ) == '//' ) folderCount ++ ; else fileCount ++ ; } this . extraResourceFileFilters = new char [ fileCount ] [ ] ; this . extraResourceFolderFilters = new String [ folderCount ] ; for ( int i = 0 , l = filters . length ; i < l ; i ++ ) { char [ ] f = filters [ i ] ; if ( ( f . length ) == 0 ) continue ; if ( ( f [ ( ( f . length ) - 1 ) ] ) == '//' ) <START_BUG> extraResourceFolderFilters [ ( -- folderCount ) ] = new String ( CharOperation . subarray ( f , 0 , ( ( f . length ) - 1 ) ) ) ; <END_BUG> else extraResourceFileFilters [ ( -- fileCount ) ] = f ; } } } private boolean isClasspathBroken ( IClasspathEntry [ ] classpath , IProject p ) throws CoreException { } private boolean isWorthBuilding ( ) throws CoreException { } void mustPropagateStructuralChanges ( ) { } private void recordNewState ( State state ) { } public String toString ( ) { } }

Fix:
extraResourceFolderFilters [ ( -- folderCount ) ] = new String ( f , 0 , ( ( f . length ) - 1 ) ) ;