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 @@ -1781,6 +1781,15 @@ private void put(final Item i) {
17811781 items [index ] = i ;
17821782 }
17831783
1784+ /**
1785+ * Find item that whose index is `index`.
1786+ */
1787+ public Item findItemByIndex (int index ) {
1788+ int i = 0 ;
1789+ while (i < items .length && (items [i ] == null || items [i ].index != index )) i ++;
1790+ return items [i ];
1791+ }
1792+
17841793 /**
17851794 * Puts one byte and two shorts into the constant pool.
17861795 *
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 > 65535 ) {
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