public static Fix deleteExceptions ( MethodTree tree , final VisitorState state , List < ExpressionTree > toDelete ) { List < ? extends ExpressionTree > trees = tree . getThrows ( ) ; if ( toDelete . size ( ) == trees . size ( ) ) { return SuggestedFix . replace ( getThrowsPosition ( tree , state ) - 1 , state . getEndPosition ( getLast ( trees ) ) , "" ) ; } String replacement = FluentIterable . from ( tree . getThrows ( ) ) . filter ( Predicates . not ( Predicates . in ( toDelete ) ) ) . transform ( new Function < ExpressionTree , String > ( ) { @ Override @ Nullable public String apply ( ExpressionTree input ) { return state . getSourceForNode ( input ) ; } } ) . join ( Joiner . on ( ", " ) ) ; return SuggestedFix . replace ( ( ( JCTree ) tree . getThrows ( ) . get ( 0 ) ) . getStartPosition ( ) , state . getEndPosition ( getLast ( tree . getThrows ( ) ) ) , replacement ) ; }
Deletes the given exceptions from a method s throws clause .