Dalibor Topic wrote:
On 9/1/11 1:11 PM, Joe Darcy wrote:
Hello.

I hereby request approval to backport a trio of signature parsing fixes from 
JDK 8 to 7 update:

   6476261: (reflect) GenericSignatureFormatError When signature includes 
nested inner classes
   http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6476261

   6832374: (reflect) malformed signature can cause parser to go into infinite 
loop
   http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6832374

   7052898: (reflect) SignatureParser will accept strings outside of the grammar
   http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7052898

Unfortunately, the last bug comes up as not available for me. Could you 
describe it in your own words,
and let us know whether this is a regression, and what its priority is?

Sure; the legal syntax for a throws clause is a proper subset of the full FieldTypeSignature production. The old code did not make that distinction, improperly allowing arrays in the throws section. The new code fixes this issue by adding a b0olean argument in parseFieldTypeSignature(boolean allowArrays). The problem is not a regression, but is is included as a unit with the other two fixes.

   Webrev:
   http://cr.openjdk.java.net/~darcy/6476261.0/

The code for 7 update is trivially different than the code for JDK 8 since the 
JDK 8 code takes advantage of a new constructor added to 
GenericSignatureFormatError; here is the diff to SignatureParser.java:

123,126c123,124
<         if (DEBUG)
<             System.out.println("Signature Parse error: " + errorMsg +
<                                "\n\tRemaining input: " + remainder());
<         return new GenericSignatureFormatError();
---
        return new GenericSignatureFormatError("Signature Parse error: " + 
errorMsg +
                                               "\n\tRemaining input: " + 
remainder());

Thanks - I am a bit puzzled since the new jdk 8 constructor seems to still be used in the posted webrev.

Sorry; I've posted the 7 update version of the webrev at:

http://cr.openjdk.java.net/~darcy/6476261.7u/

-Joe


Reply via email to