groovy

When implementing MOP you cannot intercept core Object methods (equals(), hashCode(), etc.)

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0
  • Fix Version/s: 3.0
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

For some reason when attempting to intercept methods using the invokeMethod() routine there are a set of methods that are uninterceptable. The methods that I tested are:

  • equals()
  • hashCode()

I'm sure there are others. This seems like a hole in the whole MetaObjectProtocol, when intercepting methods I should be able to intercept all of them, not just some of them. Since this is being reworked I thought it would be a good time to file a bug.

Issue Links

Activity

Hide
Andres Almiray added a comment -

Actually it looks like all methods belonging to Object will not be intercepted by invokeMethod, which may be a design constraint not to mess with the basic class, but definitely warrants another look when the MOP is revised.

Show
Andres Almiray added a comment - Actually it looks like all methods belonging to Object will not be intercepted by invokeMethod, which may be a design constraint not to mess with the basic class, but definitely warrants another look when the MOP is revised.
Hide
Guillaume Laforge added a comment -

But EMC allows you to override everything, or even using GroovyInterceptable – the former being the advised way though.

Show
Guillaume Laforge added a comment - But EMC allows you to override everything, or even using GroovyInterceptable – the former being the advised way though.
Hide
Andres Almiray added a comment -

Is there anything further to be done with this issue?

Show
Andres Almiray added a comment - Is there anything further to be done with this issue?

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: