[PATCH] [Fernflower] prevent null to be cast as short/byte
This commit is contained in:
committed by
Egor Ushakov
parent
e7854376b8
commit
c241278aee
BIN
testData/classes/pkg/TestPrimitiveNarrowing.class
Normal file
BIN
testData/classes/pkg/TestPrimitiveNarrowing.class
Normal file
Binary file not shown.
64
testData/results/TestPrimitiveNarrowing.dec
Normal file
64
testData/results/TestPrimitiveNarrowing.dec
Normal file
@@ -0,0 +1,64 @@
|
||||
package pkg;
|
||||
|
||||
class TestPrimitiveNarrowing {
|
||||
TestPrimitiveNarrowing(Short value) {
|
||||
}// 6
|
||||
|
||||
static void invocations() {
|
||||
withInteger((Integer)null);// 9
|
||||
withShort((Short)null);// 10
|
||||
withByte((Byte)null);// 11
|
||||
new TestPrimitiveNarrowing((Short)null);// 12
|
||||
}// 13
|
||||
|
||||
static void withByte(Byte defaultValue) {
|
||||
}// 16
|
||||
|
||||
static void withInteger(Integer defaultValue) {
|
||||
}// 19
|
||||
|
||||
static void withShort(Short defaultValue) {
|
||||
}// 22
|
||||
}
|
||||
|
||||
class 'pkg/TestPrimitiveNarrowing' {
|
||||
method '<init> (Ljava/lang/Short;)V' {
|
||||
4 4
|
||||
}
|
||||
|
||||
method 'invocations ()V' {
|
||||
0 7
|
||||
1 7
|
||||
4 8
|
||||
5 8
|
||||
8 9
|
||||
9 9
|
||||
10 10
|
||||
15 11
|
||||
}
|
||||
|
||||
method 'withByte (Ljava/lang/Byte;)V' {
|
||||
0 14
|
||||
}
|
||||
|
||||
method 'withInteger (Ljava/lang/Integer;)V' {
|
||||
0 17
|
||||
}
|
||||
|
||||
method 'withShort (Ljava/lang/Short;)V' {
|
||||
0 20
|
||||
}
|
||||
}
|
||||
|
||||
Lines mapping:
|
||||
6 <-> 5
|
||||
9 <-> 8
|
||||
10 <-> 9
|
||||
11 <-> 10
|
||||
12 <-> 11
|
||||
13 <-> 12
|
||||
16 <-> 15
|
||||
19 <-> 18
|
||||
22 <-> 21
|
||||
Not mapped:
|
||||
5
|
||||
24
testData/src/pkg/TestPrimitiveNarrowing.java
Normal file
24
testData/src/pkg/TestPrimitiveNarrowing.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package pkg;
|
||||
|
||||
class TestPrimitiveNarrowing {
|
||||
|
||||
TestPrimitiveNarrowing(Short value) {
|
||||
}
|
||||
|
||||
static void invocations() {
|
||||
withInteger(null);
|
||||
withShort(null);
|
||||
withByte(null);
|
||||
new TestPrimitiveNarrowing(null);
|
||||
}
|
||||
|
||||
static void withByte(Byte defaultValue) {
|
||||
}
|
||||
|
||||
static void withInteger(Integer defaultValue) {
|
||||
}
|
||||
|
||||
static void withShort(Short defaultValue) {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user