<s> package org . eclipse . jdt . internal . codeassist . select ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . lookup . * ; public class SelectionJavadoc extends Javadoc { Expression selectedNode ; public SelectionJavadoc ( int sourceStart , int sourceEnd ) { super ( sourceStart , sourceEnd ) ; } public StringBuffer print ( int indent , StringBuffer output ) { super . print ( indent , output ) ; if ( this . selectedNode != null ) { String selectedString = null ; if ( this . selectedNode instanceof JavadocFieldReference ) { JavadocFieldReference fieldRef = ( JavadocFieldReference ) this . selectedNode ; if ( fieldRef . methodBinding != null ) { selectedString = "" ; } else { selectedString = "" ; } } else if ( this . selectedNode instanceof JavadocMessageSend ) { selectedString = "" ; } else if ( this . selectedNode instanceof JavadocAllocationExpression ) { selectedString = "" ; } else if ( this . selectedNode instanceof JavadocSingleNameReference ) { selectedString = "" ; } else if ( this . selectedNode instanceof JavadocSingleTypeReference ) { JavadocSingleTypeReference typeRef = ( JavadocSingleTypeReference ) this . selectedNode ; if ( typeRef . packageBinding == null ) { selectedString = "" ; } } else if ( this . selectedNode instanceof JavadocQualifiedTypeReference ) { JavadocQualifiedTypeReference typeRef = ( JavadocQualifiedTypeReference ) this . selectedNode ; if ( typeRef . packageBinding == null ) { selectedString = "" ; } } else { selectedString = "" ; } int pos = output . length ( ) - 3 ; output . replace ( pos - 2 , pos , selectedString + this . selectedNode + '>' ) ; } return output ; } private void internalResolve ( Scope scope ) { if ( this . selectedNode != null ) { switch ( scope . kind ) { case Scope . CLASS_SCOPE : this . selectedNode . resolveType ( ( ClassScope ) scope ) ; break ; case Scope . METHOD_SCOPE : this . selectedNode . resolveType ( ( MethodScope ) scope ) ; break ; } Binding binding = null ; if ( this . selectedNode instanceof JavadocFieldReference ) { JavadocFieldReference fieldRef = ( JavadocFieldReference ) this . selectedNode ; binding = fieldRef . binding ; if ( binding == null && fieldRef . methodBinding != null ) { binding = fieldRef . methodBinding ; } } else if ( this . selectedNode instanceof JavadocMessageSend ) { binding = ( ( JavadocMessageSend ) this . selectedNode ) . binding ; } else if ( this . selectedNode instanceof JavadocAllocationExpression ) { binding = ( ( JavadocAllocationExpression ) this . selectedNode ) . binding ; } else if ( this . selectedNode instanceof JavadocSingleNameReference ) { binding = ( ( JavadocSingleNameReference ) this . selectedNode ) . binding ; } else if ( this . selectedNode instanceof JavadocSingleTypeReference ) { JavadocSingleTypeReference typeRef = ( JavadocSingleTypeReference ) this . selectedNode ; if ( typeRef . packageBinding == null ) { binding = typeRef . resolvedType ; } } else if ( this . selectedNode instanceof JavadocQualifiedTypeReference ) { JavadocQualifiedTypeReference typeRef = ( JavadocQualifiedTypeReference ) this . selectedNode ; if ( typeRef . packageBinding == null ) { binding = typeRef . resolvedType ; } } else { binding = this . selectedNode . resolvedType ; } throw new SelectionNodeFound ( binding ) ; } } public void resolve ( ClassScope scope ) { internalResolve ( scope ) ; } public void resolve ( MethodScope scope ) { internalResolve ( scope ) ; } } </s>