removed unneeded boxing

This commit is contained in:
Egor.Ushakov
2017-04-25 19:15:59 +03:00
parent a62cc3f709
commit 7575bb57de
12 changed files with 53 additions and 53 deletions

View File

@@ -313,16 +313,16 @@ public class ExprProcessor implements CodeConstants {
break;
case opc_lconst_0:
case opc_lconst_1:
pushEx(stack, exprlist, new ConstExprent(VarType.VARTYPE_LONG, new Long(instr.opcode - opc_lconst_0), bytecode_offsets));
pushEx(stack, exprlist, new ConstExprent(VarType.VARTYPE_LONG, Long.valueOf(instr.opcode - opc_lconst_0), bytecode_offsets));
break;
case opc_fconst_0:
case opc_fconst_1:
case opc_fconst_2:
pushEx(stack, exprlist, new ConstExprent(VarType.VARTYPE_FLOAT, new Float(instr.opcode - opc_fconst_0), bytecode_offsets));
pushEx(stack, exprlist, new ConstExprent(VarType.VARTYPE_FLOAT, Float.valueOf(instr.opcode - opc_fconst_0), bytecode_offsets));
break;
case opc_dconst_0:
case opc_dconst_1:
pushEx(stack, exprlist, new ConstExprent(VarType.VARTYPE_DOUBLE, new Double(instr.opcode - opc_dconst_0), bytecode_offsets));
pushEx(stack, exprlist, new ConstExprent(VarType.VARTYPE_DOUBLE, Double.valueOf(instr.opcode - opc_dconst_0), bytecode_offsets));
break;
case opc_ldc:
case opc_ldc_w:
@@ -840,13 +840,13 @@ public class ExprProcessor implements CodeConstants {
defaultVal = new ConstExprent(VarType.VARTYPE_NULL, null, null);
}
else if (arrType.type == CodeConstants.TYPE_FLOAT) {
defaultVal = new ConstExprent(VarType.VARTYPE_FLOAT, new Float(0), null);
defaultVal = new ConstExprent(VarType.VARTYPE_FLOAT, Float.valueOf(0), null);
}
else if (arrType.type == CodeConstants.TYPE_LONG) {
defaultVal = new ConstExprent(VarType.VARTYPE_LONG, new Long(0), null);
defaultVal = new ConstExprent(VarType.VARTYPE_LONG, Long.valueOf(0), null);
}
else if (arrType.type == CodeConstants.TYPE_DOUBLE) {
defaultVal = new ConstExprent(VarType.VARTYPE_DOUBLE, new Double(0), null);
defaultVal = new ConstExprent(VarType.VARTYPE_DOUBLE, Double.valueOf(0), null);
}
else { // integer types
defaultVal = new ConstExprent(0, true, null);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -744,7 +744,7 @@ public class IfHelper {
public void addChild(IfNode child, int type) {
succs.add(child);
edgetypes.add(new Integer(type));
edgetypes.add(type);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -262,10 +262,10 @@ public class SecondaryFunctionsHelper {
if (lstOperands.get(0).type == Exprent.EXPRENT_CONST) {
int val = ((ConstExprent)lstOperands.get(0)).getIntValue();
if (val == 0) {
return new ConstExprent(VarType.VARTYPE_BOOLEAN, new Integer(1), fexpr.bytecode);
return new ConstExprent(VarType.VARTYPE_BOOLEAN, Integer.valueOf(1), fexpr.bytecode);
}
else {
return new ConstExprent(VarType.VARTYPE_BOOLEAN, new Integer(0), fexpr.bytecode);
return new ConstExprent(VarType.VARTYPE_BOOLEAN, Integer.valueOf(0), fexpr.bytecode);
}
}
break;
@@ -300,8 +300,8 @@ public class SecondaryFunctionsHelper {
FunctionExprent iff = new FunctionExprent(FunctionExprent.FUNCTION_IIF, Arrays.asList(
new FunctionExprent(FunctionExprent.FUNCTION_LT, Arrays.asList(new VarExprent(var, type, varProc),
ConstExprent.getZeroConstant(type.type)), null),
new ConstExprent(VarType.VARTYPE_INT, new Integer(-1), null),
new ConstExprent(VarType.VARTYPE_INT, new Integer(1), null)), null);
new ConstExprent(VarType.VARTYPE_INT, Integer.valueOf(-1), null),
new ConstExprent(VarType.VARTYPE_INT, Integer.valueOf(1), null)), null);
FunctionExprent head = new FunctionExprent(FunctionExprent.FUNCTION_EQ, Arrays.asList(
new AssignmentExprent(new VarExprent(var, type, varProc),
@@ -312,7 +312,7 @@ public class SecondaryFunctionsHelper {
varProc.setVarType(new VarVersionPair(var, 0), type);
return new FunctionExprent(FunctionExprent.FUNCTION_IIF, Arrays.asList(
head, new ConstExprent(VarType.VARTYPE_INT, new Integer(0), null), iff), fexpr.bytecode);
head, new ConstExprent(VarType.VARTYPE_INT, Integer.valueOf(0), null), iff), fexpr.bytecode);
}
break;
case Exprent.EXPRENT_ASSIGNMENT: // check for conditional assignment

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -157,14 +157,14 @@ public class DominatorTreeExceptionFilter {
if (range.contains(id)) {
Integer exit = null;
Integer exit;
if (!range.contains(childid)) {
exit = childid;
}
else {
// exit = map.containsKey(handler)?-1:mapChild.get(handler); FIXME: Eclipse bug?
exit = map.containsKey(handler) ? new Integer(-1) : mapChild.get(handler);
exit = map.containsKey(handler) ? -1 : mapChild.get(handler);
}
if (exit != null) {

View File

@@ -36,14 +36,14 @@ public class ConstExprent extends Exprent {
private static final Map<Integer, String> CHAR_ESCAPES;
static {
CHAR_ESCAPES = new HashMap<>();
CHAR_ESCAPES.put(new Integer(0x8), "\\b"); /* \u0008: backspace BS */
CHAR_ESCAPES.put(new Integer(0x9), "\\t"); /* \u0009: horizontal tab HT */
CHAR_ESCAPES.put(new Integer(0xA), "\\n"); /* \u000a: linefeed LF */
CHAR_ESCAPES.put(new Integer(0xC), "\\f"); /* \u000c: form feed FF */
CHAR_ESCAPES.put(new Integer(0xD), "\\r"); /* \u000d: carriage return CR */
//CHAR_ESCAPES.put(new Integer(0x22), "\\\""); /* \u0022: double quote " */
CHAR_ESCAPES.put(new Integer(0x27), "\\\'"); /* \u0027: single quote ' */
CHAR_ESCAPES.put(new Integer(0x5C), "\\\\"); /* \u005c: backslash \ */
CHAR_ESCAPES.put(0x8, "\\b"); /* \u0008: backspace BS */
CHAR_ESCAPES.put(0x9, "\\t"); /* \u0009: horizontal tab HT */
CHAR_ESCAPES.put(0xA, "\\n"); /* \u000a: linefeed LF */
CHAR_ESCAPES.put(0xC, "\\f"); /* \u000c: form feed FF */
CHAR_ESCAPES.put(0xD, "\\r"); /* \u000d: carriage return CR */
//CHAR_ESCAPES.put(0x22, "\\\""); /* \u0022: double quote " */
CHAR_ESCAPES.put(0x27, "\\\'"); /* \u0027: single quote ' */
CHAR_ESCAPES.put(0x5C, "\\\\"); /* \u005c: backslash \ */
}
private VarType constType;
@@ -51,7 +51,7 @@ public class ConstExprent extends Exprent {
private final boolean boolPermitted;
public ConstExprent(int val, boolean boolPermitted, Set<Integer> bytecodeOffsets) {
this(guessType(val, boolPermitted), new Integer(val), boolPermitted, bytecodeOffsets);
this(guessType(val, boolPermitted), Integer.valueOf(val), boolPermitted, bytecodeOffsets);
}
public ConstExprent(VarType constType, Object value, Set<Integer> bytecodeOffsets) {
@@ -347,13 +347,13 @@ public class ConstExprent extends Exprent {
public static ConstExprent getZeroConstant(int type) {
switch (type) {
case CodeConstants.TYPE_INT:
return new ConstExprent(VarType.VARTYPE_INT, new Integer(0), null);
return new ConstExprent(VarType.VARTYPE_INT, Integer.valueOf(0), null);
case CodeConstants.TYPE_LONG:
return new ConstExprent(VarType.VARTYPE_LONG, new Long(0), null);
return new ConstExprent(VarType.VARTYPE_LONG, Long.valueOf(0), null);
case CodeConstants.TYPE_DOUBLE:
return new ConstExprent(VarType.VARTYPE_DOUBLE, new Double(0), null);
return new ConstExprent(VarType.VARTYPE_DOUBLE, Double.valueOf(0), null);
case CodeConstants.TYPE_FLOAT:
return new ConstExprent(VarType.VARTYPE_FLOAT, new Float(0), null);
return new ConstExprent(VarType.VARTYPE_FLOAT, Float.valueOf(0), null);
}
throw new RuntimeException("Invalid argument: " + type);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -288,10 +288,10 @@ public class SSAConstructorSparseEx {
private Integer getNextFreeVersion(Integer var) {
Integer nextver = lastversion.get(var);
if (nextver == null) {
nextver = new Integer(1);
nextver = 1;
}
else {
nextver = new Integer(nextver.intValue() + 1);
nextver++;
}
lastversion.put(var, nextver);
return nextver;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -501,10 +501,10 @@ public class SSAUConstructorSparseEx {
Integer nextver = lastversion.get(var);
if (nextver == null) {
nextver = new Integer(1);
nextver = 1;
}
else {
nextver = new Integer(nextver.intValue() + 1);
nextver++;
}
lastversion.put(var, nextver);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -289,9 +289,9 @@ public class VarDefinitionHelper {
for (Integer index : childVars) {
Integer count = mapCount.get(index);
if (count == null) {
count = new Integer(0);
count = 0;
}
mapCount.put(index, new Integer(count.intValue() + 1));
mapCount.put(index, count + 1);
}
condlst = getAllVars(currVars);
@@ -302,7 +302,7 @@ public class VarDefinitionHelper {
// this statement
for (VarExprent var : condlst) {
mapCount.put(new Integer(var.getIndex()), new Integer(2));
mapCount.put(var.getIndex(), 2);
}

View File

@@ -74,7 +74,7 @@ public class VarProcessor {
}
Integer counter = mapNames.get(name);
mapNames.put(name, counter == null ? counter = new Integer(0) : ++counter);
mapNames.put(name, counter == null ? counter = 0 : ++counter);
if (counter > 0) {
name += String.valueOf(counter);