]
David Lloyd commented on LOGTOOL-115:
-------------------------------------
It looks like the generated class actually imported the one which was qualified in the
interface, instead of the one that was imported by the interface. This doesn't really
affect the cause or solution but might help to make sense of the error.
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
Priority: Blocker
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}