Author: vsiveton Date: Mon Jul 13 12:16:52 2009 New Revision: 793566 URL: http://svn.apache.org/viewvc?rev=793566&view=rev Log: o take care of RuntimeException in @throws tag o added test case o updated javadoc
Modified: maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractFixJavadocMojo.java maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithJavadoc.java maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/fix-test/src/main/java/fix/test/ClassWithJavadoc.java Modified: maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractFixJavadocMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractFixJavadocMojo.java?rev=793566&r1=793565&r2=793566&view=diff ============================================================================== --- maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractFixJavadocMojo.java (original) +++ maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractFixJavadocMojo.java Mon Jul 13 12:16:52 2009 @@ -335,6 +335,9 @@ // Internal fields // ---------------------------------------------------------------------- + /** The current project class loader. */ + private ClassLoader projectClassLoader; + /** * Split {...@link #fixTags} by comma. * @see {...@link #init()} @@ -432,41 +435,6 @@ } /** - * @param p not null - * @return the project classLoader - * @throws MojoExecutionException if any - */ - protected ClassLoader getProjectClassLoader( MavenProject p ) - throws MojoExecutionException - { - List classPath; - try - { - classPath = getCompileClasspathElements( p ); - } - catch ( DependencyResolutionRequiredException e ) - { - throw new MojoExecutionException( "DependencyResolutionRequiredException: " + e.getMessage(), e ); - } - - List urls = new ArrayList( classPath.size() ); - Iterator iter = classPath.iterator(); - while ( iter.hasNext() ) - { - try - { - urls.add( new File( ( (String) iter.next() ) ).toURL() ); - } - catch ( MalformedURLException e ) - { - throw new MojoExecutionException( "MalformedURLException: " + e.getMessage(), e ); - } - } - - return new URLClassLoader( (URL[]) urls.toArray( new URL[urls.size()] ), null ); - } - - /** * @param javaMethod not null * @return the fully qualify name of javaMethod with signature */ @@ -480,14 +448,6 @@ return sb.toString(); } - /** - * @return the source dir for the given project - */ - protected File getProjectSourceDirectory() - { - return new File( project.getBuild().getSourceDirectory() ); - } - // ---------------------------------------------------------------------- // private methods // ---------------------------------------------------------------------- @@ -618,6 +578,14 @@ } /** + * @return the source dir as File for the given project + */ + private File getProjectSourceDirectory() + { + return new File( project.getBuild().getSourceDirectory() ); + } + + /** * Invoke Maven to run clirr-maven-plugin to find API differences. */ private void executeClirr() @@ -914,7 +882,7 @@ { if ( "pom".equals( project.getPackaging().toLowerCase() ) ) { - getLog().warn( "This project has 'pom' packaging, no Java sources will be available." ); + getLog().warn( "This project has 'pom' packaging, no Java sources is available." ); return null; } @@ -933,7 +901,7 @@ } JavaDocBuilder builder = new JavaDocBuilder(); - builder.getClassLibrary().addClassLoader( getProjectClassLoader( project ) ); + builder.getClassLibrary().addClassLoader( getProjectClassLoader() ); builder.setEncoding( encoding ); for ( Iterator i = javaFiles.iterator(); i.hasNext(); ) { @@ -951,8 +919,7 @@ } catch ( ParseException e ) { - // QDOX-118 - getLog().warn( "QDOX ParseException: " + e.getMessage() ); + getLog().warn( "QDOX ParseException: " + e.getMessage() + ". Can't fix it." ); } } @@ -960,6 +927,45 @@ } /** + * @return the classLoader for the given project using lazy instantiation. + * @throws MojoExecutionException if any + */ + private ClassLoader getProjectClassLoader() + throws MojoExecutionException + { + if ( projectClassLoader == null ) + { + List classPath; + try + { + classPath = getCompileClasspathElements( project ); + } + catch ( DependencyResolutionRequiredException e ) + { + throw new MojoExecutionException( "DependencyResolutionRequiredException: " + e.getMessage(), e ); + } + + List urls = new ArrayList( classPath.size() ); + Iterator iter = classPath.iterator(); + while ( iter.hasNext() ) + { + try + { + urls.add( new File( ( (String) iter.next() ) ).toURL() ); + } + catch ( MalformedURLException e ) + { + throw new MojoExecutionException( "MalformedURLException: " + e.getMessage(), e ); + } + } + + projectClassLoader = new URLClassLoader( (URL[]) urls.toArray( new URL[urls.size()] ), null ); + } + + return projectClassLoader; + } + + /** * Process the given {...@link JavaClass}, ie add missing javadoc tags depending user parameters. * * @param javaClass not null @@ -1070,16 +1076,17 @@ /** * Take care of block or single comments between Javadoc comment and entity declaration ie: - * <pre> - * /** - *  * {Javadoc Comment} - *  */ - * /* - *  * {Block Comment} - *  */ - * // {Single comment} - * entity - * </pre> + * <br/> + * <code> + * <font color="#808080">1</font> <font color="#ffffff"> </font><font color="#3f5fbf">/**</font><br /> + * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">* {Javadoc Comment}</font><br /> + * <font color="#808080">3</font> <font color="#ffffff"> </font><font color="#3f5fbf">*/</font><br /> + * <font color="#808080">4</font> <font color="#ffffff"> </font><font color="#3f7f5f">/*</font><br /> + * <font color="#808080">5</font> <font color="#ffffff"> </font><font color="#3f7f5f">* {Block Comment}</font><br /> + * <font color="#808080">6</font> <font color="#ffffff"> </font><font color="#3f7f5f">*/</font><br /> + * <font color="#808080">7</font> <font color="#ffffff"> </font><font color="#3f7f5f">// {Single comment}</font><br /> + * <font color="#808080">8</font> <font color="#ffffff"> </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>void </b></font><font color="#000000">dummyMethod</font><font color="#000000">( </font><font color="#000000">String s </font><font color="#000000">){}</font> + * </code> * * @param stringWriter not null * @param originalContent not null @@ -1192,15 +1199,17 @@ /** * Add a default Javadoc for the given class, i.e.: - * <pre> - * /** - *  * {<i>Comment based on the class name</i>} - *  * - *  * @author X {<i>added if <code>addMissingAuthor</code></i>} - *  * @version X {<i>added if <code>addMissingVersion</code></i>} - *  * @since X {<i>added if <code>addMissingSince</code> and new classes from previous version</i>} - *  */ - * </pre> + * <br/> + * <code> + * <font color="#808080">1</font> <font color="#ffffff"> </font><font color="#3f5fbf">/**</font><br /> + * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">* {Comment based on the class name}</font><br /> + * <font color="#808080">3</font> <font color="#ffffff"> </font><font color="#3f5fbf">*</font><br /> + * <font color="#808080">4</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@author </font><font color="#3f5fbf">X {added if addMissingAuthor}</font><br /> + * <font color="#808080">5</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@version </font><font color="#3f5fbf">X {added if addMissingVersion}</font><br /> + * <font color="#808080">6</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@since </font><font color="#3f5fbf">X {added if addMissingSince and new classes from previous version}</font><br /> + * <font color="#808080">7</font> <font color="#ffffff"> </font><font color="#3f5fbf">*/</font><br /> + * <font color="#808080">8</font> <font color="#7f0055"><b>public class </b></font><font color="#000000">DummyClass </font><font color="#000000">{}</font></code> + * </code> * * @param buffer not null * @param javaClass not null @@ -1292,9 +1301,11 @@ /** * Add a default Javadoc for the given field, i.e.: - * <pre> - * /** Constant <code>Field name</code> */ - * </pre> + * <br/> + * <code> + * <font color="#808080">1</font> <font color="#ffffff"> </font><font color="#3f5fbf">/** Constant </font><font color="#7f7f9f"><code></font><font color="#3f5fbf">MY_STRING_CONSTANT="value"</font><font color="#7f7f9f"></code> </font><font color="#3f5fbf">*/</font><br /> + * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#7f0055"><b>public static final </b></font><font color="#000000">String MY_STRING_CONSTANT = </font><font color="#2a00ff">"value"</font><font color="#000000">;</font> + * </code> * * @param stringWriter not null * @param field not null @@ -1405,16 +1416,18 @@ /** * Add in the buffer a default Javadoc for the given class: - * <pre> - * /** - *  * {<i>Comment based on the class name</i>} - *  * - *  * @param X {<i>added if <code>addMissingParam</code></i>} - *  * @return X {<i>added if <code>addMissingReturn</code></i>} - *  * @throws X {<i>added if <code>addMissingThrows</code>} - *  * @since X {<i>added if <code>addMissingSince</code> and new classes from previous version</i>} - *  */ - * </pre> + * <br/> + * <code> + * <font color="#808080">1</font> <font color="#ffffff"> </font><font color="#3f5fbf">/**</font><br /> + * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">* {Comment based on the method name}</font><br /> + * <font color="#808080">3</font> <font color="#ffffff"> </font><font color="#3f5fbf">*</font><br /> + * <font color="#808080">4</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@param </font><font color="#3f5fbf">X {added if addMissingParam}</font><br /> + * <font color="#808080">5</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@return </font><font color="#3f5fbf">X {added if addMissingReturn}</font><br /> + * <font color="#808080">6</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@throws </font><font color="#3f5fbf">X {added if addMissingThrows}</font><br /> + * <font color="#808080">7</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@since </font><font color="#3f5fbf">X {added if addMissingSince and new classes from previous version}</font><br /> + * <font color="#808080">8</font> <font color="#ffffff"> </font><font color="#3f5fbf">*/</font><br /> + * <font color="#808080">9</font> <font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>void </b></font><font color="#000000">dummyMethod</font><font color="#000000">( </font><font color="#000000">String s </font><font color="#000000">){}</font> + * </code> * * @param buffer not null * @param javaMethod not null @@ -1643,6 +1656,8 @@ addDefaultJavadocTags( sb, entity, indent, isJavaMethod ); } + sb = new StringBuffer( removeLastEmptyJavadocLines( sb.toString() ) ).append( EOL ); + sb.append( indent ).append( " " ).append( END_JAVADOC ); sb.append( EOL ); @@ -1944,21 +1959,24 @@ private void writeReturnTag( final StringBuffer sb, final JavaMethod javaMethod, final JavaEntityTags javaEntityTags ) { + String originalJavadocTag = javaEntityTags.getJavadocReturnTag(); + if ( originalJavadocTag == null ) + { + return; + } + if ( !fixTag( RETURN_TAG ) ) { - // write original tag if found - if ( StringUtils.isNotEmpty( javaEntityTags.getJavadocReturnTag() ) ) - { - sb.append( javaEntityTags.getJavadocReturnTag() ); - } + // write original param tag if found + sb.append( originalJavadocTag ); return; } - if ( StringUtils.isNotEmpty( javaEntityTags.getJavadocReturnTag() ) && javaMethod.getReturns() != null + if ( StringUtils.isNotEmpty( originalJavadocTag ) && javaMethod.getReturns() != null && !javaMethod.getReturns().isVoid() ) { - sb.append( javaEntityTags.getJavadocReturnTag() ); - if ( javaEntityTags.getJavadocReturnTag().trim().endsWith( "@" + RETURN_TAG ) ) + sb.append( originalJavadocTag ); + if ( originalJavadocTag.trim().endsWith( "@" + RETURN_TAG ) ) { sb.append( " " ); sb.append( getDefaultJavadocForType( javaMethod.getReturns() ) ); @@ -1969,9 +1987,9 @@ private void writeThrowsTag( final StringBuffer sb, final JavaMethod javaMethod, final JavaEntityTags javaEntityTags, final String[] params ) { - String paramName = params[0]; + String exceptionClassName = params[0]; - String originalJavadocTag = javaEntityTags.getJavadocThrowsTag( paramName ); + String originalJavadocTag = javaEntityTags.getJavadocThrowsTag( exceptionClassName ); if ( originalJavadocTag == null ) { return; @@ -1990,9 +2008,9 @@ { Type exception = javaMethod.getExceptions()[j]; - if ( exception.getValue().endsWith( paramName ) ) + if ( exception.getValue().endsWith( exceptionClassName ) ) { - originalJavadocTag = StringUtils.replace( originalJavadocTag, paramName, exception.getValue() ); + originalJavadocTag = StringUtils.replace( originalJavadocTag, exceptionClassName, exception.getValue() ); if ( StringUtils.removeDuplicateWhitespace( originalJavadocTag ).trim() .endsWith( "@" + THROWS_TAG + " " + exception.getValue() ) ) { @@ -2003,9 +2021,39 @@ // added qualified name javaEntityTags.putJavadocThrowsTag( exception.getValue(), originalJavadocTag ); + + return; } } } + + // Maybe a RuntimeException + Class clazz = getRuntimeExceptionClass( javaMethod.getParentClass(), exceptionClassName ); + if ( clazz != null ) + { + sb.append( StringUtils.replace( originalJavadocTag, exceptionClassName, clazz.getName() ) ); + + // added qualified name + javaEntityTags.putJavadocThrowsTag( clazz.getName(), originalJavadocTag ); + + return; + } + + if ( getLog().isWarnEnabled() ) + { + StringBuffer warn = new StringBuffer(); + + warn.append( "Unknown throws exception '" ).append( exceptionClassName ).append( "' defined in " ); + warn.append( getJavaMethodAsString( javaMethod ) ); + + getLog().warn( warn.toString() ); + } + + sb.append( originalJavadocTag ); + if ( params.length == 1 ) + { + sb.append( " if any." ); + } } /** @@ -2482,7 +2530,7 @@ } } - Class clazz = getClass( javaMethod.getParentClass(), project ); + Class clazz = getClass( javaMethod.getParentClass().getFullyQualifiedName() ); List interfaces = ClassUtils.getAllInterfaces( clazz ); for ( Iterator it = interfaces.iterator(); it.hasNext(); ) @@ -2546,7 +2594,7 @@ // workaround for generics i.e. type.getValue() = E instead of real class try { - getClass( type.getJavaClass(), project ); + getClass( type.getJavaClass().getFullyQualifiedName() ); if ( type.isArray() ) { javaMethodParams.add( type.getValue() + "[]" ); @@ -2615,7 +2663,7 @@ StringBuffer javadocLink = new StringBuffer(); try { - getClass( type.getJavaClass(), project ); + getClass( type.getJavaClass().getFullyQualifiedName() ); javadocLink.append( "{...@link " ); String s = type.getJavaClass().getFullyQualifiedName(); @@ -2717,7 +2765,7 @@ // QDOX-150: type.getValue() = E instead of real class... try { - getClass( type.getJavaClass(), project ); + getClass( type.getJavaClass().getFullyQualifiedName() ); if ( type.isArray() ) { javaMethodParams.add( type.getValue() + "[]" ); @@ -2760,55 +2808,18 @@ } /** - * Note: JavaClass doesn't handle generic class i.e. E - * - * @param javaClass not null - * @param project not null - * @return the class corresponding to the javaClass parameter. - * @throws MojoExecutionException if any - * @see {...@link Class#forName(String, boolean, ClassLoader)} + * @param className not null + * @return the Class corresponding to the given class name using the project classloader. + * @throws MojoExecutionException if class not found + * @see {...@link ClassUtils#getClass(ClassLoader, String, boolean)} + * @see {...@link #getProjectClassLoader()} */ - private Class getClass( JavaClass javaClass, MavenProject project ) + private Class getClass( String className ) throws MojoExecutionException { - // primitive - String qualifiedName = javaClass.getFullyQualifiedName(); - if ( qualifiedName.equals( Byte.TYPE.toString() ) ) - { - return Byte.TYPE; - } - else if ( qualifiedName.equals( Short.TYPE.toString() ) ) - { - return Short.TYPE; - } - else if ( qualifiedName.equals( Integer.TYPE.toString() ) ) - { - return Integer.TYPE; - } - else if ( qualifiedName.equals( Long.TYPE.toString() ) ) - { - return Long.TYPE; - } - else if ( qualifiedName.equals( Float.TYPE.toString() ) ) - { - return Float.TYPE; - } - else if ( qualifiedName.equals( Double.TYPE.toString() ) ) - { - return Double.TYPE; - } - else if ( qualifiedName.equals( Boolean.TYPE.toString() ) ) - { - return Boolean.TYPE; - } - else if ( qualifiedName.equals( Character.TYPE.toString() ) ) - { - return Character.TYPE; - } - try { - return Class.forName( javaClass.getFullyQualifiedName(), false, getProjectClassLoader( project ) ); + return ClassUtils.getClass( getProjectClassLoader(), className, false ); } catch ( ClassNotFoundException e ) { @@ -2817,6 +2828,48 @@ } /** + * Returns the Class object assignable for {...@link RuntimeException} class and associated with the given + * exception class name. + * + * @param currentClass not null + * @param exceptionClassName not null, an exception class name defined as: + * <ul> + * <li>exception class fully qualified</li> + * <li>exception class in the same package</li> + * <li>exception inner class</li> + * <li>exception class in java.lang package</li> + * </ul> + * @return a RuntimeException assignable class. + * @see #getClass(String) + */ + private Class getRuntimeExceptionClass( JavaClass currentClass, String exceptionClassName ) + { + String[] potentialClassNames = + new String[] { exceptionClassName, currentClass.getPackage().getName() + "." + exceptionClassName, + currentClass.getPackage().getName() + "." + currentClass.getName() + "$" + exceptionClassName, + "java.lang." + exceptionClassName }; + + Class clazz = null; + for ( int i = 0; i < potentialClassNames.length; i++) + { + try + { + clazz = getClass( potentialClassNames[i] ); + } + catch ( MojoExecutionException e ) + { + // nop + } + if ( clazz != null && ClassUtils.isAssignable( clazz, RuntimeException.class ) ) + { + return clazz; + } + } + + return null; + } + + /** * @param javaClass not null */ private void addSinceClasses( JavaClass javaClass ) @@ -3017,7 +3070,7 @@ * * <code> * <font color="#808080">1</font> <font color="#ffffff"></font><br /> - * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">/** </font><br /> + * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">/**</font><br /> * <font color="#808080">3</font> <font color="#ffffff"> </font><font color="#3f5fbf">* Dummy Javadoc comment.</font><br /> * <font color="#808080">4</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@param </font><font color="#3f5fbf">s a String</font><br /> * <font color="#808080">5</font> <font color="#ffffff"> </font><font color="#3f5fbf">*/</font><br /> @@ -3071,7 +3124,7 @@ * * <code> * <font color="#808080">1</font> <font color="#ffffff"></font><br /> - * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">/** </font><br /> + * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">/**</font><br /> * <font color="#808080">3</font> <font color="#ffffff"> </font><font color="#3f5fbf">* Dummy Javadoc comment.</font><br /> * <font color="#808080">4</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@param </font><font color="#3f5fbf">s a String</font><br /> * <font color="#808080">5</font> <font color="#ffffff"> </font><font color="#3f5fbf">*/</font><br /> @@ -3145,7 +3198,7 @@ * * <code> * <font color="#808080">1</font> <font color="#ffffff"></font><br /> - * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">/** </font><br /> + * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">/**</font><br /> * <font color="#808080">3</font> <font color="#ffffff"> </font><font color="#3f5fbf">* Dummy Javadoc comment.</font><br /> * <font color="#808080">4</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@param </font><font color="#3f5fbf">s a String</font><br /> * <font color="#808080">5</font> <font color="#ffffff"> </font><font color="#3f5fbf">*/</font><br /> @@ -3157,7 +3210,7 @@ * <br/> * * <code> - * <font color="#808080">1</font> <font color="#ffffff"> </font><font color="#3f5fbf">/** </font><br /> + * <font color="#808080">1</font> <font color="#ffffff"> </font><font color="#3f5fbf">/**</font><br /> * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">* Dummy Javadoc comment.</font><br /> * <font color="#808080">3</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@param </font><font color="#3f5fbf">s a String</font><br /> * <font color="#808080">4</font> <font color="#ffffff"> </font><font color="#3f5fbf">*/</font><br /> @@ -3203,7 +3256,7 @@ * * <code> * <font color="#808080">1</font> <font color="#ffffff"></font><br /> - * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">/** </font><br /> + * <font color="#808080">2</font> <font color="#ffffff"> </font><font color="#3f5fbf">/**</font><br /> * <font color="#808080">3</font> <font color="#ffffff"> </font><font color="#3f5fbf">* Dummy Javadoc comment.</font><br /> * <font color="#808080">4</font> <font color="#ffffff"> </font><font color="#3f5fbf">* </font><font color="#7f9fbf">@param </font><font color="#3f5fbf">s a String</font><br /> * <font color="#808080">5</font> <font color="#ffffff"> </font><font color="#3f5fbf">*/</font><br /> Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithJavadoc.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithJavadoc.java?rev=793566&r1=793565&r2=793566&view=diff ============================================================================== --- maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithJavadoc.java (original) +++ maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithJavadoc.java Mon Jul 13 12:16:52 2009 @@ -171,6 +171,40 @@ return null; } + /** + * Take care of last empty javadoc with unused tags. + */ + public void unusedTag() + { + } + + /** + * Take care of RuntimeException. + * + * @throws java.lang.UnsupportedOperationException if any + */ + public void throwsTagWithRuntimeException() + { + } + + /** + * Take care of inner RuntimeException. + * + * @throws fix.test.ClassWithJavadoc$MyRuntimeException if any + */ + public void throwsTagWithInnerRuntimeException() + { + } + + /** + * Unknown throws RuntimeException. + * + * @throws UnknownRuntimeException if any + */ + public void throwsTagWithUnknownRuntimeException() + { + } + // ---------------------------------------------------------------------- // Inheritance // ---------------------------------------------------------------------- @@ -231,4 +265,12 @@ { } } + + /** + * RuntimeException + */ + public static class MyRuntimeException + extends RuntimeException + { + } } Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/fix-test/src/main/java/fix/test/ClassWithJavadoc.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/fix-test/src/main/java/fix/test/ClassWithJavadoc.java?rev=793566&r1=793565&r2=793566&view=diff ============================================================================== --- maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/fix-test/src/main/java/fix/test/ClassWithJavadoc.java (original) +++ maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/fix-test/src/main/java/fix/test/ClassWithJavadoc.java Mon Jul 13 12:16:52 2009 @@ -148,6 +148,43 @@ return null; } + /** + * Take care of last empty javadoc with unused tags. + * + * @param unused not + * used + */ + public void unusedTag() + { + } + + /** + * Take care of RuntimeException. + * + * @throws UnsupportedOperationException if any + */ + public void throwsTagWithRuntimeException() + { + } + + /** + * Take care of inner RuntimeException. + * + * @throws MyRuntimeException if any + */ + public void throwsTagWithInnerRuntimeException() + { + } + + /** + * Unknown throws RuntimeException. + * + * @throws UnknownRuntimeException if any + */ + public void throwsTagWithUnknownRuntimeException() + { + } + // ---------------------------------------------------------------------- // Inheritance // ---------------------------------------------------------------------- @@ -217,4 +254,12 @@ { } } + + /** + * RuntimeException + */ + public static class MyRuntimeException + extends RuntimeException + { + } }