Skip to content

Commit

Permalink
Merge pull request #57 from XenoAmess/fix_bug_about_changing_exceptio…
Browse files Browse the repository at this point in the history
…n_description_when_using_fix

[MJAVADOC-659] changing exception description when using "fix".
  • Loading branch information
elharo committed Aug 25, 2020
2 parents 0d798e2 + 74b03f4 commit ba0c830
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 1 deletion.
Expand Up @@ -2152,7 +2152,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 ba0c830

Please sign in to comment.