Skip to content

Commit da4bbaa

Browse files
committed
Replace deprecated constructor calls on Integer/Long/...
1 parent 52a9b6a commit da4bbaa

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
443443
"serialVersionUID",
444444
"J",
445445
null, // no java-generic-signature
446-
new java.lang.Long(id)
446+
java.lang.Long.valueOf(id)
447447
).visitEnd()
448448
}
449449
} // end of trait BCClassGen

src/compiler/scala/tools/nsc/backend/jvm/BCodeIdiomatic.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ trait BCodeIdiomatic {
136136
emit(Opcodes.ICONST_M1)
137137
emit(Opcodes.IXOR)
138138
} else if (kind == LONG) {
139-
jmethod.visitLdcInsn(new java.lang.Long(-1))
139+
jmethod.visitLdcInsn(java.lang.Long.valueOf(-1))
140140
jmethod.visitInsn(Opcodes.LXOR)
141141
} else {
142142
abort(s"Impossible to negate an $kind")
@@ -325,7 +325,7 @@ trait BCodeIdiomatic {
325325
} else if (cst >= java.lang.Short.MIN_VALUE && cst <= java.lang.Short.MAX_VALUE) {
326326
jmethod.visitIntInsn(Opcodes.SIPUSH, cst)
327327
} else {
328-
jmethod.visitLdcInsn(new Integer(cst))
328+
jmethod.visitLdcInsn(Integer.valueOf(cst))
329329
}
330330
}
331331

@@ -334,7 +334,7 @@ trait BCodeIdiomatic {
334334
if (cst == 0L || cst == 1L) {
335335
emit(Opcodes.LCONST_0 + cst.asInstanceOf[Int])
336336
} else {
337-
jmethod.visitLdcInsn(new java.lang.Long(cst))
337+
jmethod.visitLdcInsn(java.lang.Long.valueOf(cst))
338338
}
339339
}
340340

@@ -344,7 +344,7 @@ trait BCodeIdiomatic {
344344
if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2
345345
emit(Opcodes.FCONST_0 + cst.asInstanceOf[Int])
346346
} else {
347-
jmethod.visitLdcInsn(new java.lang.Float(cst))
347+
jmethod.visitLdcInsn(java.lang.Float.valueOf(cst))
348348
}
349349
}
350350

@@ -354,7 +354,7 @@ trait BCodeIdiomatic {
354354
if (bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d
355355
emit(Opcodes.DCONST_0 + cst.asInstanceOf[Int])
356356
} else {
357-
jmethod.visitLdcInsn(new java.lang.Double(cst))
357+
jmethod.visitLdcInsn(java.lang.Double.valueOf(cst))
358358
}
359359
}
360360

src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self =>
15851585
if (cst == 0L || cst == 1L) {
15861586
jmethod.visitInsn(Opcodes.LCONST_0 + cst.asInstanceOf[Int])
15871587
} else {
1588-
jmethod.visitLdcInsn(new java.lang.Long(cst))
1588+
jmethod.visitLdcInsn(java.lang.Long.valueOf(cst))
15891589
}
15901590
}
15911591

@@ -2567,7 +2567,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self =>
25672567
emit(Opcodes.ICONST_M1)
25682568
emit(Opcodes.IXOR)
25692569
} else if(kind == LONG) {
2570-
jmethod.visitLdcInsn(new java.lang.Long(-1))
2570+
jmethod.visitLdcInsn(java.lang.Long.valueOf(-1))
25712571
jmethod.visitInsn(Opcodes.LXOR)
25722572
} else {
25732573
abort("Impossible to negate an " + kind)

0 commit comments

Comments
 (0)