Buggy code:
public class HandleFactory { private String lastPkgFragmentRootPath ; private IPackageFragmentRoot lastPkgFragmentRoot ; private HashtableOfArrayToObject packageHandles ; private JavaModel javaModel ; public HandleFactory ( ) { } public Openable createOpenable ( String resourcePath , IJavaSearchScope scope ) { int separatorIndex ; if ( ( separatorIndex = resourcePath . indexOf ( IJavaSearchScope . JAR_FILE_ENTRY_SEPARATOR ) ) > ( - 1 ) ) { String jarPath = resourcePath . substring ( 0 , separatorIndex ) ; if ( ! ( jarPath . equals ( this . lastPkgFragmentRootPath ) ) ) { IPackageFragmentRoot root = this . getJarPkgFragmentRoot ( jarPath , scope ) ; if ( root == null ) return null ; this . lastPkgFragmentRootPath = jarPath ; this . lastPkgFragmentRoot = root ; this . packageHandles = new HashtableOfArrayToObject ( 5 ) ; } String classFilePath = resourcePath . substring ( ( separatorIndex + 1 ) ) ; String [ ] simpleNames = new Path ( classFilePath ) . segments ( ) ; String [ ] pkgName ; int length = ( simpleNames . length ) - 1 ; if ( length > 0 ) { pkgName = new String [ length ] ; System . arraycopy ( simpleNames , 0 , pkgName , 0 , length ) ; } else { pkgName = CharOperation . NO_STRINGS ; } IPackageFragment pkgFragment = ( ( IPackageFragment ) ( this . packageHandles . get ( pkgName ) ) ) ; if ( pkgFragment == null ) { pkgFragment = ( ( PackageFragmentRoot ) ( this . lastPkgFragmentRoot ) ) . getPackageFragment ( pkgName ) ; this . packageHandles . put ( pkgName , pkgFragment ) ; } IClassFile classFile = pkgFragment . getClassFile ( simpleNames [ length ] ) ; return ( ( Openable ) ( classFile ) ) ; } else { int rootPathLength = - 1 ; if ( ( ( this . lastPkgFragmentRootPath ) == null ) || ( ! ( ( ( resourcePath . startsWith ( this . lastPkgFragmentRootPath ) ) && ( ( rootPathLength = this . lastPkgFragmentRootPath . length ( ) ) > 0 ) ) && ( ( resourcePath . charAt ( rootPathLength ) ) == '//' ) ) ) ) { IPackageFragmentRoot root = this . getPkgFragmentRoot ( resourcePath ) ; if ( root == null ) return null ; this . lastPkgFragmentRoot = root ; this . lastPkgFragmentRootPath = this . lastPkgFragmentRoot . getPath ( ) . toString ( ) ; this . packageHandles = new HashtableOfArrayToObject ( 5 ) ; } resourcePath = resourcePath . substring ( ( ( this . lastPkgFragmentRootPath . length ( ) ) + 1 ) ) ; String [ ] simpleNames = new Path ( resourcePath ) . segments ( ) ; String [ ] pkgName ; int length = ( simpleNames . length ) - 1 ; if ( length > 0 ) { pkgName = new String [ length ] ; System . arraycopy ( simpleNames , 0 , pkgName , 0 , length ) ; } else { pkgName = CharOperation . NO_STRINGS ; } IPackageFragment pkgFragment = ( ( IPackageFragment ) ( this . packageHandles . get ( pkgName ) ) ) ; if ( pkgFragment == null ) { pkgFragment = ( ( PackageFragmentRoot ) ( this . lastPkgFragmentRoot ) ) . getPackageFragment ( pkgName ) ; this . packageHandles . put ( pkgName , pkgFragment ) ; } String simpleName = simpleNames [ length ] ; <START_BUG> if ( Util . isJavaFileName ( simpleName ) ) { <END_BUG> ICompilationUnit unit = pkgFragment . getCompilationUnit ( simpleName ) ; return ( ( Openable ) ( unit ) ) ; } else { IClassFile classFile = pkgFragment . getClassFile ( simpleName ) ; return ( ( Openable ) ( classFile ) ) ; } } } public IJavaElement createElement ( final ASTNode toBeFound , CompilationUnitDeclaration parsedUnit , Openable openable ) { } private IJavaElement createElement ( ASTNode [ ] nodeStack , int start , int end , IJavaElement parent ) { } public IJavaElement createElement ( ClassScope scope , ICompilationUnit unit , HashSet existingElements , HashMap knownScopes ) { } private IJavaElement createElement ( Scope scope , int elementPosition , ICompilationUnit unit , HashSet existingElements , HashMap knownScopes ) { } private IPackageFragmentRoot getJarPkgFragmentRoot ( String jarPathString , IJavaSearchScope scope ) { } private IPackageFragmentRoot getJarPkgFragmentRoot ( IPath jarPath , Object target , IJavaProject [ ] projects ) { } private Openable getOpenable ( ASTNode toBeFound , Openable openable ) { } private IPackageFragmentRoot getPkgFragmentRoot ( String pathString ) { } }

Fix:
if ( Util . isJavaLikeFileName ( simpleName ) ) {