MCPcopy Index your code
hub / github.com/apache/groovy / addMetaMethod

Method addMetaMethod

src/main/java/groovy/lang/MetaClassImpl.java:3296–3304  ·  view source on GitHub ↗

Adds a MetaMethod to this class. WARNING: this method will not do the necessary steps for multimethod logic and using this method doesn't mean, that a method added here is replacing another method from a parent class completely. These steps are usually done by initialize, which means if you need the

(MetaMethod method)

Source from the content-addressed store, hash-verified

3294 * @see #initialize()
3295 */
3296 @Override
3297 public void addMetaMethod(MetaMethod method) {
3298 if (isInitialized()) {
3299 throw new RuntimeException("Already initialized, cannot add new method: " + method);
3300 }
3301
3302 final CachedClass declaringClass = method.getDeclaringClass();
3303 addMetaMethodToIndex(method, metaMethodIndex.getHeader(declaringClass.getTheClass()));
3304 }
3305
3306 /**
3307 * Adds a meta method to the supplied method index after standard-hook bookkeeping.

Callers

nothing calls this directly

Calls 5

isInitializedMethod · 0.95
addMetaMethodToIndexMethod · 0.95
getTheClassMethod · 0.95
getHeaderMethod · 0.80
getDeclaringClassMethod · 0.45

Tested by

no test coverage detected