Thilo-Alexander Ginkel
Thilo-Alexander Ginkel

Reputation: 6958

Unwrapping classes enhanced by Guice AOP

Is there an "official" way to "unwrap" (i.e., obtain the non-enhanced class) for classes enhanced by Guice AOP?

So far, I detect these classes by looking for the string "$$EnhancerByGuice$$" in the class name and - if it is present - reverting to the superclass (Guice AOP works on classes using inheritance).

I'd prefer something that does not break when Guice decides to change this suffix string (which is by no means part of any API or contract).

Upvotes: 3

Views: 1211

Answers (1)

John Watts
John Watts

Reputation: 8875

As far as I can tell, there is no official way. There is an issue open to address it but given the prioritization I doubt it will happen. In the meantime, if you want to avoid breaking when Guice decide to change the suffix string, add a unit test that proves you can detect an enhanced class.

Upvotes: 2

Related Questions