Buggy code:
public class ClassFile extends Openable implements IClassFile , SuffixConstants { protected String name ; protected BinaryType binaryType = null ; private boolean checkAutomaticSourceMapping ; protected ClassFile ( PackageFragment parent , String name ) { } public ICompilationUnit becomeWorkingCopy ( IProblemRequestor problemRequestor , WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { } protected boolean buildStructure ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException { } public void codeComplete ( int offset , ICompletionRequestor requestor ) throws JavaModelException { } public void codeComplete ( int offset , ICompletionRequestor requestor , WorkingCopyOwner owner ) throws JavaModelException { } public void codeComplete ( int offset , CompletionRequestor requestor ) throws JavaModelException { } public void codeComplete ( int offset , CompletionRequestor requestor , WorkingCopyOwner owner ) throws JavaModelException { } public IJavaElement [ ] codeSelect ( int offset , int length ) throws JavaModelException { } public IJavaElement [ ] codeSelect ( int offset , int length , WorkingCopyOwner owner ) throws JavaModelException { } protected Object createElementInfo ( ) { } public boolean equals ( Object o ) { } public boolean exists ( ) { } protected IJavaElement findElement ( IJavaElement elt , int position , SourceMapper mapper ) { } public IBinaryType getBinaryTypeInfo ( IFile file ) throws JavaModelException { } public IBuffer getBuffer ( ) throws JavaModelException { } public IClassFile getClassFile ( ) { } public IResource getCorrespondingResource ( ) throws JavaModelException { } public IJavaElement getElementAt ( int position ) throws JavaModelException { } public IJavaElement getElementAtConsideringSibling ( int position ) throws JavaModelException { IPackageFragment fragment = ( ( IPackageFragment ) ( getParent ( ) ) ) ; PackageFragmentRoot root = ( ( PackageFragmentRoot ) ( fragment . getAncestor ( IJavaElement . PACKAGE_FRAGMENT_ROOT ) ) ) ; SourceMapper mapper = root . getSourceMapper ( ) ; if ( mapper == null ) { return null ; } else { String prefix = null ; int index = this . name . indexOf ( '$' ) ; if ( index > ( - 1 ) ) { prefix = this . name . substring ( 0 , index ) ; } else { prefix = this . name ; } IType type = null ; int start = - 1 ; int end = Integer . MAX_VALUE ; IJavaElement [ ] children = fragment . getChildren ( ) ; for ( int i = 0 ; i < ( children . length ) ; i ++ ) { String childName = children [ i ] . getElementName ( ) ; String childPrefix = null ; int childIndex = childName . indexOf ( '$' ) ; if ( childIndex > ( - 1 ) ) { childPrefix = childName . substring ( 0 , childIndex ) ; } else { childPrefix = childName . substring ( 0 , childName . indexOf ( '.' ) ) ; } if ( prefix . equals ( childPrefix ) ) { IClassFile classFile = ( ( IClassFile ) ( children [ i ] ) ) ; classFile . getBuffer ( ) ; SourceRange range = mapper . getSourceRange ( classFile . getType ( ) ) ; <START_BUG> if ( range == ( fgUnknownRange ) ) <END_BUG> continue ; int newStart = range . offset ; int newEnd = ( newStart + ( range . length ) ) - 1 ; if ( ( ( ( newStart > start ) && ( newEnd < end ) ) && ( newStart <= position ) ) && ( newEnd >= position ) ) { type = classFile . getType ( ) ; start = newStart ; end = newEnd ; } } } if ( type != null ) { return findElement ( type , position , mapper ) ; } return null ; } } public String getElementName ( ) { } public int getElementType ( ) { } public IJavaElement getHandleFromMemento ( String token , MementoTokenizer memento , WorkingCopyOwner owner ) { } protected char getHandleMementoDelimiter ( ) { } public IPath getPath ( ) { } public IResource getResource ( ) { } public String getSource ( ) throws JavaModelException { } public ISourceRange getSourceRange ( ) throws JavaModelException { } public String getTopLevelTypeName ( ) { } public IType getType ( ) { } public String getTypeName ( ) { } public ICompilationUnit getWorkingCopy ( WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { } public IJavaElement getWorkingCopy ( IProgressMonitor monitor , IBufferFactory factory ) throws JavaModelException { } protected boolean hasBuffer ( ) { } public boolean isClass ( ) throws JavaModelException { } public boolean isInterface ( ) throws JavaModelException { } public boolean isReadOnly ( ) { } private IStatus validateClassFile ( ) { } protected IBuffer openBuffer ( IProgressMonitor pm , Object info ) throws JavaModelException { } private IBuffer mapSource ( SourceMapper mapper ) { } static String simpleName ( char [ ] className ) { } public static char [ ] translatedName ( char [ ] name ) { } static char [ ] [ ] translatedNames ( char [ ] [ ] names ) { } static char [ ] unqualifiedName ( char [ ] className ) { } public void codeComplete ( int offset , final ICodeCompletionRequestor requestor ) throws JavaModelException { } }

Fix:
if ( range == ( SourceMapper . UNKNOWN_RANGE ) )