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 Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5.6
    • Fix Version/s: None
    • Component/s: groovy-jdk
    • Labels:
      None
    • Number of attachments :
      0

      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

        blackdrag blackdrag made changes -
        Field Original Value New Value
        Parent GROOVY-2503 [ 61571 ]
        Issue Type Improvement [ 4 ] Sub-task [ 7 ]

          People

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

            Dates

            • Created:
              Updated: