From 0c17ef47b3656ccb071cd17b8299c1a7e188a136 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Wed, 14 Feb 2018 16:43:17 +0000 Subject: [PATCH] HHH-12296 Upgrade to Byte Buddy 1.7.10 to support JDK10 --- gradle/libraries.gradle | 2 +- .../enhance/internal/bytebuddy/EnhancerImpl.java | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gradle/libraries.gradle b/gradle/libraries.gradle index a628b55db2..aa0567dcf5 100644 --- a/gradle/libraries.gradle +++ b/gradle/libraries.gradle @@ -23,7 +23,7 @@ ext { weldVersion = '3.0.0.Final' 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 wildflyVersion = '11.0.0.Final' diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/EnhancerImpl.java b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/EnhancerImpl.java index ef980e3f0c..26b68e2de2 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/EnhancerImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/bytebuddy/EnhancerImpl.java @@ -45,7 +45,7 @@ import net.bytebuddy.description.annotation.AnnotationDescription; import net.bytebuddy.description.field.FieldDescription; import net.bytebuddy.description.method.MethodDescription; 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.type.TypeDefinition; import net.bytebuddy.description.type.TypeDescription; @@ -165,7 +165,7 @@ public class EnhancerImpl implements Enhancer { if ( enhancementContext.doDirtyCheckingInline( managedCtClass ) ) { if ( collectCollectionFields( managedCtClass ).isEmpty() ) { 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() ) .defineMethod( EnhancerConstants.TRACKER_CHANGER_NAME, void.class, Visibility.PUBLIC ) .withParameters( String.class ) @@ -184,9 +184,9 @@ public class EnhancerImpl implements Enhancer { } else { 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() ) - .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() ) .defineMethod( EnhancerConstants.TRACKER_CHANGER_NAME, void.class, Visibility.PUBLIC ) .withParameters( String.class ) @@ -271,7 +271,7 @@ public class EnhancerImpl implements Enhancer { .defineField( EnhancerConstants.TRACKER_COMPOSITE_FIELD_NAME, CompositeOwnerTracker.class, - FieldManifestation.TRANSIENT, + FieldPersistence.TRANSIENT, Visibility.PRIVATE ) .annotateField( AnnotationDescription.Builder.ofType( Transient.class ).build() ) @@ -344,7 +344,7 @@ public class EnhancerImpl implements Enhancer { String fieldName, String getterName, 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() ) .defineMethod( getterName, type, Visibility.PUBLIC ) .intercept( FieldAccessor.ofField( fieldName ) )