Bug 63 : weaving tables with many fields results in NegativeArraySizeException
Priority 
High
Reported Version 
 
Logged By 
imario
Status 
Fixed
Fixed Version 
1.0.3
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
14/02/2009
Updated 
14/02/2009
Type 
Bug
 
Attachments 
No attachments

... due to the fact that the weaving process will put the array size as byte on the stack. I changed this to short and now weaving started to work.

BTW: I know, having tables with that much fields is a bad thing, but I have to deal with this legacy database anyway :-(


Index: ../ebean/src/com/avaje/ebean/enhance/agent/IndexFieldWeaver.java
===================================================================
--- ../ebean/src/com/avaje/ebean/enhance/agent/IndexFieldWeaver.java (revision 127)
+++ ../ebean/src/com/avaje/ebean/enhance/agent/IndexFieldWeaver.java Fri Feb 13 21:43:32 CET 2009
@@ -381,7 +381,7 @@
mv.visitInsn(ICONST_5);
break;
default:
- mv.visitIntInsn(BIPUSH, value);
+ mv.visitIntInsn(SIPUSH, value);
}
}
}

 
Rob 16 Feb 07:26
Limit of 127 properties for a given entity

Yes, nice bug. I have instead gone with a slight adjustment of:

default:
if (value <= Byte.MAX_VALUE){
mv.visitIntInsn(BIPUSH, value);
} else {
mv.visitIntInsn(SIPUSH, value);
}

... but yes, this would allow more that 127 properties for a given entity.

Rob 16 Feb 07:26
Fixed in v1.0.3

Fixed in v1.0.3

woResponse

Upload a file