fix type detect on arrays

fix https://github.com/pxb1988/dex2jar/issues/28
This commit is contained in:
Bob Pan 2016-03-04 19:55:13 +08:00
parent d9baaa5779
commit 0d48e49275
2 changed files with 498 additions and 428 deletions

View File

@ -0,0 +1,29 @@
package res;
import java.lang.reflect.Array;
/**
* https://github.com/pxb1988/dex2jar/issues/28
*/
public class Gh28Type {
protected void onCreate() {
double t0[] = new double[1];
t0[0] = 0;
double t1[] = (double[]) Array.newInstance(Double.TYPE, 1);
t1[0] = 0;
double t2[][] = new double[1][1];
t2[0][0] = 0; // incorrectly translated to 0L (long) rather than 0.0 (double)
double t3[][] = (double[][]) Array.newInstance(Double.TYPE, 1, 1);
t3[0][0] = 0; // incorrectly translated to 0L (long) rather than 0.0 (double)
a(t0);
a(t1);
a(t2[0]);
a(t3[0]);
}
private void a(double[] t0) {
// Just to avoid optimization of unused local variables in onCreate here above
}
}