参见英文答案 > “Code too large” compilation error in Java 9个
我正在创建一个应用程序,它在数据库中查找(我目前正在构建).当我收到错误时,我已经完成了超过10/12:代码太大而不能作为Gradle Build消息.
java文件几乎只是一个“数据库”(在另一个类中使用数据).
它具有以下形式:
static int[][] mDatabase10 = new int[][]{{1,11,22},{1,53,42,41,0},{7,34,33,32,0}};
每个阵列阵列中有80个阵列(其中12个):
static int[][][][] dbDatabase = {{mDatabase10,mDatabase10a,mDatabase10b,mDatabase10c,mDatabase10d,mDatabase10e,mDatabase10f,mDatabase10g,mDatabase10h,mDatabase10i,mDatabase10j,mDatabase10k,mDatabase10l,mDatabase10m,mDatabase10n,mDatabase10o,mDatabase10p,mDatabase10q,mDatabase10r,mDatabase10s,mDatabase10t,mDatabase10u,mDatabase10v,mDatabase10w,mDatabase10x,mDatabase10y,mDatabase10z,mDatabase11a,mDatabase11b,mDatabase11c,mDatabase11d,mDatabase11e,mDatabase11f,mDatabase11g,mDatabase11h,mDatabase11i,mDatabase11j,mDatabase11k,mDatabase11l,mDatabase11m,mDatabase11n,mDatabase11o,mDatabase11p,mDatabase11q,mDatabase11r,mDatabase11s,mDatabase11t,mDatabase11u,mDatabase11v,mDatabase11w,mDatabase11x,mDatabase11y,mDatabase11z,mDatabase12a,mDatabase12b,mDatabase12c,mDatabase12d,mDatabase12e,mDatabase12f,mDatabase12g,mDatabase12h,mDatabase12i,mDatabase12j,mDatabase12k,mDatabase12l,mDatabase12m,mDatabase12n,mDatabase12o,mDatabase12p,mDatabase12q,mDatabase12r,mDatabase12s,mDatabase12t,mDatabase12u,mDatabase12v,mDatabase12w,mDatabase12x,mDatabase12y,mDatabase12z,mDatabase13a},{mDatabase20,mDatabase20a,mDatabase20b,mDatabase20c,mDatabase20d,mDatabase20e,mDatabase20f,mDatabase20g,mDatabase20h,mDatabase20i,mDatabase20j,mDatabase20k,mDatabase20l,mDatabase20m,mDatabase20n,mDatabase20o,mDatabase20p,mDatabase20q,mDatabase20r,mDatabase20s,mDatabase20t,mDatabase20u,mDatabase20v,mDatabase20w,mDatabase20x,mDatabase20y,mDatabase20z,mDatabase21a,mDatabase21b,mDatabase21c,mDatabase21d,mDatabase21e,mDatabase21f,mDatabase21g,mDatabase21h,mDatabase21i,mDatabase21j,mDatabase21k,mDatabase21l,mDatabase21m,mDatabase21n,mDatabase21o,mDatabase21p,mDatabase21q,mDatabase21r,mDatabase21s,mDatabase21t,mDatabase21u,mDatabase21v,mDatabase21w,mDatabase21x,mDatabase21y,mDatabase21z,mDatabase22a,mDatabase22b,mDatabase22c,mDatabase22d,mDatabase22e,mDatabase22f,mDatabase22g,mDatabase22h,mDatabase22i,mDatabase22j,mDatabase22k,mDatabase22l,mDatabase22m,mDatabase22n,mDatabase22o,mDatabase22p,mDatabase22q,mDatabase22r,mDatabase22s,mDatabase22t,mDatabase22u,mDatabase22v,mDatabase22w,mDatabase22x,mDatabase22y,mDatabase22z,mDatabase23a},//so on until mDatabase123a...
最后有一个函数将请求的数组返回给另一个类.
public static int[][] Chordlookup(int chordpart1,int chordpart2){
return dbDatabase[chordpart1-1][chordpart2-1];
}
现在从我理解在互联网上阅读这个问题,它与database.java类太大有关.我怎么解决这个问题?
我很乐意接受建议,因为我对java不太熟悉……
编辑:
对代码的作用进行了一些描述:
每个mDatabase是一个和弦(例如Cm7)
每组6个整数是一个发挥该和弦的位置:
{1,22}
有些和弦可能有其中一种,有些有更多.
然后在dbDatabase中,每个块(mDatabaseX0到mDatabaseX3a)都是根(如A,B,C,D,E,F,G)
最佳答案
原文链接:/android/431212.html