|
|
|
|
|
|
|
|
CtClass cc = sloader.makeClass("TooManyConstPoolItems"); |
|
|
CtClass cc = sloader.makeClass("TooManyConstPoolItems"); |
|
|
ClassFile cf = cc.getClassFile(); |
|
|
ClassFile cf = cc.getClassFile(); |
|
|
ConstPool cPool = cf.getConstPool(); |
|
|
ConstPool cPool = cf.getConstPool(); |
|
|
for (int i = 0; i <= 65527; i++) |
|
|
|
|
|
cPool.addIntegerInfo(i); |
|
|
|
|
|
|
|
|
int size = cPool.getSize(); |
|
|
|
|
|
while (cPool.getSize() < 65536 - 6) |
|
|
|
|
|
cPool.addIntegerInfo(cPool.getSize()); |
|
|
|
|
|
|
|
|
|
|
|
cc.writeFile(); |
|
|
|
|
|
cc.defrost(); |
|
|
|
|
|
cPool.addIntegerInfo(-1); |
|
|
try { |
|
|
try { |
|
|
cc.writeFile(); |
|
|
cc.writeFile(); |
|
|
fail("too many items were accepted"); |
|
|
fail("too many items were accepted"); |