<s> package org . eclipse . jdt . internal . compiler . lookup ; import java . lang . reflect . Field ; import org . eclipse . jdt . core . compiler . CharOperation ; public class ProblemReferenceBinding extends ReferenceBinding { ReferenceBinding closestMatch ; private int problemReason ; public ProblemReferenceBinding ( char [ ] [ ] compoundName , ReferenceBinding closestMatch , int problemReason ) { this . compoundName = compoundName ; this . closestMatch = closestMatch ; this . problemReason = problemReason ; } public TypeBinding closestMatch ( ) { return this . closestMatch ; } public ReferenceBinding closestReferenceMatch ( ) { return this . closestMatch ; } public int problemId ( ) { return this . problemReason ; } public static String problemReasonString ( int problemReason ) { try { Class reasons = ProblemReasons . class ; String simpleName = reasons . getName ( ) ; int lastDot = simpleName . lastIndexOf ( '.' ) ; if ( lastDot >= 0 ) { simpleName = simpleName . substring ( lastDot + 1 ) ; } Field [ ] fields = reasons . getFields ( ) ; for ( int i = 0 , length = fields . length ; i < length ; i ++ ) { Field field = fields [ i ] ; if ( ! field . getType ( ) . equals ( int . class ) ) continue ; if ( field . getInt ( reasons ) == problemReason ) { return simpleName + '.' + field . getName ( ) ; } } } catch ( IllegalAccessException e ) { } return "unknown" ; } public char [ ] shortReadableName ( ) { return readableName ( ) ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( 10 ) ; buffer . append ( "" ) ; buffer . append ( this . compoundName == null ? "<null>" : new String ( CharOperation . concatWith ( this . compoundName , '.' ) ) ) ; buffer . append ( "][problemID=" ) . append ( problemReasonString ( this . problemReason ) ) ; buffer . append ( "" ) ; buffer . append ( this . closestMatch == null ? "<null>" : this . closestMatch . toString ( ) ) ; buffer . append ( "]" ) ; return buffer . toString ( ) ; } } </s>