Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MJAVADOC-659] changing exception description when using "fix". #57

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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