Details
-
Bug
-
Resolution: Done
-
Major
-
3.0.8, 4.0.0-BETA3
-
None
-
None
-
Workaround Exists
-
Description
A test we have in the Hibernate Search code base which worked fine with Byteman 3.x seems to highlight a regression in Byteman 4.0.0-BETA3.
The rule definition:
@BMRule( name = "trackCriteriaEntityType", targetClass = "org.hibernate.search.query.hibernate.impl.CriteriaObjectInitializer", targetMethod = "buildUpCriteria(java.util.List, org.hibernate.search.query.hibernate.impl.ObjectInitializationContext)", targetLocation = "EXIT", helper = "org.hibernate.search.testsupport.BytemanHelper", binding = "c : org.hibernate.internal.CriteriaImpl = $!.get(0);", action = "pushEvent(c.getEntityOrClassName())" )
The targeted method declares a return of type List<Criteria>, where Criteria is an interface. This interface is implemented by org.hibernate.internal.CriteriaImpl, and we happen to know that when the rule is invoked the list contains an instance of such CriteriaImpl.
I'm attaching the generated .class of our Helper and the output of javap -c -p -v run on it.
This can be easily reproduced as building our project requires no other configuration than having Java8 and Maven.
sources at:
- https://github.com/hibernate/hibernate-search
The master branch will work fine as it's using Byteman 3.0.5. Change the Byteman version in the following property: https://github.com/hibernate/hibernate-search/blob/master/pom.xml#L197
Rebuilding will show that the test org.hibernate.search.test.query.initandlookup.CriteriaObjectInitializerAndHierarchyInheritanceTest starts to fail. (Still valid on commit id e54ad8a , N.B. I'll probably workaround this soon).