From cdcd6bfe76e5fed989ff5734c617076bdddd2bfb Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Fri, 5 Jul 2019 16:22:49 +0100 Subject: [PATCH] HHH-13496 Review string appending styles --- .../internal/javassist/PersistentAttributesEnhancer.java | 2 +- .../hibernate/cfg/CopyIdentifierComponentSecondPass.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/PersistentAttributesEnhancer.java b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/PersistentAttributesEnhancer.java index e33d8a47f2..7d9b1d3f16 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/PersistentAttributesEnhancer.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/PersistentAttributesEnhancer.java @@ -162,7 +162,7 @@ public class PersistentAttributesEnhancer extends EnhancerImpl { try { boolean declared = persistentField.getDeclaringClass().equals( managedCtClass ); - String declaredReadFragment = "this." + fieldName + ""; + String declaredReadFragment = "this." + fieldName; String superReadFragment = "super." + readerName + "()"; if ( !declared ) { diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/CopyIdentifierComponentSecondPass.java b/hibernate-core/src/main/java/org/hibernate/cfg/CopyIdentifierComponentSecondPass.java index 69a628eb08..b6a1795c05 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/CopyIdentifierComponentSecondPass.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/CopyIdentifierComponentSecondPass.java @@ -79,8 +79,8 @@ public class CopyIdentifierComponentSecondPass implements SecondPass { AtomicInteger index = new AtomicInteger( 0 ); if ( columnByReferencedName.isEmpty() ) { isExplicitReference = false; - for (Ejb3JoinColumn joinColumn : joinColumns) { - columnByReferencedName.put( "" + index.get(), joinColumn ); + for ( Ejb3JoinColumn joinColumn : joinColumns ) { + columnByReferencedName.put( String.valueOf( index.get() ), joinColumn ); index.getAndIncrement(); } index.set( 0 ); @@ -184,7 +184,7 @@ public class CopyIdentifierComponentSecondPass implements SecondPass { joinColumn = columnByReferencedName.get( logicalColumnName.toLowerCase(Locale.ROOT ) ); } else { - joinColumn = columnByReferencedName.get( "" + index.get() ); + joinColumn = columnByReferencedName.get( String.valueOf( index.get() ) ); index.getAndIncrement(); } if ( joinColumn == null && ! joinColumns[0].isNameDeferred() ) {