[jboss-jira] [JBoss JIRA] (LOGTOOL-104) FQCN and an import improperly deconflicted - FQCN lost

Arcadiy Ivanov (JIRA) issues at jboss.org
Mon Apr 18 13:36:00 EDT 2016


    [ https://issues.jboss.org/browse/LOGTOOL-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193342#comment-13193342 ] 

Arcadiy Ivanov edited comment on LOGTOOL-104 at 4/18/16 1:35 PM:
-----------------------------------------------------------------

[~dmlloyd] You are correct. The following method

{code}
    @Override
    public final void warnErrorWhileCallingBundleFindHook(final Throwable cause, final FindHook hook) {
{code}

is generated from this

{code}
    @LogMessage(level = WARN)
    @Message(id = 11039, value = "Error while calling bundle find hook: %s")
    void warnErrorWhileCallingBundleFindHook(@Cause Throwable cause, org.osgi.framework.hooks.bundle.FindHook hook);
{code}

with no import conflicts.

I'll follow [~jamezp] workaround advice and relax method signatures to j.l.O or convert FQCN to import where available.


was (Author: arcivanov):
[~dmlloyd] You are correct. The following method

{{{
    @Override
    public final void warnErrorWhileCallingBundleFindHook(final Throwable cause, final FindHook hook) {
}}}

is generated from this

{{{
    @LogMessage(level = WARN)
    @Message(id = 11039, value = "Error while calling bundle find hook: %s")
    void warnErrorWhileCallingBundleFindHook(@Cause Throwable cause, org.osgi.framework.hooks.bundle.FindHook hook);
}}}

with no import conflicts.

I'll follow [~jamezp] workaround advice and relax method signatures to j.l.O or convert FQCN to import where available.

> FQCN and an import improperly deconflicted - FQCN lost
> ------------------------------------------------------
>
>                 Key: LOGTOOL-104
>                 URL: https://issues.jboss.org/browse/LOGTOOL-104
>             Project: Log Tool
>          Issue Type: Bug
>    Affects Versions: 2.0.1.Final
>            Reporter: Arcadiy Ivanov
>
> Given:
> {code}
> import org.osgi.framework.hooks.service.EventHook;
> @MessageLogger(projectCode = "JBOSGI")
> public interface FrameworkLogger extends BasicLogger {
>     @LogMessage(level = WARN)
>     @Message(id = 11019, value = "Error while calling event hook: %s")
>     void warnErrorWhileCallingEventHook(@Cause Throwable cause, EventHook hook);
>     @LogMessage(level = WARN)
>     @Message(id = 11040, value = "Error while calling bundle event hook: %s")
>     void warnErrorWhileCallingBundleEventHook(@Cause Throwable cause, org.osgi.framework.hooks.bundle.EventHook hook);
> }
> {code}
> Compilation failure:
> {quote}
> ERROR] COMPILATION ERROR : 
> [INFO] -------------------------------------------------------------
> [ERROR] /Users/arcivanov/Documents/src/jbosgi/jbosgi-framework/core/target/generated-sources/annotations/org/jboss/osgi/framework/FrameworkLogger_$logger.java:[26,8] org.jboss.osgi.framework.FrameworkLogger_$logger is not abstract and does not override abstract method warnErrorWhileCallingBundleEventHook(java.lang.Throwable,org.osgi.framework.hooks.bundle.EventHook) in org.jboss.osgi.framework.FrameworkLogger
> [ERROR] /Users/arcivanov/Documents/src/jbosgi/jbosgi-framework/core/target/generated-sources/annotations/org/jboss/osgi/framework/FrameworkLogger_$logger.java:[336,5] method does not override or implement a method from a supertype
> {quote}
> Cause:
> {code}
> import org.osgi.framework.hooks.service.EventHook;
> @Generated(value = "org.jboss.logging.processor.generator.model.MessageLoggerImplementor", date = "2016-04-18T04:40:24-0400")
> public class FrameworkLogger_$logger extends DelegatingBasicLogger implements FrameworkLogger,BasicLogger,Serializable {
>     @Override
>     public final void warnErrorWhileCallingEventHook(final Throwable cause, final EventHook hook) {
>         super.log.logf(FQCN, org.jboss.logging.Logger.Level.WARN, cause, warnErrorWhileCallingEventHook$str(), hook);
>     }
>     @Override
>     public final void warnErrorWhileCallingBundleEventHook(final Throwable cause, final EventHook hook) {
>         super.log.logf(FQCN, org.jboss.logging.Logger.Level.WARN, cause, warnErrorWhileCallingBundleEventHook$str(), hook);
>     }
> }
> {code}
> As you can see the cause of the failure is that {{EventHook}} argument FQCN is lost in the generated {{warnErrorWhileCallingBundleEventHook}}.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list