MCPcopy Create free account
hub / github.com/beanshell/beanshell / getClassNameSpace

Method getClassNameSpace

src/bsh/Name.java:598–616  ·  view source on GitHub ↗

@return the enclosing class body namespace or null if not in a class.

( NameSpace thisNameSpace )

Source from the content-addressed store, hash-verified

596 @return the enclosing class body namespace or null if not in a class.
597 */
598 static NameSpace getClassNameSpace( NameSpace thisNameSpace )
599 {
600 if ( null == thisNameSpace )
601 return null;
602
603 // is a class instance
604 //if ( thisNameSpace.classInstance != null )
605 if ( thisNameSpace.isClass )
606 return thisNameSpace;
607
608 if ( thisNameSpace.isMethod
609 && thisNameSpace.getParent() != null
610 //&& thisNameSpace.getParent().classInstance != null
611 && thisNameSpace.getParent().isClass
612 )
613 return thisNameSpace.getParent();
614
615 return null;
616 }
617
618 /**
619 Check the cache, else use toObject() to try to resolve to a class

Callers 3

invokeMethodMethod · 0.95
constructObjectMethod · 0.95

Calls 1

getParentMethod · 0.45

Tested by

no test coverage detected