MCPcopy Index your code
hub / github.com/beanshell/beanshell / setMethod

Method setMethod

src/bsh/NameSpace.java:710–731  ·  view source on GitHub ↗

Note: this is primarily for internal use. @see Interpreter#source( String ) @see Interpreter#eval( String )

( BshMethod method )

Source from the content-addressed store, hash-verified

708 @see Interpreter#eval( String )
709 */
710 public void setMethod( BshMethod method )
711 throws UtilEvalError
712 {
713 //checkMethodModifiers( method );
714
715 if ( methods == null )
716 methods = new HashMap<String,List<BshMethod>>();
717
718 String name = method.getName();
719 List<BshMethod> list = methods.get(name);
720
721 if ( list == null ) {
722 methods.put(name, Collections.singletonList(method));
723 } else {
724 if( !(list instanceof ArrayList) ) {
725 list = new ArrayList<BshMethod>(list);
726 methods.put( name, list );
727 }
728 list.remove(method);
729 list.add( method );
730 }
731 }
732
733 /**
734 @see #getMethod( String, Class [], boolean )

Callers 2

evalMethod · 0.95
invokeMethodMethod · 0.95

Calls 5

getMethod · 0.65
putMethod · 0.65
getNameMethod · 0.45
removeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected