MCPcopy Create free account
hub / github.com/antlr/codebuff / testAttributeTrue

Method testAttributeTrue

output/java8/1.4.14/Interpreter.java:1150–1160  ·  view source on GitHub ↗
(Object a)

Source from the content-addressed store, hash-verified

1148 }
1149
1150 protected boolean testAttributeTrue(Object a) {
1151 if ( a==null ) return false;
1152 if ( a instanceof Boolean ) return (Boolean)a;
1153 if ( a instanceof Collection ) return ((Collection<?>)a).size()>0;
1154 if ( a instanceof Map ) return ((Map<?, ?>)a).size()>0;
1155 if ( a instanceof Iterable ) {
1156 return ((Iterable<?>)a).iterator().hasNext();
1157 }
1158 if ( a instanceof Iterator ) return ((Iterator<?>)a).hasNext();
1159 return true; // any other non-null object, return true--it's present
1160 }
1161
1162 protected Object getObjectProperty(STWriter out, InstanceScope scope, Object o, Object property) {
1163 if ( o==null ) {

Callers 1

_execMethod · 0.95

Calls 3

sizeMethod · 0.65
iteratorMethod · 0.65
hasNextMethod · 0.45

Tested by

no test coverage detected