error message when constant pool is too big

This commit is contained in:
honfika@gmail.com
2015-07-18 08:23:09 +02:00
parent 0b4ea14a95
commit 35cfe219a4
4 changed files with 22 additions and 2 deletions

View File

@@ -77,8 +77,12 @@ public class ActionConstantPool extends Action {
*/
@Override
protected int getContentBytesLength() {
return calculateSize(constantPool);
}
public static int calculateSize(List<String> strings) {
int res = 2;
for (String s : constantPool) {
for (String s : strings) {
res += Utf8Helper.getBytesLength(s) + 1;
}