jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-3016

Per-instance MetaClass not respected by InvokerHelper.getMetaClass

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.6
  • Fix Version/s: 1.6.9
  • Component/s: groovy-jdk
  • Labels:
    None

Description

The script

def list = [2, 3, 5]
def c = {it < 5}

c.metaClass = new ExpandoMetaClass(c.class, false)
c.metaClass.isCase = {p -> true}
c.metaClass.initialize()

assert c.isCase(5) == true
assert [2, 3] == list.findAll(c)
assert [2, 3, 5] == list.grep(c) // fails

throws an AssertionError.

It seems that InvokerHelper.getMetaClass does not respect per-instance MetaClasses.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Tim Yates added a comment - 14/Mar/09 5:19 AM

Works fine in Groovy 1.6

Show
Tim Yates added a comment - 14/Mar/09 5:19 AM Works fine in Groovy 1.6
Hide
Permalink
Alexander Veit added a comment - 16/Mar/09 4:33 PM

Confirmed that it works in 1.6.

1.5.8 is not out yet - will it be?

Show
Alexander Veit added a comment - 16/Mar/09 4:33 PM Confirmed that it works in 1.6. 1.5.8 is not out yet - will it be?
Hide
Permalink
Guillaume Laforge added a comment - 17/Mar/09 4:36 AM

1.5.8 is not really scheduled yet, but we could make a release soon if it's really urgent for some people who can't upgrade to 1.6 right away for some reason.

Show
Guillaume Laforge added a comment - 17/Mar/09 4:36 AM 1.5.8 is not really scheduled yet, but we could make a release soon if it's really urgent for some people who can't upgrade to 1.6 right away for some reason.
Hide
Permalink
blackdrag blackdrag added a comment - 23/Jul/11 1:42 PM

since 1.5.x is discontinued, even 1.6.x is and it works since somewhen in I close the issue as fixed

Show
blackdrag blackdrag added a comment - 23/Jul/11 1:42 PM since 1.5.x is discontinued, even 1.6.x is and it works since somewhen in I close the issue as fixed

People

  • Assignee:
    blackdrag blackdrag
    Reporter:
    Alexander Veit
Vote (0)
Watch (0)

Dates

  • Created:
    23/Aug/08 9:43 AM
    Updated:
    23/Jul/11 1:42 PM
    Resolved:
    23/Jul/11 1:42 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.