From 178eb17191630a0d4f84773c71ff3f41d1aee016 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 31 Aug 2026 10:52:35 +0200 Subject: [PATCH 1/2] Remove lock around transform step Closes gh-37199 --- .../ClassFileTransformerAdapter.java | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/ClassFileTransformerAdapter.java b/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/ClassFileTransformerAdapter.java index 46b56d5364d..3f95f2d4681 100644 --- a/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/ClassFileTransformerAdapter.java +++ b/spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/ClassFileTransformerAdapter.java @@ -57,42 +57,40 @@ class ClassFileTransformerAdapter implements ClassFileTransformer { ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) { - synchronized (this) { - if (this.currentlyTransforming.get() == Boolean.TRUE) { - // Defensively back out when called from within the transform delegate below: - // in particular, for the over-eager transformer implementation in Hibernate. - return null; - } + if (this.currentlyTransforming.get() == Boolean.TRUE) { + // Defensively back out when called from within the transform delegate below: + // in particular, for the over-eager transformer implementation in Hibernate. + return null; + } - this.currentlyTransforming.set(Boolean.TRUE); - try { - byte[] transformed = this.classTransformer.transform( - loader, className, classBeingRedefined, protectionDomain, classfileBuffer); - if (transformed != null && logger.isDebugEnabled()) { - logger.debug("Transformer of class [" + this.classTransformer.getClass().getName() + - "] transformed class [" + className + "]; bytes in=" + - classfileBuffer.length + "; bytes out=" + transformed.length); - } - return transformed; + this.currentlyTransforming.set(Boolean.TRUE); + try { + byte[] transformed = this.classTransformer.transform( + loader, className, classBeingRedefined, protectionDomain, classfileBuffer); + if (transformed != null && logger.isDebugEnabled()) { + logger.debug("Transformer of class [" + this.classTransformer.getClass().getName() + + "] transformed class [" + className + "]; bytes in=" + + classfileBuffer.length + "; bytes out=" + transformed.length); } - catch (ClassCircularityError ex) { - if (logger.isErrorEnabled()) { - logger.error("Circularity error while weaving class [" + className + "] with " + - "transformer of class [" + this.classTransformer.getClass().getName() + "]", ex); - } - throw new IllegalStateException("Failed to weave class [" + className + "]", ex); + return transformed; + } + catch (ClassCircularityError ex) { + if (logger.isErrorEnabled()) { + logger.error("Circularity error while weaving class [" + className + "] with " + + "transformer of class [" + this.classTransformer.getClass().getName() + "]", ex); } - catch (Throwable ex) { - if (logger.isWarnEnabled()) { - logger.warn("Error weaving class [" + className + "] with transformer of class [" + - this.classTransformer.getClass().getName() + "]", ex); - } - // The exception will be ignored by the class loader, anyway... - throw new IllegalStateException("Could not weave class [" + className + "]", ex); - } - finally { - this.currentlyTransforming.remove(); + throw new IllegalStateException("Failed to weave class [" + className + "]", ex); + } + catch (Throwable ex) { + if (logger.isWarnEnabled()) { + logger.warn("Error weaving class [" + className + "] with transformer of class [" + + this.classTransformer.getClass().getName() + "]", ex); } + // The exception will be ignored by the class loader, anyway... + throw new IllegalStateException("Could not weave class [" + className + "]", ex); + } + finally { + this.currentlyTransforming.remove(); } } From 8e783e2ec9e01962613a1760ed0f763d9efc7bbe Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 31 Aug 2026 10:58:06 +0200 Subject: [PATCH 2/2] Upgrade to Checkstyle 14.1 --- .../java/org/springframework/build/CheckstyleConventions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/org/springframework/build/CheckstyleConventions.java b/buildSrc/src/main/java/org/springframework/build/CheckstyleConventions.java index c5819e11899..cb218480280 100644 --- a/buildSrc/src/main/java/org/springframework/build/CheckstyleConventions.java +++ b/buildSrc/src/main/java/org/springframework/build/CheckstyleConventions.java @@ -55,7 +55,7 @@ public class CheckstyleConventions { project.getTasks().withType(Checkstyle.class).forEach(checkstyle -> checkstyle.getMaxHeapSize() .set("checkstyleNohttp".equals(checkstyle.getName()) ? "1536m" : "1g")); CheckstyleExtension checkstyle = project.getExtensions().getByType(CheckstyleExtension.class); - checkstyle.setToolVersion("13.10.0"); + checkstyle.setToolVersion("14.1.0"); checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle")); String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion(); DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies();