Don't use `==` when comparing strings
Fix a few places where `==` was accidentally used to compare strings. Issue: SPR-16968
This commit is contained in:
parent
13729364ab
commit
be85bd8e09
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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);
|
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generateCode(MethodVisitor mv, CodeFlow cf) {
|
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.visitTypeInsn(NEW, "java/lang/StringBuilder");
|
||||||
mv.visitInsn(DUP);
|
mv.visitInsn(DUP);
|
||||||
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder", "<init>", "()V", false);
|
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder", "<init>", "()V", false);
|
||||||
|
@ -236,12 +236,12 @@ public class OpPlus extends Operator {
|
||||||
case 'J':
|
case 'J':
|
||||||
mv.visitInsn(LADD);
|
mv.visitInsn(LADD);
|
||||||
break;
|
break;
|
||||||
case 'F':
|
case 'F':
|
||||||
mv.visitInsn(FADD);
|
mv.visitInsn(FADD);
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
mv.visitInsn(DADD);
|
mv.visitInsn(DADD);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Unrecognized exit type descriptor: '" + this.exitTypeDescriptor + "'");
|
"Unrecognized exit type descriptor: '" + this.exitTypeDescriptor + "'");
|
||||||
|
|
Loading…
Reference in New Issue