]
Ondrej Chaloupka updated JBTM-3295:
-----------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request:
LRACDIExtension returns null as class name when @LRA annotated class
does not contain Compensate or AfterLRA
------------------------------------------------------------------------------------------------------------
Key: JBTM-3295
URL:
https://issues.redhat.com/browse/JBTM-3295
Project: JBoss Transaction Manager
Issue Type: Bug
Components: LRA
Reporter: Ondrej Chaloupka
Assignee: Ondrej Chaloupka
Priority: Minor
When the {{@LRA}} annotated class does not containe neither {{@Compensate}} nor
{{@AfterLRA}} the exception message contains {{null}} instead of the name of the guilty
class.
{code}
Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1
exceptions:
Exception 0 :
java.lang.IllegalStateException: null: The class contains an LRA method and no Compensate
or AfterLRA method was found.
at
io.narayana.lra.client.internal.proxy.nonjaxrs.LRACDIExtension.isLRAParticipant(LRACDIExtension.java:129)
at
io.narayana.lra.client.internal.proxy.nonjaxrs.LRACDIExtension.getAsParticipant(LRACDIExtension.java:104)
at
io.narayana.lra.client.internal.proxy.nonjaxrs.LRACDIExtension.observe(LRACDIExtension.java:75)
{code}
The reason seems to be that the method {{ClassInfo.simpleName()}} returns null if
it's not an inner class or nested class.
The javadoc says following on it
{code}
Returns the source declared name of this class if it is an inner class, or a local class.
Otherwise
this method will return null.
{code}