Buggy code:
public class MatchLocator implements ITypeRequestor { public static final int MAX_AT_ONCE = 500 ; public static final PotentialMatch [ ] NO_POTENTIAL_MATH = new PotentialMatch [ 0 ] ; public SearchPattern pattern ; public int detailLevel ; public IJavaSearchResultCollector collector ; public IJavaSearchScope scope ; public IProgressMonitor progressMonitor ; public IWorkingCopy [ ] workingCopies ; public HandleFactory handleFactory ; public char [ ] [ ] [ ] allSuperTypeNames ; public MatchLocatorParser parser ; public INameEnvironment nameEnvironment ; public NameLookup nameLookup ; public LookupEnvironment lookupEnvironment ; public HierarchyResolver hierarchyResolver ; boolean compilationAborted ; public PotentialMatchSet matchSet ; public int parseThreshold = - 1 ; public CompilerOptions options ; public CompilationUnitDeclaration [ ] unitsToProcess ; public PotentialMatch [ ] matchesToProcess ; public int totalUnits ; public PotentialMatch currentPotentialMatch ; public long resultCollectorTime = 0 ; public MatchLocator ( SearchPattern pattern , int detailLevel , IJavaSearchResultCollector collector , IJavaSearchScope scope , IProgressMonitor progressMonitor ) { } public void accept ( IBinaryType binaryType , PackageBinding packageBinding ) { } public void accept ( ICompilationUnit sourceUnit ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { } protected void addCompilationUnit ( ICompilationUnit sourceUnit , CompilationUnitDeclaration parsedUnit ) { } void addPotentialMatch ( IResource resource , Openable openable ) { } BinaryTypeBinding cacheBinaryType ( IType type ) throws JavaModelException { } public ClassFileReader classFileReader ( IType type ) { } private void computeSuperTypeNames ( ) { } protected void createAndResolveBindings ( PotentialMatch [ ] potentialMatches , int start , int length ) { } public IField createFieldHandle ( FieldDeclaration field , IType type ) { } protected boolean createHierarchyResolver ( PotentialMatch [ ] potentialMatches ) { } public IJavaElement createImportHandle ( ImportReference importRef ) { } public IInitializer createInitializerHandle ( TypeDeclaration typeDecl , FieldDeclaration initializer , IType type ) { } public IMethod createMethodHandle ( AbstractMethodDeclaration method , IType type ) { } public IType createTypeHandle ( char [ ] simpleTypeName ) { } public IType createTypeHandle ( IType parent , char [ ] simpleTypeName ) { } protected Openable getCurrentOpenable ( ) { } protected IResource getCurrentResource ( ) { } protected IType getFocusType ( ) { } public IBinaryType getBinaryInfo ( ClassFile classFile , IResource resource ) throws CoreException { BinaryType binaryType = ( ( BinaryType ) ( classFile . getType ( ) ) ) ; if ( classFile . isOpen ( ) ) { return ( ( IBinaryType ) ( binaryType . getElementInfo ( ) ) ) ; } else { IBinaryType info ; try { IJavaElement pkg = classFile . getParent ( ) ; PackageFragmentRoot root = ( ( PackageFragmentRoot ) ( pkg . getParent ( ) ) ) ; if ( root . isArchive ( ) ) { String pkgPath = pkg . getElementName ( ) . replace ( '.' , '//' ) ; String classFilePath = ( ( pkgPath . length ( ) ) > 0 ) ? ( pkgPath + "//" ) + ( classFile . getElementName ( ) ) : classFile . getElementName ( ) ; ZipFile zipFile = null ; try { zipFile = ( ( JarPackageFragmentRoot ) ( root ) ) . getJar ( ) ; info = ClassFileReader . read ( zipFile , classFilePath ) ; } finally { JavaModelManager . getJavaModelManager ( ) . closeZipFile ( zipFile ) ; } } else { <START_BUG> String osPath = resource . getFullPath ( ) . toOSString ( ) ; <END_BUG> info = ClassFileReader . read ( osPath ) ; } return info ; } catch ( ClassFormatException e ) { return null ; } catch ( IOException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . IO_EXCEPTION ) ; } } } protected void getMethodBodies ( CompilationUnitDeclaration unit , int place ) { } public void initialize ( JavaProject project ) throws JavaModelException { } public void initialize ( JavaProject project , PotentialMatch [ ] potentialMatches ) throws JavaModelException { } public boolean hasAlreadyDefinedType ( CompilationUnitDeclaration parsedUnit ) { } private void locateMatches ( JavaProject javaProject ) throws JavaModelException { } private void locateMatches ( JavaProject javaProject , PotentialMatch [ ] potentialMatches , int start , int length ) throws JavaModelException { } public void locateMatches ( String [ ] filePaths , IWorkspace workspace , IWorkingCopy [ ] copies ) throws JavaModelException { } public void locatePackageDeclarations ( IWorkspace workspace ) throws JavaModelException { } private void locatePackageDeclarations ( SearchPattern searchPattern , IWorkspace workspace ) throws JavaModelException { } public IType lookupType ( TypeBinding typeBinding ) { } public void process ( CompilationUnitDeclaration unit , int i ) throws CoreException { } public void report ( int sourceStart , int sourceEnd , IJavaElement element , int accuracy ) throws CoreException { } public void report ( IResource resource , int sourceStart , int sourceEnd , IJavaElement element , int accuracy ) throws CoreException { } public void reportAccurateReference ( int sourceStart , int sourceEnd , char [ ] [ ] qualifiedName , IJavaElement element , int accuracy ) throws CoreException { } public void reportAccurateReference ( int sourceStart , int sourceEnd , char [ ] [ ] tokens , IJavaElement element , int [ ] accuracies ) throws CoreException { } public void reportBinaryMatch ( IMember binaryMember , IBinaryType info , int accuracy ) throws CoreException , JavaModelException { } public void reportBinaryMatch ( IResource resource , IMember binaryMember , IBinaryType info , int accuracy ) throws CoreException , JavaModelException { } public void reportFieldDeclaration ( FieldDeclaration fieldDeclaration , IJavaElement parent , int accuracy ) throws CoreException { } public void reportImport ( ImportReference reference , int accuracy ) throws CoreException { } public void reportMethodDeclaration ( AbstractMethodDeclaration methodDeclaration , IJavaElement parent , int accuracy ) throws CoreException { } public void reportPackageDeclaration ( ImportReference node ) { } public void reportReference ( AstNode reference , AbstractMethodDeclaration methodDeclaration , IJavaElement parent , int accuracy ) throws CoreException { }

Fix:
String osPath = resource . getLocation ( ) . toOSString ( ) ;