diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/ast/OpPlus.java b/spring-expression/src/main/java/org/springframework/expression/spel/ast/OpPlus.java index b5f752ca48..fdcb21675a 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/ast/OpPlus.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/ast/OpPlus.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -205,10 +205,10 @@ public class OpPlus extends Operator { mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false); } } - + @Override public void generateCode(MethodVisitor mv, CodeFlow cf) { - if (this.exitTypeDescriptor == "Ljava/lang/String") { + if ("Ljava/lang/String".equals(this.exitTypeDescriptor)) { mv.visitTypeInsn(NEW, "java/lang/StringBuilder"); mv.visitInsn(DUP); mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder", "", "()V", false); @@ -236,12 +236,12 @@ public class OpPlus extends Operator { case 'J': mv.visitInsn(LADD); break; - case 'F': + case 'F': mv.visitInsn(FADD); break; case 'D': mv.visitInsn(DADD); - break; + break; default: throw new IllegalStateException( "Unrecognized exit type descriptor: '" + this.exitTypeDescriptor + "'");