This repository was archived by the owner on Feb 23, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/main/java/scala/tools/asm Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1746,6 +1746,15 @@ private void put(final Item i) {
17461746 items [index ] = i ;
17471747 }
17481748
1749+ /**
1750+ * Find item that whose index is `index`.
1751+ */
1752+ public Item findItemByIndex (int index ) {
1753+ int i = 0 ;
1754+ while (i < items .length && (items [i ] == null || items [i ].index != index )) i ++;
1755+ return items [i ];
1756+ }
1757+
17491758 /**
17501759 * Puts one byte and two shorts into the constant pool.
17511760 *
Original file line number Diff line number Diff line change @@ -2033,7 +2033,10 @@ final int getSize() {
20332033 int size = 8 ;
20342034 if (code .length > 0 ) {
20352035 if (code .length > 65536 ) {
2036- throw new RuntimeException ("Method code too large!" );
2036+ String nameString = "" ;
2037+ Item nameItem = cw .findItemByIndex (name );
2038+ if (nameItem != null ) nameString = nameItem .strVal1 +"'s " ;
2039+ throw new RuntimeException ("Method " + nameString +"code too large!" );
20372040 }
20382041 cw .newUTF8 ("Code" );
20392042 size += 18 + code .length + 8 * handlerCount ;
You can’t perform that action at this time.
0 commit comments