From ce815006d23891cc4eb7b098fe00fa51114a684f Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Tue, 18 Mar 2025 12:44:01 +0100 Subject: [PATCH] Generate compiled SpEL expressions using Java 17 byte code level Closes gh-34602 --- .../expression/spel/standard/SpelCompiler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java b/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java index 39e563e0a3d..1b37c1e887b 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -138,7 +138,7 @@ public final class SpelCompiler implements Opcodes { String className = "org/springframework/expression/spel/generated/CompiledExpression" + getNextSuffix(); String evaluationContextClass = "org/springframework/expression/EvaluationContext"; ClassWriter cw = new ExpressionClassWriter(); - cw.visit(V1_8, ACC_PUBLIC, className, null, "org/springframework/expression/spel/CompiledExpression", null); + cw.visit(V17, ACC_PUBLIC, className, null, "org/springframework/expression/spel/CompiledExpression", null); // Create default constructor MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null);