Buggy code:
public static final String COMPACT = "compact" ; public static final String TAB = "tab" ; public static final String SPACE = "space" ; public static final String ENABLED = "enabled" ; public static final String DISABLED = "disabled" ; public static final String CLEAN = "clean" ; public static final String PUBLIC = "public" ; public static final String PROTECTED = "protected" ; public static final String DEFAULT = "default" ; public static final String PRIVATE = "private" ; public static final String NEVER = "never" ; public static final String JAVA_SOURCE_CONTENT_TYPE = ( JavaCore . PLUGIN_ID ) + ".javaSource" ; public JavaCore ( ) { } public static void addElementChangedListener ( IElementChangedListener listener ) { } public static void addElementChangedListener ( IElementChangedListener listener , int eventMask ) { } public static void addJavaElementMarkerAttributes ( Map attributes , IJavaElement element ) { } private static void addNonJavaResources ( Object [ ] nonJavaResources , IContainer container , int rootPathSegmentCounts , ArrayList collector ) { } public static void addPreProcessingResourceChangedListener ( IResourceChangeListener listener ) { } public static void addPreProcessingResourceChangedListener ( IResourceChangeListener listener , int eventMask ) { } public void configureJavaElementMarker ( IMarker marker , IJavaElement element ) throws CoreException { } public static IJavaElement create ( String handleIdentifier ) { } public static IJavaElement create ( String handleIdentifier , WorkingCopyOwner owner ) { } public static IJavaElement create ( IFile file ) { } public static IJavaElement create ( IFolder folder ) { } public static IJavaProject create ( IProject project ) { } public static IJavaElement create ( IResource resource ) { } public static IJavaElement create ( IResource resource , IJavaProject project ) { } public static IJavaModel create ( IWorkspaceRoot root ) { } public static IClassFile createClassFileFrom ( IFile file ) { } public static ICompilationUnit createCompilationUnitFrom ( IFile file ) { } public static IPackageFragmentRoot createJarPackageFragmentRootFrom ( IFile file ) { } public static IClasspathContainer getClasspathContainer ( IPath containerPath , IJavaProject project ) throws JavaModelException { } public static ClasspathContainerInitializer getClasspathContainerInitializer ( String containerID ) { } private static ClasspathContainerInitializer computeClasspathContainerInitializer ( String containerID ) { } private static void verbose_failed_to_instanciate_container_initializer ( String containerID , IConfigurationElement configurationElement ) { } private static void verbose_found_container_initializer ( String containerID , IConfigurationElement configurationElement ) { } public static IPath getClasspathVariable ( final String variableName ) { } private static void verbose_no_variable_initializer_found ( String variableName ) { } private static void verbose_variable_value_after_initialization ( String variableName , IPath variablePath ) { } private static void verbose_triggering_variable_initialization ( String variableName , ClasspathVariableInitializer initializer ) { } private static void verbose_triggering_variable_initialization_invocation_trace ( ) { } public static String getClasspathVariableDeprecationMessage ( String variableName ) { } public static ClasspathVariableInitializer getClasspathVariableInitializer ( String variable ) { } private static void verbose_failed_to_instanciate_variable_initializer ( String variable , IConfigurationElement configElement ) { } private static void verbose_found_variable_initializer ( String variable , IConfigurationElement configElement ) { } public static String [ ] getClasspathVariableNames ( ) { } public static Hashtable getDefaultOptions ( ) { } public static String getEncoding ( ) { } public static IResource [ ] getGeneratedResources ( IRegion region , boolean includesNonJavaResources ) { if ( region == null ) throw new IllegalArgumentException ( "region<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; IJavaElement [ ] elements = region . getElements ( ) ; HashMap projectsStates = new HashMap ( ) ; ArrayList collector = new ArrayList ( ) ; for ( int i = 0 , max = elements . length ; i < max ; i ++ ) { IJavaElement element = elements [ i ] ; IJavaProject javaProject = element . getJavaProject ( ) ; IProject project = javaProject . getProject ( ) ; State state = null ; State currentState = ( ( State ) ( projectsStates . get ( project ) ) ) ; if ( currentState != null ) { state = currentState ; } else { state = ( ( State ) ( JavaModelManager . getJavaModelManager ( ) . getLastBuiltState ( project , null ) ) ) ; if ( state != null ) { projectsStates . put ( project , state ) ; } } if ( state == null ) continue ; if ( ( element . getElementType ( ) ) == ( IJavaElement . JAVA_PROJECT ) ) { IPackageFragmentRoot [ ] roots = null ; try { <START_BUG> roots = javaProject . getAllPackageFragmentRoots ( ) ; <END_BUG> } catch ( JavaModelException e ) { } if ( roots == null ) continue ; IRegion region2 = JavaCore . newRegion ( ) ; for ( int j = 0 ; j < ( roots . length ) ; j ++ ) { region2 . add ( roots [ j ] ) ; } IResource [ ] res = JavaCore . getGeneratedResources ( region2 , includesNonJavaResources ) ; for ( int j = 0 , max2 = res . length ; j < max2 ; j ++ ) { collector . add ( res [ j ] ) ; } continue ; } IPath outputLocation = null ; try { outputLocation = javaProject . getOutputLocation ( ) ; } catch ( JavaModelException e ) { } IJavaElement root = element ; while ( ( root != null ) && ( ( root . getElementType ( ) ) != ( IJavaElement . PACKAGE_FRAGMENT_ROOT ) ) ) { root = root . getParent ( ) ; } if ( root == null ) continue ; IPackageFragmentRoot packageFragmentRoot = ( ( IPackageFragmentRoot ) ( root ) ) ; int rootPathSegmentCounts = packageFragmentRoot . getPath ( ) . segmentCount ( ) ; try { IClasspathEntry entry = packageFragmentRoot . getRawClasspathEntry ( ) ; IPath entryOutputLocation = entry . getOutputLocation ( ) ; if ( entryOutputLocation != null ) { outputLocation = entryOutputLocation ; } } catch ( JavaModelException e ) { e . printStackTrace ( ) ; } if ( outputLocation == null ) continue ;

Fix:
roots = javaProject . getPackageFragmentRoots ( ) ;