]
James Perkins resolved LOGTOOL-115.
-----------------------------------
Resolution: Done
Fixed by JDeparser upgrade in LOGTOOL-118
Ambiguous import problem with conflicting class name
----------------------------------------------------
Key: LOGTOOL-115
URL:
https://issues.jboss.org/browse/LOGTOOL-115
Project: Log Tool
Issue Type: Bug
Affects Versions: 2.0.1.Final
Reporter: David Lloyd
Assignee: James Perkins
Fix For: 2.0.2.Final, 2.1.0.Alpha1
If I have two classes with the same simple name in the logging interface, and a single
method uses both of them, the generated class fails to qualify one of them, resulting in
compilation errors like this:
{noformat}
[ERROR]
/home/david/src/java/wildfly-naming/target/generated-sources/annotations/org/wildfly/naming/client/_private/Messages_$logger.java:[35,8]
org.wildfly.naming.client._private.Messages_$logger is not abstract and does not override
abstract method authenticationFailed(org.wildfly.security.auth.AuthenticationException) in
org.wildfly.naming.client._private.Messages
[ERROR]
/home/david/src/java/wildfly-naming/target/generated-sources/annotations/org/wildfly/naming/client/_private/Messages_$logger.java:[403,5]
method does not override or implement a method from a supertype
{noformat}
The source looks like this:
{code}
// ...
import org.wildfly.security.auth.AuthenticationException;
// ...
@MessageLogger(projectCode = "WFNAM", length = 5)
public interface Messages extends BasicLogger {
// ...
@Message(id = 32, value = "Peer authentication failed")
javax.naming.AuthenticationException authenticationFailed(@Cause
AuthenticationException cause);
// ...
{code}
The generated code is:
{code}
private static final String authenticationFailed = "WFNAM00032: Peer
authentication failed";
protected String authenticationFailed$str() {
return authenticationFailed;
}
@Override
public final AuthenticationException authenticationFailed(final
AuthenticationException cause) { // XXX This is a problem line; return type is not
qualified
final AuthenticationException result = new
AuthenticationException(String.format(authenticationFailed$str())); // XXX and this type
and constructor are also not qualified
result.initCause(cause);
final StackTraceElement[] st = result.getStackTrace();
result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
return result;
}
{code}