Groovy
  1. Groovy
  2. GROOVY-2503 MOP 2.0 design inflluencing issues
  3. GROOVY-2998

Disable overriding via MOP for certain interfaces, classes and methods

    Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5.6
    • Fix Version/s: None
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      Disable overriding via MOP for the following interfaces, classes and methods

      java.lang.CharSequence
       charAt(int)
       length()
       subSequence(int, int)
      
      java.lang.Comparable
       compareTo(T)
      
      java.lang.Number
       byteValue()
       doubleValue()
       floatValue()
       intValue()
       longValue()
       shortValue()
      
      java.lang.Object
       equals(Object)
       getClass()
       hashCode()
       toString()
      
      java.lang.Boolean
       <all methods>
      
      java.lang.Byte
       <all methods>
      
      java.lang.Short
       <all methods>
      
      java.lang.Integer
       <all methods>
      
      java.lang.Long
       <all methods>
      
      java.lang.Double
       <all methods>
      
      java.lang.Float
       <all methods>
      
      java.lang.Enum
       getDeclaringClass()
       name()
       ordinal()
      
      java.lang.String
       <all methods>
      
      java.lang.StringBuffer
       <all methods>
      
      java.lang.StringBuilder
       <all methods>
      

      Overriding these methods

      • does not make sense,
      • adds significant runtime overhead to GDK methods,
      • is not thoroughly respected by runtime libraries, epecially the JRE, and
      • would require to change class file generation (e.g. for concatenated literals).

      This issue is related to http://jira.codehaus.org/browse/GROOVY-2599.

        Activity

        Alexander Veit created issue -
        Jochen Theodorou made changes -
        Field Original Value New Value
        Parent GROOVY-2503 [ 61571 ]
        Issue Type Improvement [ 4 ] Sub-task [ 7 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12732009 ] Default workflow, editable Closed status [ 12743835 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12969925 ] Default workflow, editable Closed status [ 12977511 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Alexander Veit
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development