[wildfly-dev] Return types of i18n logging methods and their "equality" expectations

Jaikiran Pai jpai at redhat.com
Sat Apr 27 09:17:50 EDT 2013


I have a interface annotated with @MessageBundle which has a method:

@Message(id = xxxx, value = "No param message")
SomeException fooBar();


So the method expects no format params for the log message and returns a 
"SomeException" type. Assuming some piece of code then uses this logging 
method to do:

throw fooBar();

is it fine to expect that if the caller does:

try {
     ...
    doSomething();
} catch (Exception e) {
     // is this fine to do?
     if (e.equals(fooBar()) {
         // do some other thing
     }
}

I think the equals and even == would work for the no param logger 
method, but is this considered as relying/guessing about the 
implementation details or is this fine to do?

-Jaikiran


More information about the wildfly-dev mailing list