cbuschka / beanshell2

Automatically exported from code.google.com/p/beanshell2
0 stars 0 forks source link

Support for "final" inside method parameters #94

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run this code:
 String doTitle(final String text){
          return text;
      }

What is the expected output? What do you see instead?

The returned "text" object should be accepted as final, this is something we 
can do in Java 6.

What version of the product are you using? On what operating system?

Version 2.1b5 under Linux Mint 15, 64 bit edition with OpenJDK 7 installed as 
default.

Original issue reported on code.google.com by nunobrit...@gmail.com on 5 Dec 2013 at 5:48

GoogleCodeExporter commented 8 years ago
Suggested Patch:

### Eclipse Workspace Patch 1.0
#P BeanShell
Index: src/bsh/bsh.jjt
===================================================================
--- src/bsh/bsh.jjt (revision 172)
+++ src/bsh/bsh.jjt (working copy)
@@ -670,7 +670,7 @@
 { Token t; }
 {
   // added [] to Type for bsh.  Removed [ final ] - is that legal?
-  LOOKAHEAD(2) Type() [ TypeArguments() ] t=<IDENTIFIER> { jjtThis.name = 
t.image; }
+  LOOKAHEAD(2) [ "final" ] Type() [ TypeArguments() ] t=<IDENTIFIER> { 
jjtThis.name = t.image; }
 |
   t=<IDENTIFIER> { jjtThis.name = t.image; }
 }

Original comment by pmne...@googlemail.com on 5 Aug 2014 at 6:20