Skip to content

Commit

Permalink
HHH-11253 Make Byte Buddy BytecodeProvider impl the default
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Mar 2, 2018
1 parent a77c408 commit 0f5c3a0
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ Enable lazy loading feature in runtime bytecode enhancement. This way, even basi
`*hibernate.enhancer.enableAssociationManagement*` (e.g. `true` or `false` (default value))::
Enable association management feature in runtime bytecode enhancement which automatically synchronizes a bidirectional association when only one side is changed.

`*hibernate.bytecode.provider*` (e.g. `javassist` (default value))::
The https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/bytecode/spi/BytecodeProvider.html[`BytecodeProvider`] built-in implementation flavor. Currently, only `javassist` is supported.
`*hibernate.bytecode.provider*` (e.g. `bytebuddy` (default value))::
The https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/bytecode/spi/BytecodeProvider.html[`BytecodeProvider`] built-in implementation flavor. Currently, only `bytebuddy` and `javassist` are valid values.

`*hibernate.bytecode.use_reflection_optimizer*` (e.g. `true` or `false` (default value))::
Should we use reflection optimization? The reflection optimizer implements the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/bytecode/spi/ReflectionOptimizer.html[`ReflectionOptimizer`] interface and improves entity instantiation and property getter/setter calls.
Expand Down
7 changes: 4 additions & 3 deletions hibernate-core/hibernate-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ dependencies {
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

compile( libraries.jpa )
compile( libraries.javassist )
// provided until 6.0 when we make it the default and drop Javassist support
provided( libraries.byteBuddy )
// Not wanting a transitive dependency on javassist anymore as it's not the default anymore:
provided( libraries.javassist )
// Could be made optional?
compile( libraries.byteBuddy )
compile( libraries.antlr )
compile( libraries.jta )
compile( libraries.jandex )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,9 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings {
String CHECK_NULLABILITY = "hibernate.check_nullability";


/**
* Pick which bytecode enhancing library to use. Currently supports javassist and bytebuddy, bytebuddy being the default since version 5.3.
*/
String BYTECODE_PROVIDER = "hibernate.bytecode.provider";

String JPAQL_STRICT_COMPLIANCE= "hibernate.query.jpaql_strict_compliance";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public static String isolationLevelToString(int isolation) {

public static final String BYTECODE_PROVIDER_NAME_JAVASSIST = "javassist";
public static final String BYTECODE_PROVIDER_NAME_BYTEBUDDY = "bytebuddy";
public static final String BYTECODE_PROVIDER_NAME_DEFAULT = BYTECODE_PROVIDER_NAME_JAVASSIST;
public static final String BYTECODE_PROVIDER_NAME_DEFAULT = BYTECODE_PROVIDER_NAME_BYTEBUDDY;

public static BytecodeProvider buildBytecodeProvider(Properties properties) {
String provider = ConfigurationHelper.getString( BYTECODE_PROVIDER, properties, BYTECODE_PROVIDER_NAME_DEFAULT );
Expand Down
1 change: 0 additions & 1 deletion hibernate-entitymanager/hibernate-entitymanager.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies {
compile( libraries.dom4j )
compile( libraries.commons_annotations )
compile( libraries.jpa )
compile( libraries.javassist )
compile( libraries.byteBuddy )
compile( libraries.jta )
}
Expand Down
3 changes: 2 additions & 1 deletion hibernate-envers/hibernate-envers.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ description = 'Hibernate\'s entity version (audit/history) support'

dependencies {
compile( project( ':hibernate-core' ) )
//Ideally javassist should be only an optional dependency but it's currently required by Envers: see HHH-12327
compile( libraries.javassist )

provided( [group: 'org.hibernate', name: 'hibernate-tools', version: '3.2.0.ga'] )
provided( libraries.ant )
provided( project( ':hibernate-jpamodelgen' ) )

testCompile( project( ':hibernate-testing' ) )
testCompile( project( path: ':hibernate-core', configuration: 'tests' ) )
testRuntime( libraries.javassist )
testRuntime( libraries.byteBuddy )
}

Expand Down
1 change: 0 additions & 1 deletion hibernate-spatial/hibernate-spatial.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ dependencies {
testRuntime( libraries.expression_language )

testRuntime('jaxen:jaxen:1.1')
testRuntime(libraries.javassist)
testRuntime(libraries.byteBuddy)
}

Expand Down
1 change: 1 addition & 0 deletions hibernate-testing/hibernate-testing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies {
compile( libraries.byteman )
compile( libraries.byteman_install )
compile( libraries.byteman_bmunit )
compile( libraries.javassist )
compile( libraries.xapool )
compile( libraries.log4j )
compile ( libraries.jboss_jta ) {
Expand Down

0 comments on commit 0f5c3a0

Please sign in to comment.