vineflower
vineflower copied to clipboard
Variable might not have been initialized
Version: Quiltflower 1.10.0 (commit d43976c4523bf67344ee61366e997ac43f1927ef)
Original code:
public class Example {
private void myMethod() {
Object[] myObjects = new Object[]{};
int[] myInts = new int[]{1, 2, 3};
if (myObjects != null) {
int i;
int myObjectsLength = myObjects.length;
for (i = 0; i < myInts.length; ++i) {
int myInt = myInts[i];
int[] myInts2 = myInts;
int myInts2Length = myInts2.length;
if (myInts2Length != myObjectsLength) {
System.out.println(myInts2Length + " " + myObjectsLength);
}
}
}
}
}
Quiltflower output:
public class Example {
private void myMethod() {
Object[] myObjects = new Object[0];
int[] myInts = new int[]{1, 2, 3};
if (myObjects != null) {
for (int myInt : myObjects) {
int myInts2Length = myInts.length;
byte myObjectsLength;
if (myInts2Length != myObjectsLength) {
System.out.println(myInts2Length + " " + myObjectsLength);
}
}
}
}
}
The output results in these errors:
Incompatible types. Found: 'int', required: 'java.lang.Object'
Variable 'myObjectsLength' might not have been initialized