ByteBuddy Enhancer throws java.lang.IllegalStateException: Cannot resolve type description for certain classes

Description

I have assembled a test project that replicates this issue. It seems like the Byte Buddy enhancer manages to enhance some classes, while for others it throw the following exception:

To replicate the issue, you can simply run:

Environment

None

Activity

Show:
Rafael Winterhalter
December 8, 2016, 12:44 PM
Edited

The problem is the use of Enhancer::enhance(File). The plugin resolves class files by the relative path of the passed instance where it is no longer possible to distinguish between a type foo.bar.Qux and a type bar.Qux residing in a folder foo. The API should not be used but the plugin should resolve the name and byte array itself. When I refactored the plugin to not rely on Javassist types, this boundary broke without a test to capture the problem. A similar problem occurs when using Javassist.

I am preparing a patch for it right now.

Vlad Mihalcea
December 14, 2016, 7:40 AM

Applied PR upstream.

Assignee

Rafael Winterhalter

Reporter

Vlad Mihalcea

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure