changeset 3348:080e6e093a70

8145468: update java.lang APIs with new deprecations Reviewed-by: mcimadamore
author smarks
date Mon, 18 Apr 2016 14:04:09 -0700
parents 8214105024db
children f6848c7b9e45
files src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ConstFold.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
diffstat 4 files changed, 30 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ConstFold.java	Mon Apr 18 22:25:50 2016 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ConstFold.java	Mon Apr 18 14:04:09 2016 -0700
@@ -125,15 +125,15 @@
                 return syms.booleanType.constType(b2i(intValue(od) >= 0));
 
             case lneg: // unary -
-                return syms.longType.constType(new Long(-longValue(od)));
+                return syms.longType.constType(Long.valueOf(-longValue(od)));
             case lxor: // ~
-                return syms.longType.constType(new Long(~longValue(od)));
+                return syms.longType.constType(Long.valueOf(~longValue(od)));
 
             case fneg: // unary -
-                return syms.floatType.constType(new Float(-floatValue(od)));
+                return syms.floatType.constType(Float.valueOf(-floatValue(od)));
 
             case dneg: // ~
-                return syms.doubleType.constType(new Double(-doubleValue(od)));
+                return syms.doubleType.constType(Double.valueOf(-doubleValue(od)));
 
             default:
                 return null;
@@ -216,37 +216,37 @@
 
                 case ladd:
                     return syms.longType.constType(
-                        new Long(longValue(l) + longValue(r)));
+                        Long.valueOf(longValue(l) + longValue(r)));
                 case lsub:
                     return syms.longType.constType(
-                        new Long(longValue(l) - longValue(r)));
+                        Long.valueOf(longValue(l) - longValue(r)));
                 case lmul:
                     return syms.longType.constType(
-                        new Long(longValue(l) * longValue(r)));
+                        Long.valueOf(longValue(l) * longValue(r)));
                 case ldiv:
                     return syms.longType.constType(
-                        new Long(longValue(l) / longValue(r)));
+                        Long.valueOf(longValue(l) / longValue(r)));
                 case lmod:
                     return syms.longType.constType(
-                        new Long(longValue(l) % longValue(r)));
+                        Long.valueOf(longValue(l) % longValue(r)));
                 case land:
                     return syms.longType.constType(
-                        new Long(longValue(l) & longValue(r)));
+                        Long.valueOf(longValue(l) & longValue(r)));
                 case lor:
                     return syms.longType.constType(
-                        new Long(longValue(l) | longValue(r)));
+                        Long.valueOf(longValue(l) | longValue(r)));
                 case lxor:
                     return syms.longType.constType(
-                        new Long(longValue(l) ^ longValue(r)));
+                        Long.valueOf(longValue(l) ^ longValue(r)));
                 case lshl: case lshll:
                     return syms.longType.constType(
-                        new Long(longValue(l) << intValue(r)));
+                        Long.valueOf(longValue(l) << intValue(r)));
                 case lshr: case lshrl:
                     return syms.longType.constType(
-                        new Long(longValue(l) >> intValue(r)));
+                        Long.valueOf(longValue(l) >> intValue(r)));
                 case lushr:
                     return syms.longType.constType(
-                        new Long(longValue(l) >>> intValue(r)));
+                        Long.valueOf(longValue(l) >>> intValue(r)));
                 case lcmp:
                     if (longValue(l) < longValue(r))
                         return syms.intType.constType(minusOne);
@@ -256,19 +256,19 @@
                         return syms.intType.constType(zero);
                 case fadd:
                     return syms.floatType.constType(
-                        new Float(floatValue(l) + floatValue(r)));
+                        Float.valueOf(floatValue(l) + floatValue(r)));
                 case fsub:
                     return syms.floatType.constType(
-                        new Float(floatValue(l) - floatValue(r)));
+                        Float.valueOf(floatValue(l) - floatValue(r)));
                 case fmul:
                     return syms.floatType.constType(
-                        new Float(floatValue(l) * floatValue(r)));
+                        Float.valueOf(floatValue(l) * floatValue(r)));
                 case fdiv:
                     return syms.floatType.constType(
-                        new Float(floatValue(l) / floatValue(r)));
+                        Float.valueOf(floatValue(l) / floatValue(r)));
                 case fmod:
                     return syms.floatType.constType(
-                        new Float(floatValue(l) % floatValue(r)));
+                        Float.valueOf(floatValue(l) % floatValue(r)));
                 case fcmpg: case fcmpl:
                     if (floatValue(l) < floatValue(r))
                         return syms.intType.constType(minusOne);
@@ -282,19 +282,19 @@
                         return syms.intType.constType(minusOne);
                 case dadd:
                     return syms.doubleType.constType(
-                        new Double(doubleValue(l) + doubleValue(r)));
+                        Double.valueOf(doubleValue(l) + doubleValue(r)));
                 case dsub:
                     return syms.doubleType.constType(
-                        new Double(doubleValue(l) - doubleValue(r)));
+                        Double.valueOf(doubleValue(l) - doubleValue(r)));
                 case dmul:
                     return syms.doubleType.constType(
-                        new Double(doubleValue(l) * doubleValue(r)));
+                        Double.valueOf(doubleValue(l) * doubleValue(r)));
                 case ddiv:
                     return syms.doubleType.constType(
-                        new Double(doubleValue(l) / doubleValue(r)));
+                        Double.valueOf(doubleValue(l) / doubleValue(r)));
                 case dmod:
                     return syms.doubleType.constType(
-                        new Double(doubleValue(l) % doubleValue(r)));
+                        Double.valueOf(doubleValue(l) % doubleValue(r)));
                 case dcmpg: case dcmpl:
                     if (doubleValue(l) < doubleValue(r))
                         return syms.intType.constType(minusOne);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Mon Apr 18 22:25:50 2016 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Mon Apr 18 14:04:09 2016 -0700
@@ -457,13 +457,13 @@
             poolObj[i] = getInt(index + 1);
             break;
         case CONSTANT_Float:
-            poolObj[i] = new Float(getFloat(index + 1));
+            poolObj[i] = Float.valueOf(getFloat(index + 1));
             break;
         case CONSTANT_Long:
-            poolObj[i] = new Long(getLong(index + 1));
+            poolObj[i] = Long.valueOf(getLong(index + 1));
             break;
         case CONSTANT_Double:
-            poolObj[i] = new Double(getDouble(index + 1));
+            poolObj[i] = Double.valueOf(getDouble(index + 1));
             break;
         case CONSTANT_MethodHandle:
             skipBytes(4);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Apr 18 22:25:50 2016 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Apr 18 14:04:09 2016 -0700
@@ -203,7 +203,7 @@
      */
     void emitMinusOne(int tc) {
         if (tc == LONGcode) {
-            items.makeImmediateItem(syms.longType, new Long(-1)).load();
+            items.makeImmediateItem(syms.longType, Long.valueOf(-1)).load();
         } else {
             code.emitop0(iconst_m1);
         }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Mon Apr 18 22:25:50 2016 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Mon Apr 18 14:04:09 2016 -0700
@@ -686,7 +686,7 @@
             try {
                 t = F.at(pos).Literal(
                     TypeTag.LONG,
-                    new Long(Convert.string2long(strval(prefix), token.radix())));
+                    Long.valueOf(Convert.string2long(strval(prefix), token.radix())));
             } catch (NumberFormatException ex) {
                 error(token.pos, "int.number.too.large", strval(prefix));
             }