Allow spring-expression to be more easily repackaged
This commit allows the spring-expression module to be more easily repackaged for embedding in third-party JARs -- for example, via the Shadow Gradle plugin. Closes gh-26779
This commit is contained in:
committed by
GitHub
parent
f7606ba51b
commit
432c720dd0
@@ -136,6 +136,7 @@ public final class SpelCompiler implements Opcodes {
|
||||
private Class<? extends CompiledExpression> createExpressionClass(SpelNodeImpl expressionToCompile) {
|
||||
// Create class outline 'spel/ExNNN extends org.springframework.expression.spel.CompiledExpression'
|
||||
String className = "spel/Ex" + 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);
|
||||
|
||||
@@ -151,7 +152,7 @@ public final class SpelCompiler implements Opcodes {
|
||||
|
||||
// Create getValue() method
|
||||
mv = cw.visitMethod(ACC_PUBLIC, "getValue",
|
||||
"(Ljava/lang/Object;Lorg/springframework/expression/EvaluationContext;)Ljava/lang/Object;", null,
|
||||
"(Ljava/lang/Object;L" + evaluationContextClass + ";)Ljava/lang/Object;", null,
|
||||
new String[] {"org/springframework/expression/EvaluationException"});
|
||||
mv.visitCode();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user