From 06bb1a6f272f65781e0b613c235124023c6a30cd Mon Sep 17 00:00:00 2001 From: Xavier Le Vourch Date: Fri, 17 Oct 2008 17:24:37 +0000 Subject: [PATCH] Java grammar fix: TypeParameter name wasn't set git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6629 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/etc/grammar/Java.jjt | 4 ++-- .../net/sourceforge/pmd/ast/JavaParser.java | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pmd/etc/grammar/Java.jjt b/pmd/etc/grammar/Java.jjt index 72192e808b..d205023d99 100644 --- a/pmd/etc/grammar/Java.jjt +++ b/pmd/etc/grammar/Java.jjt @@ -1223,9 +1223,9 @@ void TypeParameters(): } void TypeParameter(): -{} +{Token t;} { - [ TypeBound() ] + t= {jjtThis.setImage(t.image);} [ TypeBound() ] } void TypeBound(): diff --git a/pmd/src/net/sourceforge/pmd/ast/JavaParser.java b/pmd/src/net/sourceforge/pmd/ast/JavaParser.java index 97e8ebd436..768684fbb4 100644 --- a/pmd/src/net/sourceforge/pmd/ast/JavaParser.java +++ b/pmd/src/net/sourceforge/pmd/ast/JavaParser.java @@ -868,11 +868,12 @@ jjtn000.setModifiers(modifiers); final public void TypeParameter() throws ParseException { /*@bgen(jjtree) TypeParameter */ - ASTTypeParameter jjtn000 = new ASTTypeParameter(this, JJTTYPEPARAMETER); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); + ASTTypeParameter jjtn000 = new ASTTypeParameter(this, JJTTYPEPARAMETER); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000);Token t; try { - jj_consume_token(IDENTIFIER); + t = jj_consume_token(IDENTIFIER); + jjtn000.setImage(t.image); switch (jj_nt.kind) { case EXTENDS: TypeBound(); @@ -7135,6 +7136,11 @@ jjtn000.setModifiers(modifiers); return false; } + private boolean jj_3R_202() { + if (jj_3R_212()) return true; + return false; + } + private boolean jj_3R_157() { if (jj_3R_198()) return true; return false; @@ -7370,11 +7376,6 @@ jjtn000.setModifiers(modifiers); return false; } - private boolean jj_3R_202() { - if (jj_3R_212()) return true; - return false; - } - private boolean jj_3_48() { if (jj_scan_token(AT)) return true; if (jj_3R_95()) return true;