HHH-12296 Upgrade to Byte Buddy 1.7.10 to support JDK10

This commit is contained in:
Sanne Grinovero 2018-02-14 16:43:17 +00:00
parent 91274811b6
commit 0c17ef47b3
2 changed files with 7 additions and 7 deletions

View File

@ -23,7 +23,7 @@ ext {
weldVersion = '3.0.0.Final' weldVersion = '3.0.0.Final'
javassistVersion = '3.22.0-GA' javassistVersion = '3.22.0-GA'
byteBuddyVersion = '1.6.14' // Improved JDK9 compatibility byteBuddyVersion = '1.7.10' // Now with JDK10 compatibility
// Wildfly version targeted by module ZIP; Arquillian/Shrinkwrap versions used for CDI testing and testing the module ZIP // Wildfly version targeted by module ZIP; Arquillian/Shrinkwrap versions used for CDI testing and testing the module ZIP
wildflyVersion = '11.0.0.Final' wildflyVersion = '11.0.0.Final'

View File

@ -45,7 +45,7 @@ import net.bytebuddy.description.annotation.AnnotationDescription;
import net.bytebuddy.description.field.FieldDescription; import net.bytebuddy.description.field.FieldDescription;
import net.bytebuddy.description.method.MethodDescription; import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.method.MethodList; import net.bytebuddy.description.method.MethodList;
import net.bytebuddy.description.modifier.FieldManifestation; import net.bytebuddy.description.modifier.FieldPersistence;
import net.bytebuddy.description.modifier.Visibility; import net.bytebuddy.description.modifier.Visibility;
import net.bytebuddy.description.type.TypeDefinition; import net.bytebuddy.description.type.TypeDefinition;
import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.description.type.TypeDescription;
@ -165,7 +165,7 @@ public class EnhancerImpl implements Enhancer {
if ( enhancementContext.doDirtyCheckingInline( managedCtClass ) ) { if ( enhancementContext.doDirtyCheckingInline( managedCtClass ) ) {
if ( collectCollectionFields( managedCtClass ).isEmpty() ) { if ( collectCollectionFields( managedCtClass ).isEmpty() ) {
builder = builder.implement( SelfDirtinessTracker.class ) builder = builder.implement( SelfDirtinessTracker.class )
.defineField( EnhancerConstants.TRACKER_FIELD_NAME, DirtyTracker.class, FieldManifestation.TRANSIENT, Visibility.PRIVATE ) .defineField( EnhancerConstants.TRACKER_FIELD_NAME, DirtyTracker.class, FieldPersistence.TRANSIENT, Visibility.PRIVATE )
.annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() ) .annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() )
.defineMethod( EnhancerConstants.TRACKER_CHANGER_NAME, void.class, Visibility.PUBLIC ) .defineMethod( EnhancerConstants.TRACKER_CHANGER_NAME, void.class, Visibility.PUBLIC )
.withParameters( String.class ) .withParameters( String.class )
@ -184,9 +184,9 @@ public class EnhancerImpl implements Enhancer {
} }
else { else {
builder = builder.implement( ExtendedSelfDirtinessTracker.class ) builder = builder.implement( ExtendedSelfDirtinessTracker.class )
.defineField( EnhancerConstants.TRACKER_FIELD_NAME, DirtyTracker.class, FieldManifestation.TRANSIENT, Visibility.PRIVATE ) .defineField( EnhancerConstants.TRACKER_FIELD_NAME, DirtyTracker.class, FieldPersistence.TRANSIENT, Visibility.PRIVATE )
.annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() ) .annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() )
.defineField( EnhancerConstants.TRACKER_COLLECTION_NAME, CollectionTracker.class, FieldManifestation.TRANSIENT, Visibility.PRIVATE ) .defineField( EnhancerConstants.TRACKER_COLLECTION_NAME, CollectionTracker.class, FieldPersistence.TRANSIENT, Visibility.PRIVATE )
.annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() ) .annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() )
.defineMethod( EnhancerConstants.TRACKER_CHANGER_NAME, void.class, Visibility.PUBLIC ) .defineMethod( EnhancerConstants.TRACKER_CHANGER_NAME, void.class, Visibility.PUBLIC )
.withParameters( String.class ) .withParameters( String.class )
@ -271,7 +271,7 @@ public class EnhancerImpl implements Enhancer {
.defineField( .defineField(
EnhancerConstants.TRACKER_COMPOSITE_FIELD_NAME, EnhancerConstants.TRACKER_COMPOSITE_FIELD_NAME,
CompositeOwnerTracker.class, CompositeOwnerTracker.class,
FieldManifestation.TRANSIENT, FieldPersistence.TRANSIENT,
Visibility.PRIVATE Visibility.PRIVATE
) )
.annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() ) .annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() )
@ -344,7 +344,7 @@ public class EnhancerImpl implements Enhancer {
String fieldName, String fieldName,
String getterName, String getterName,
String setterName) { String setterName) {
return builder.defineField( fieldName, type, Visibility.PRIVATE, FieldManifestation.TRANSIENT ) return builder.defineField( fieldName, type, Visibility.PRIVATE, FieldPersistence.TRANSIENT )
.annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() ) .annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() )
.defineMethod( getterName, type, Visibility.PUBLIC ) .defineMethod( getterName, type, Visibility.PUBLIC )
.intercept( FieldAccessor.ofField( fieldName ) ) .intercept( FieldAccessor.ofField( fieldName ) )