Groovy
  1. Groovy
  2. GROOVY-2857

Full support for special characters in method names

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6-beta-2
    • Fix Version/s: 3.0
    • Component/s: Compiler
    • Labels:
      None
    • Environment:
      Mac OS 10.5.2
      JDK 1.5.0_13
      Groovy 1.6-beta-2-SNAPSHOT

      Description

      Groovy allows method names to be specified as String literals. This enables the use of special characters in method names, such as space, comma, and question mark. However, when such a name become part of a class name, a "java.lang.ClassFormatError: Illegal class name" is thrown at runtime. As far as I can tell, this happens when:
      1. closures are involved
      2. the new call site mechanism generates a class on-the-fly

      To fully support special characters in method names, the naming scheme of generated classes should thus be adapted. Also, the (few) characters that aren't allowed to appear in a method name according to the JVM specification should be rejected by the parser. For more information and related discussion see:
      http://groups.google.com/group/jvm-languages/browse_thread/thread/c5c9c0bafe1ef0c8
      http://www.nabble.com/In-Love-with-Groovy-tt17240709.html

        Activity

        Mark Thomas made changes -
        Workflow jira [ 12973978 ] Default workflow, editable Closed status [ 12980821 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12731876 ] Default workflow, editable Closed status [ 12743752 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Jochen Theodorou made changes -
        Fix Version/s 3.0 [ 13489 ]
        Jochen Theodorou made changes -
        Field Original Value New Value
        Component/s Compiler [ 13529 ]
        Hide
        Danno Ferrin added a comment -

        John Rose (JSR-292 lead) has a list of proposed escapeing sequences here: http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm so perhaps the long term course would be to implement it. I am not wild about the lack of a one to one mapping (reverse can do strange things) so escapeing the backslash with itself may be a modification we may want to do as well.

        However, the full solution may want to wait for 1.7, and this gets listed as a "well then don't do it' bug in the meantime.

        Show
        Danno Ferrin added a comment - John Rose (JSR-292 lead) has a list of proposed escapeing sequences here: http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm so perhaps the long term course would be to implement it. I am not wild about the lack of a one to one mapping (reverse can do strange things) so escapeing the backslash with itself may be a modification we may want to do as well. However, the full solution may want to wait for 1.7, and this gets listed as a "well then don't do it' bug in the meantime.
        Peter Niederwieser created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Peter Niederwieser
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development