private Fix buildFix ( Tree tree , List < ? extends Tree > arguments , VisitorState state ) { JCTree node = ( JCTree ) tree ; int startAbsolute = node . getStartPosition ( ) ; int lower = ( ( JCTree ) arguments . get ( 0 ) ) . getStartPosition ( ) - startAbsolute ; int upper = state . getEndPosition ( arguments . get ( arguments . size ( ) - 1 ) ) - startAbsolute ; CharSequence source = state . getSourceForNode ( node ) ; while ( lower >= 0 && source . charAt ( lower ) != ' ' ) { lower -- ; } while ( upper < source . length ( ) && source . charAt ( upper ) != ' ' ) { upper ++ ; } // There's a small chance that the fix will be incorrect because there's a '<' or '>' in // a comment (e.g. `this.</*<*/T/*>*/>f()`), it should never be the case that we don't find // any angle brackets. verify ( source . charAt ( lower ) == ' ' && source . charAt ( upper ) == ' ' ) ; Fix fix = SuggestedFix . replace ( startAbsolute + lower , startAbsolute + upper + 1 , "" ) ; return fix ; }
Constructor a fix that deletes the set of type arguments .