Skip to content

Commit

Permalink
[MJAVADOC-659] changing exception description when using "fix".
Browse files Browse the repository at this point in the history
  • Loading branch information
XenoAmess committed Aug 24, 2020
1 parent 44e19db commit 74b03f4
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 1 deletion.
Expand Up @@ -2153,7 +2153,7 @@ void writeThrowsTag( final StringBuilder sb, final JavaExecutable javaExecutable
{
for ( JavaType exception : javaExecutable.getExceptions() )
{
if ( exception.getValue().endsWith( exceptionClassName ) )
if ( exception.getFullyQualifiedName().endsWith( exceptionClassName ) )
{
originalJavadocTag = StringUtils.replace( originalJavadocTag, exceptionClassName,
exception.getFullyQualifiedName() );
Expand Down
Expand Up @@ -397,6 +397,60 @@ public <T extends Object> void testGeneric2(Class<T> tClass, Object o)
{
return;
}

/**
* test whether it will change exception description when using "fix"
* test if we use fully qualified name for the exception.
*
* @throws java.lang.Exception original description, should not be changed to "if any".
* @since 1.1
*/
public void testException0()
throws Exception
{
throw new Exception();
}

/**
* test whether it will change exception description when using "fix"
* test if we use short name for the exception.
*
* @throws java.lang.Exception original description, should not be changed to "if any".
* @since 1.1
*/
public void testException1()
throws Exception
{
throw new Exception();
}

/**
* test whether it will change exception description when using "fix"
* test if we use a wrong name for the exception.
*
* @throws RuaaaaaaException abcdefghijklmn.
* @throws java.lang.Exception if any.
* @since 1.1
*/
public void testException2()
throws Exception
{
throw new Exception();
}

/**
* test whether it will change exception description when using "fix"
* test if we provide only one exception description.
*
* @throws java.lang.RuntimeException text.
* @throws java.lang.Exception if any.
* @since 1.1
*/
public void testException3()
throws RuntimeException , Exception
{
throw new Exception();
}
}

/**
Expand Down
Expand Up @@ -218,6 +218,55 @@ public <T extends Object> void testGeneric3(Class<T> tClass, Object o)
{
return;
}

/**
* <p>testException0.</p>
*
* @throws java.lang.Exception if any.
* @since 1.1
*/
public void testException0()
throws Exception
{
throw new Exception();
}

/**
* <p>testException1.</p>
*
* @throws java.lang.Exception if any.
* @since 1.1
*/
public void testException1()
throws Exception
{
throw new Exception();
}

/**
* <p>testException2.</p>
*
* @throws java.lang.Exception if any.
* @since 1.1
*/
public void testException2()
throws Exception
{
throw new Exception();
}

/**
* <p>testException3.</p>
*
* @throws java.lang.RuntimeException if any.
* @throws java.lang.Exception if any.
* @since 1.1
*/
public void testException3()
throws RuntimeException , Exception
{
throw new Exception();
}
}

@SuppressWarnings("SameReturnValue")
Expand Down
Expand Up @@ -366,6 +366,54 @@ public <T extends Object> void testGeneric2(Class<T> tClass, Object o)
{
return;
}

/**
* test whether it will change exception description when using "fix"
* test if we use fully qualified name for the exception.
*
* @throws java.lang.Exception original description, should not be changed to "if any".
*/
public void testException0()
throws Exception
{
throw new Exception();
}

/**
* test whether it will change exception description when using "fix"
* test if we use short name for the exception.
*
* @throws Exception original description, should not be changed to "if any".
*/
public void testException1()
throws Exception
{
throw new Exception();
}

/**
* test whether it will change exception description when using "fix"
* test if we use a wrong name for the exception.
*
* @throws RuaaaaaaException abcdefghijklmn.
*/
public void testException2()
throws Exception
{
throw new Exception();
}

/**
* test whether it will change exception description when using "fix"
* test if we provide only one exception description.
*
* @throws RuntimeException text.
*/
public void testException3()
throws RuntimeException , Exception
{
throw new Exception();
}
}

/**
Expand Down
Expand Up @@ -146,6 +146,30 @@ public <T extends Object> void testGeneric3(Class<T> tClass, Object o)
{
return;
}

public void testException0()
throws Exception
{
throw new Exception();
}

public void testException1()
throws Exception
{
throw new Exception();
}

public void testException2()
throws Exception
{
throw new Exception();
}

public void testException3()
throws RuntimeException , Exception
{
throw new Exception();
}
}

@SuppressWarnings("SameReturnValue")
Expand Down

0 comments on commit 74b03f4

Please sign in to comment.