Uploaded image for project: '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

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.5.6
    • None
    • groovy-jdk
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            veita Alexander Veit
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: