@Test public void givenWhitespaceAroundFullyQualifiedExceptionAndNoDescription_expectEmptyDescription() { ThrowsJavadoc doc = ThrowsTagParser.parseTag( "com.github.Mission", " com.github.voyage.OutOfFuelException " ); assertEquals( "com.github.voyage.OutOfFuelException", doc.getName() ); assertEquals( Collections.emptyList(), doc.getComment().getElements() ); }
public static ThrowsJavadoc parseTag( String owningClass, String value ) { if ( value == null || value.trim().length() == 0 ) { return null; } String[] exceptionClassAndComment = whitespace.split(value.trim(), 2); String exceptionClass = toFullClassName(owningClass, exceptionClassAndComment[0]); String comment = exceptionClassAndComment.length == 1 ? "" :exceptionClassAndComment[1]; return new ThrowsJavadoc( exceptionClass, CommentParser.parse(owningClass,comment) ); }
ThrowsTagParser { public static ThrowsJavadoc parseTag( String owningClass, String value ) { if ( value == null || value.trim().length() == 0 ) { return null; } String[] exceptionClassAndComment = whitespace.split(value.trim(), 2); String exceptionClass = toFullClassName(owningClass, exceptionClassAndComment[0]); String comment = exceptionClassAndComment.length == 1 ? "" :exceptionClassAndComment[1]; return new ThrowsJavadoc( exceptionClass, CommentParser.parse(owningClass,comment) ); } }
ThrowsTagParser { public static ThrowsJavadoc parseTag( String owningClass, String value ) { if ( value == null || value.trim().length() == 0 ) { return null; } String[] exceptionClassAndComment = whitespace.split(value.trim(), 2); String exceptionClass = toFullClassName(owningClass, exceptionClassAndComment[0]); String comment = exceptionClassAndComment.length == 1 ? "" :exceptionClassAndComment[1]; return new ThrowsJavadoc( exceptionClass, CommentParser.parse(owningClass,comment) ); }  }
ThrowsTagParser { public static ThrowsJavadoc parseTag( String owningClass, String value ) { if ( value == null || value.trim().length() == 0 ) { return null; } String[] exceptionClassAndComment = whitespace.split(value.trim(), 2); String exceptionClass = toFullClassName(owningClass, exceptionClassAndComment[0]); String comment = exceptionClassAndComment.length == 1 ? "" :exceptionClassAndComment[1]; return new ThrowsJavadoc( exceptionClass, CommentParser.parse(owningClass,comment) ); }  static ThrowsJavadoc parseTag( String owningClass, String value ); }
ThrowsTagParser { public static ThrowsJavadoc parseTag( String owningClass, String value ) { if ( value == null || value.trim().length() == 0 ) { return null; } String[] exceptionClassAndComment = whitespace.split(value.trim(), 2); String exceptionClass = toFullClassName(owningClass, exceptionClassAndComment[0]); String comment = exceptionClassAndComment.length == 1 ? "" :exceptionClassAndComment[1]; return new ThrowsJavadoc( exceptionClass, CommentParser.parse(owningClass,comment) ); }  static ThrowsJavadoc parseTag( String owningClass, String value );  }