code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public List<TopologyDetails> needsSchedulingTopologies(Topologies topologies) { List<TopologyDetails> ret = new ArrayList<>(); for (TopologyDetails topology : topologies.getTopologies()) { if (needsScheduling(topology)) { ret.add(topology); } } return ret; }
class class_name[name] begin[{] method[needsSchedulingTopologies, return_type[type[List]], modifier[public], parameter[topologies]] begin[{] local_variable[type[List], ret] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=topology, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=needsScheduling, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=topology, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getTopologies, postfix_operators=[], prefix_operators=[], qualifier=topologies, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=topology)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TopologyDetails, sub_type=None))), label=None) return[member[.ret]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[TopologyDetails] operator[>] identifier[needsSchedulingTopologies] operator[SEP] identifier[Topologies] identifier[topologies] operator[SEP] { identifier[List] operator[<] identifier[TopologyDetails] operator[>] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TopologyDetails] identifier[topology] operator[:] identifier[topologies] operator[SEP] identifier[getTopologies] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[needsScheduling] operator[SEP] identifier[topology] operator[SEP] operator[SEP] { identifier[ret] operator[SEP] identifier[add] operator[SEP] identifier[topology] operator[SEP] operator[SEP] } } Keyword[return] identifier[ret] operator[SEP] }
public void marshall(DeleteConnectionRequest deleteConnectionRequest, ProtocolMarshaller protocolMarshaller) { if (deleteConnectionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteConnectionRequest.getCatalogId(), CATALOGID_BINDING); protocolMarshaller.marshall(deleteConnectionRequest.getConnectionName(), CONNECTIONNAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[deleteConnectionRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.deleteConnectionRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCatalogId, postfix_operators=[], prefix_operators=[], qualifier=deleteConnectionRequest, selectors=[], type_arguments=None), MemberReference(member=CATALOGID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConnectionName, postfix_operators=[], prefix_operators=[], qualifier=deleteConnectionRequest, selectors=[], type_arguments=None), MemberReference(member=CONNECTIONNAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DeleteConnectionRequest] identifier[deleteConnectionRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[deleteConnectionRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteConnectionRequest] operator[SEP] identifier[getCatalogId] operator[SEP] operator[SEP] , identifier[CATALOGID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteConnectionRequest] operator[SEP] identifier[getConnectionName] operator[SEP] operator[SEP] , identifier[CONNECTIONNAME_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
protected Stream<T> getAll(Connection conn) { return executeSelectAsStream(rowMapper, conn, true, calcSqlSelectAll()); }
class class_name[name] begin[{] method[getAll, return_type[type[Stream]], modifier[protected], parameter[conn]] begin[{] return[call[.executeSelectAsStream, parameter[member[.rowMapper], member[.conn], literal[true], call[.calcSqlSelectAll, parameter[]]]]] end[}] END[}]
Keyword[protected] identifier[Stream] operator[<] identifier[T] operator[>] identifier[getAll] operator[SEP] identifier[Connection] identifier[conn] operator[SEP] { Keyword[return] identifier[executeSelectAsStream] operator[SEP] identifier[rowMapper] , identifier[conn] , literal[boolean] , identifier[calcSqlSelectAll] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void acceptVisitor(TypeVisitor visitor) { if (visitor instanceof TimeRangeTypeVisitor) { ((TimeRangeTypeVisitor) visitor).visit(this); } else { super.acceptVisitor(visitor); } }
class class_name[name] begin[{] method[acceptVisitor, return_type[void], modifier[public], parameter[visitor]] begin[{] if[binary_operation[member[.visitor], instanceof, type[TimeRangeTypeVisitor]]] begin[{] Cast(expression=MemberReference(member=visitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TimeRangeTypeVisitor, sub_type=None)) else begin[{] SuperMethodInvocation(arguments=[MemberReference(member=visitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=acceptVisitor, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[acceptVisitor] operator[SEP] identifier[TypeVisitor] identifier[visitor] operator[SEP] { Keyword[if] operator[SEP] identifier[visitor] Keyword[instanceof] identifier[TimeRangeTypeVisitor] operator[SEP] { operator[SEP] operator[SEP] identifier[TimeRangeTypeVisitor] operator[SEP] identifier[visitor] operator[SEP] operator[SEP] identifier[visit] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } Keyword[else] { Keyword[super] operator[SEP] identifier[acceptVisitor] operator[SEP] identifier[visitor] operator[SEP] operator[SEP] } }
public boolean validateWatcher(String name, Watcher watcher){ synchronized(watchers){ if(watchers.containsKey(name)){ return watchers.get(name).contains(watcher); } return false; } }
class class_name[name] begin[{] method[validateWatcher, return_type[type[boolean]], modifier[public], parameter[name, watcher]] begin[{] SYNCHRONIZED[member[.watchers]] BEGIN[{] if[call[watchers.containsKey, parameter[member[.name]]]] begin[{] return[call[watchers.get, parameter[member[.name]]]] else begin[{] None end[}] return[literal[false]] END[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[validateWatcher] operator[SEP] identifier[String] identifier[name] , identifier[Watcher] identifier[watcher] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[watchers] operator[SEP] { Keyword[if] operator[SEP] identifier[watchers] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[return] identifier[watchers] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[watcher] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } }
protected Method findGetter(Object data, String property) throws IntrospectionException { Class<?> clazz = getClass(data); String key = clazz.getName() + ":" + property; Method method = methods.get(key); if (method == null) { Method newMethod = null; PropertyDescriptor[] props = Introspector.getBeanInfo(clazz).getPropertyDescriptors(); for (PropertyDescriptor prop : props) { if (prop.getName().equalsIgnoreCase(property)) { newMethod = prop.getReadMethod(); } } method = methods.putIfAbsent(key, newMethod); if (method == null) { // put succeeded, use new value method = newMethod; } } return method; }
class class_name[name] begin[{] method[findGetter, return_type[type[Method]], modifier[protected], parameter[data, property]] begin[{] local_variable[type[Class], clazz] local_variable[type[String], key] local_variable[type[Method], method] if[binary_operation[member[.method], ==, literal[null]]] begin[{] local_variable[type[Method], newMethod] local_variable[type[PropertyDescriptor], props] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getReadMethod, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=props, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=None))), label=None) assign[member[.method], call[methods.putIfAbsent, parameter[member[.key], member[.newMethod]]]] if[binary_operation[member[.method], ==, literal[null]]] begin[{] assign[member[.method], member[.newMethod]] else begin[{] None end[}] else begin[{] None end[}] return[member[.method]] end[}] END[}]
Keyword[protected] identifier[Method] identifier[findGetter] operator[SEP] identifier[Object] identifier[data] , identifier[String] identifier[property] operator[SEP] Keyword[throws] identifier[IntrospectionException] { identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[getClass] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[String] identifier[key] operator[=] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[property] operator[SEP] identifier[Method] identifier[method] operator[=] identifier[methods] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[==] Other[null] operator[SEP] { identifier[Method] identifier[newMethod] operator[=] Other[null] operator[SEP] identifier[PropertyDescriptor] operator[SEP] operator[SEP] identifier[props] operator[=] identifier[Introspector] operator[SEP] identifier[getBeanInfo] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] identifier[getPropertyDescriptors] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PropertyDescriptor] identifier[prop] operator[:] identifier[props] operator[SEP] { Keyword[if] operator[SEP] identifier[prop] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[property] operator[SEP] operator[SEP] { identifier[newMethod] operator[=] identifier[prop] operator[SEP] identifier[getReadMethod] operator[SEP] operator[SEP] operator[SEP] } } identifier[method] operator[=] identifier[methods] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[key] , identifier[newMethod] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[==] Other[null] operator[SEP] { identifier[method] operator[=] identifier[newMethod] operator[SEP] } } Keyword[return] identifier[method] operator[SEP] }
public int getCompletedTasks() { int completedTasks = 0; for (TaskState taskState : this.taskStates.values()) { if (taskState.isCompleted()) { completedTasks++; } } return completedTasks; }
class class_name[name] begin[{] method[getCompletedTasks, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[int], completedTasks] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isCompleted, postfix_operators=[], prefix_operators=[], qualifier=taskState, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=completedTasks, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=taskStates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=taskState)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TaskState, sub_type=None))), label=None) return[member[.completedTasks]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getCompletedTasks] operator[SEP] operator[SEP] { Keyword[int] identifier[completedTasks] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[TaskState] identifier[taskState] operator[:] Keyword[this] operator[SEP] identifier[taskStates] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[taskState] operator[SEP] identifier[isCompleted] operator[SEP] operator[SEP] operator[SEP] { identifier[completedTasks] operator[++] operator[SEP] } } Keyword[return] identifier[completedTasks] operator[SEP] }
private void completeHeartbeat() { heartbeatFailures = 0; heartbeatFuture = nextHeartbeatFuture; nextHeartbeatFuture = null; updateGlobalIndex(); if (heartbeatFuture != null) { heartbeatTime = System.currentTimeMillis(); for (MemberState member : context.getClusterState().getRemoteMemberStates()) { appendEntries(member); } } }
class class_name[name] begin[{] method[completeHeartbeat, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.heartbeatFailures], literal[0]] assign[member[.heartbeatFuture], member[.nextHeartbeatFuture]] assign[member[.nextHeartbeatFuture], literal[null]] call[.updateGlobalIndex, parameter[]] if[binary_operation[member[.heartbeatFuture], !=, literal[null]]] begin[{] assign[member[.heartbeatTime], call[System.currentTimeMillis, parameter[]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendEntries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getClusterState, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[], member=getRemoteMemberStates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=member)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MemberState, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[completeHeartbeat] operator[SEP] operator[SEP] { identifier[heartbeatFailures] operator[=] Other[0] operator[SEP] identifier[heartbeatFuture] operator[=] identifier[nextHeartbeatFuture] operator[SEP] identifier[nextHeartbeatFuture] operator[=] Other[null] operator[SEP] identifier[updateGlobalIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[heartbeatFuture] operator[!=] Other[null] operator[SEP] { identifier[heartbeatTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[MemberState] identifier[member] operator[:] identifier[context] operator[SEP] identifier[getClusterState] operator[SEP] operator[SEP] operator[SEP] identifier[getRemoteMemberStates] operator[SEP] operator[SEP] operator[SEP] { identifier[appendEntries] operator[SEP] identifier[member] operator[SEP] operator[SEP] } } }
public Set<String> subprotocols() { Set<String> ret = new LinkedHashSet<String>(); Collections.addAll(ret, subprotocols); return ret; }
class class_name[name] begin[{] method[subprotocols, return_type[type[Set]], modifier[public], parameter[]] begin[{] local_variable[type[Set], ret] call[Collections.addAll, parameter[member[.ret], member[.subprotocols]]] return[member[.ret]] end[}] END[}]
Keyword[public] identifier[Set] operator[<] identifier[String] operator[>] identifier[subprotocols] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[ret] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[addAll] operator[SEP] identifier[ret] , identifier[subprotocols] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
public final BuilderType addAllDialogValidators( @NonNull final Collection<DialogValidator> validators) { Condition.INSTANCE.ensureNotNull(validators, "The collection may not be null"); getProduct().addAllDialogValidators(validators); return self(); }
class class_name[name] begin[{] method[addAllDialogValidators, return_type[type[BuilderType]], modifier[final public], parameter[validators]] begin[{] call[Condition.INSTANCE.ensureNotNull, parameter[member[.validators], literal["The collection may not be null"]]] call[.getProduct, parameter[]] return[call[.self, parameter[]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[BuilderType] identifier[addAllDialogValidators] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[Collection] operator[<] identifier[DialogValidator] operator[>] identifier[validators] operator[SEP] { identifier[Condition] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[ensureNotNull] operator[SEP] identifier[validators] , literal[String] operator[SEP] operator[SEP] identifier[getProduct] operator[SEP] operator[SEP] operator[SEP] identifier[addAllDialogValidators] operator[SEP] identifier[validators] operator[SEP] operator[SEP] Keyword[return] identifier[self] operator[SEP] operator[SEP] operator[SEP] }
@Override public EClass getIfcElementarySurface() { if (ifcElementarySurfaceEClass == null) { ifcElementarySurfaceEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(228); } return ifcElementarySurfaceEClass; }
class class_name[name] begin[{] method[getIfcElementarySurface, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcElementarySurfaceEClass], ==, literal[null]]] begin[{] assign[member[.ifcElementarySurfaceEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=228)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcElementarySurfaceEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcElementarySurface] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcElementarySurfaceEClass] operator[==] Other[null] operator[SEP] { identifier[ifcElementarySurfaceEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[228] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcElementarySurfaceEClass] operator[SEP] }
public Record getNextRecord(PrintWriter out, int iPrintOptions, boolean bFirstTime, boolean bHeadingFootingExists) throws DBException { Object[] rgobjEnabled = null; boolean bAfterRequery = !this.getMainRecord().isOpen(); if (!this.getMainRecord().isOpen()) this.getMainRecord().open(); // Make sure any listeners are called before disabling. if (bHeadingFootingExists) rgobjEnabled = this.getMainRecord().setEnableNonFilter(null, false, false, false, false, true); Record record = this.getNextGridRecord(bFirstTime); if (bHeadingFootingExists) { boolean bBreak = this.printHeadingFootingData(out, iPrintOptions | HtmlConstants.FOOTING_SCREEN | HtmlConstants.DETAIL_SCREEN); this.getMainRecord().setEnableNonFilter(rgobjEnabled, (record != null), bBreak, bFirstTime | bAfterRequery, (record == null), true); } return record; }
class class_name[name] begin[{] method[getNextRecord, return_type[type[Record]], modifier[public], parameter[out, iPrintOptions, bFirstTime, bHeadingFootingExists]] begin[{] local_variable[type[Object], rgobjEnabled] local_variable[type[boolean], bAfterRequery] if[THIS[call[None.getMainRecord, parameter[]]call[None.isOpen, parameter[]]]] begin[{] THIS[call[None.getMainRecord, parameter[]]call[None.open, parameter[]]] else begin[{] None end[}] if[member[.bHeadingFootingExists]] begin[{] assign[member[.rgobjEnabled], THIS[call[None.getMainRecord, parameter[]]call[None.setEnableNonFilter, parameter[literal[null], literal[false], literal[false], literal[false], literal[false], literal[true]]]]] else begin[{] None end[}] local_variable[type[Record], record] if[member[.bHeadingFootingExists]] begin[{] local_variable[type[boolean], bBreak] THIS[call[None.getMainRecord, parameter[]]call[None.setEnableNonFilter, parameter[member[.rgobjEnabled], binary_operation[member[.record], !=, literal[null]], member[.bBreak], binary_operation[member[.bFirstTime], |, member[.bAfterRequery]], binary_operation[member[.record], ==, literal[null]], literal[true]]]] else begin[{] None end[}] return[member[.record]] end[}] END[}]
Keyword[public] identifier[Record] identifier[getNextRecord] operator[SEP] identifier[PrintWriter] identifier[out] , Keyword[int] identifier[iPrintOptions] , Keyword[boolean] identifier[bFirstTime] , Keyword[boolean] identifier[bHeadingFootingExists] operator[SEP] Keyword[throws] identifier[DBException] { identifier[Object] operator[SEP] operator[SEP] identifier[rgobjEnabled] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[bAfterRequery] operator[=] operator[!] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bHeadingFootingExists] operator[SEP] identifier[rgobjEnabled] operator[=] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[setEnableNonFilter] operator[SEP] Other[null] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[Record] identifier[record] operator[=] Keyword[this] operator[SEP] identifier[getNextGridRecord] operator[SEP] identifier[bFirstTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bHeadingFootingExists] operator[SEP] { Keyword[boolean] identifier[bBreak] operator[=] Keyword[this] operator[SEP] identifier[printHeadingFootingData] operator[SEP] identifier[out] , identifier[iPrintOptions] operator[|] identifier[HtmlConstants] operator[SEP] identifier[FOOTING_SCREEN] operator[|] identifier[HtmlConstants] operator[SEP] identifier[DETAIL_SCREEN] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[setEnableNonFilter] operator[SEP] identifier[rgobjEnabled] , operator[SEP] identifier[record] operator[!=] Other[null] operator[SEP] , identifier[bBreak] , identifier[bFirstTime] operator[|] identifier[bAfterRequery] , operator[SEP] identifier[record] operator[==] Other[null] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] } Keyword[return] identifier[record] operator[SEP] }
public Observable<JobAgentInner> updateAsync(String resourceGroupName, String serverName, String jobAgentName) { return updateWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName).map(new Func1<ServiceResponse<JobAgentInner>, JobAgentInner>() { @Override public JobAgentInner call(ServiceResponse<JobAgentInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[updateAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, serverName, jobAgentName]] begin[{] return[call[.updateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName], member[.jobAgentName]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[JobAgentInner] operator[>] identifier[updateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[String] identifier[jobAgentName] operator[SEP] { Keyword[return] identifier[updateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[jobAgentName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[JobAgentInner] operator[>] , identifier[JobAgentInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[JobAgentInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[JobAgentInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public void replace(Fragment fragment) { manager.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE); manager.beginTransaction() .replace(containerId, fragment, indexToTag(0)) .commit(); manager.executePendingTransactions(); }
class class_name[name] begin[{] method[replace, return_type[void], modifier[public], parameter[fragment]] begin[{] call[manager.popBackStackImmediate, parameter[literal[null], member[FragmentManager.POP_BACK_STACK_INCLUSIVE]]] call[manager.beginTransaction, parameter[]] call[manager.executePendingTransactions, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[replace] operator[SEP] identifier[Fragment] identifier[fragment] operator[SEP] { identifier[manager] operator[SEP] identifier[popBackStackImmediate] operator[SEP] Other[null] , identifier[FragmentManager] operator[SEP] identifier[POP_BACK_STACK_INCLUSIVE] operator[SEP] operator[SEP] identifier[manager] operator[SEP] identifier[beginTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] identifier[containerId] , identifier[fragment] , identifier[indexToTag] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] identifier[manager] operator[SEP] identifier[executePendingTransactions] operator[SEP] operator[SEP] operator[SEP] }
public static News getNewsByDoc(Document doc) throws Exception { ContentExtractor ce = new ContentExtractor(doc); return ce.getNews(); }
class class_name[name] begin[{] method[getNewsByDoc, return_type[type[News]], modifier[public static], parameter[doc]] begin[{] local_variable[type[ContentExtractor], ce] return[call[ce.getNews, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[News] identifier[getNewsByDoc] operator[SEP] identifier[Document] identifier[doc] operator[SEP] Keyword[throws] identifier[Exception] { identifier[ContentExtractor] identifier[ce] operator[=] Keyword[new] identifier[ContentExtractor] operator[SEP] identifier[doc] operator[SEP] operator[SEP] Keyword[return] identifier[ce] operator[SEP] identifier[getNews] operator[SEP] operator[SEP] operator[SEP] }
public static String conditionFromHasNode(Node cursor) { if (cursor.getType() == Token.CALL) { // The node is a function or method call Node name, arg; if ((name = cursor.getFirstChild()) != null && name.getType() == Token.NAME && // named function call name.getString().equals("has") && // name is "has" //$NON-NLS-1$ (arg = name.getNext()) != null && arg.getType() == Token.STRING && // first param is a string literal arg.getNext() == null) // only one param { // Ensure that the result of the has function is treated as a // boolean expression. This is necessary to avoid problems // with code similar to "if (has("ieVersion") < 6)" Node parent = cursor.getParent(); int type = parent.getType(); switch (type) { case Token.IF: case Token.HOOK: case Token.AND: case Token.OR: case Token.NOT: // these implicitly coerce the result of the function call // to boolean so we don't need to do anything else break; default: // Replacing the function call with a boolean value might not // have the desired effects if the code treats the result of // the function as a non-boolean, so don't do anything. return null; } return arg.getString(); } } return null; }
class class_name[name] begin[{] method[conditionFromHasNode, return_type[type[String]], modifier[public static], parameter[cursor]] begin[{] if[binary_operation[call[cursor.getType, parameter[]], ==, member[Token.CALL]]] begin[{] local_variable[type[Node], name] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[assign[member[.name], call[cursor.getFirstChild, parameter[]]], !=, literal[null]], &&, binary_operation[call[name.getType, parameter[]], ==, member[Token.NAME]]], &&, call[name.getString, parameter[]]], &&, binary_operation[assign[member[.arg], call[name.getNext, parameter[]]], !=, literal[null]]], &&, binary_operation[call[arg.getType, parameter[]], ==, member[Token.STRING]]], &&, binary_operation[call[arg.getNext, parameter[]], ==, literal[null]]]] begin[{] local_variable[type[Node], parent] local_variable[type[int], type] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=IF, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), MemberReference(member=HOOK, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), MemberReference(member=AND, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), MemberReference(member=OR, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), MemberReference(member=NOT, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[])], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[call[arg.getString, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[conditionFromHasNode] operator[SEP] identifier[Node] identifier[cursor] operator[SEP] { Keyword[if] operator[SEP] identifier[cursor] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Token] operator[SEP] identifier[CALL] operator[SEP] { identifier[Node] identifier[name] , identifier[arg] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[name] operator[=] identifier[cursor] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[name] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Token] operator[SEP] identifier[NAME] operator[&&] identifier[name] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[arg] operator[=] identifier[name] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[arg] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Token] operator[SEP] identifier[STRING] operator[&&] identifier[arg] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[Node] identifier[parent] operator[=] identifier[cursor] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[type] operator[=] identifier[parent] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[Token] operator[SEP] identifier[IF] operator[:] Keyword[case] identifier[Token] operator[SEP] identifier[HOOK] operator[:] Keyword[case] identifier[Token] operator[SEP] identifier[AND] operator[:] Keyword[case] identifier[Token] operator[SEP] identifier[OR] operator[:] Keyword[case] identifier[Token] operator[SEP] identifier[NOT] operator[:] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[arg] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
@Override public EClass getIfcShadingDevice() { if (ifcShadingDeviceEClass == null) { ifcShadingDeviceEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(593); } return ifcShadingDeviceEClass; }
class class_name[name] begin[{] method[getIfcShadingDevice, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcShadingDeviceEClass], ==, literal[null]]] begin[{] assign[member[.ifcShadingDeviceEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=593)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcShadingDeviceEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcShadingDevice] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcShadingDeviceEClass] operator[==] Other[null] operator[SEP] { identifier[ifcShadingDeviceEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[593] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcShadingDeviceEClass] operator[SEP] }
public static void decodeUIInput(FacesContext facesContext, UIComponent component) { if (!(component instanceof EditableValueHolder)) { throw new IllegalArgumentException("Component " + component.getClientId(facesContext) + " is not an EditableValueHolder"); } Map paramMap = facesContext.getExternalContext() .getRequestParameterMap(); String clientId = component.getClientId(facesContext); if (isDisabledOrReadOnly(component)) { return; } if (paramMap.containsKey(clientId)) { ((EditableValueHolder) component).setSubmittedValue(paramMap .get(clientId)); } else { log.warning(NON_SUBMITTED_VALUE_WARNING + " Component : " + RendererUtils.getPathToComponent(component)); } }
class class_name[name] begin[{] method[decodeUIInput, return_type[void], modifier[public static], parameter[facesContext, component]] begin[{] if[binary_operation[member[.component], instanceof, type[EditableValueHolder]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component "), operandr=MethodInvocation(arguments=[MemberReference(member=facesContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getClientId, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not an EditableValueHolder"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Map], paramMap] local_variable[type[String], clientId] if[call[.isDisabledOrReadOnly, parameter[member[.component]]]] begin[{] return[None] else begin[{] None end[}] if[call[paramMap.containsKey, parameter[member[.clientId]]]] begin[{] Cast(expression=MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EditableValueHolder, sub_type=None)) else begin[{] call[log.warning, parameter[binary_operation[binary_operation[member[.NON_SUBMITTED_VALUE_WARNING], +, literal[" Component : "]], +, call[RendererUtils.getPathToComponent, parameter[member[.component]]]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[decodeUIInput] operator[SEP] identifier[FacesContext] identifier[facesContext] , identifier[UIComponent] identifier[component] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[component] Keyword[instanceof] identifier[EditableValueHolder] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[component] operator[SEP] identifier[getClientId] operator[SEP] identifier[facesContext] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[Map] identifier[paramMap] operator[=] identifier[facesContext] operator[SEP] identifier[getExternalContext] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestParameterMap] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[clientId] operator[=] identifier[component] operator[SEP] identifier[getClientId] operator[SEP] identifier[facesContext] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isDisabledOrReadOnly] operator[SEP] identifier[component] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[paramMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[clientId] operator[SEP] operator[SEP] { operator[SEP] operator[SEP] identifier[EditableValueHolder] operator[SEP] identifier[component] operator[SEP] operator[SEP] identifier[setSubmittedValue] operator[SEP] identifier[paramMap] operator[SEP] identifier[get] operator[SEP] identifier[clientId] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[warning] operator[SEP] identifier[NON_SUBMITTED_VALUE_WARNING] operator[+] literal[String] operator[+] identifier[RendererUtils] operator[SEP] identifier[getPathToComponent] operator[SEP] identifier[component] operator[SEP] operator[SEP] operator[SEP] } }
@NonNull public static Drop dropIndex(@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier indexName) { return new DefaultDrop(keyspace, indexName, "INDEX"); }
class class_name[name] begin[{] method[dropIndex, return_type[type[Drop]], modifier[public static], parameter[keyspace, indexName]] begin[{] return[ClassCreator(arguments=[MemberReference(member=keyspace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indexName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INDEX")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultDrop, sub_type=None))] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[public] Keyword[static] identifier[Drop] identifier[dropIndex] operator[SEP] annotation[@] identifier[Nullable] identifier[CqlIdentifier] identifier[keyspace] , annotation[@] identifier[NonNull] identifier[CqlIdentifier] identifier[indexName] operator[SEP] { Keyword[return] Keyword[new] identifier[DefaultDrop] operator[SEP] identifier[keyspace] , identifier[indexName] , literal[String] operator[SEP] operator[SEP] }
public void marshall(RestoreFromSnapshotRequest restoreFromSnapshotRequest, ProtocolMarshaller protocolMarshaller) { if (restoreFromSnapshotRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(restoreFromSnapshotRequest.getSnapshotId(), SNAPSHOTID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[restoreFromSnapshotRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.restoreFromSnapshotRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSnapshotId, postfix_operators=[], prefix_operators=[], qualifier=restoreFromSnapshotRequest, selectors=[], type_arguments=None), MemberReference(member=SNAPSHOTID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[RestoreFromSnapshotRequest] identifier[restoreFromSnapshotRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[restoreFromSnapshotRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[restoreFromSnapshotRequest] operator[SEP] identifier[getSnapshotId] operator[SEP] operator[SEP] , identifier[SNAPSHOTID_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void setAutoScalingGroups(java.util.Collection<String> autoScalingGroups) { if (autoScalingGroups == null) { this.autoScalingGroups = null; return; } this.autoScalingGroups = new java.util.ArrayList<String>(autoScalingGroups); }
class class_name[name] begin[{] method[setAutoScalingGroups, return_type[void], modifier[public], parameter[autoScalingGroups]] begin[{] if[binary_operation[member[.autoScalingGroups], ==, literal[null]]] begin[{] assign[THIS[member[None.autoScalingGroups]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.autoScalingGroups]], ClassCreator(arguments=[MemberReference(member=autoScalingGroups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setAutoScalingGroups] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[autoScalingGroups] operator[SEP] { Keyword[if] operator[SEP] identifier[autoScalingGroups] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[autoScalingGroups] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[autoScalingGroups] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[autoScalingGroups] operator[SEP] operator[SEP] }
@Override public ResourceSet<Mobile> read(final TwilioRestClient client) { return new ResourceSet<>(this, client, firstPage(client)); }
class class_name[name] begin[{] method[read, return_type[type[ResourceSet]], modifier[public], parameter[client]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=firstPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ResourceSet, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ResourceSet] operator[<] identifier[Mobile] operator[>] identifier[read] operator[SEP] Keyword[final] identifier[TwilioRestClient] identifier[client] operator[SEP] { Keyword[return] Keyword[new] identifier[ResourceSet] operator[<] operator[>] operator[SEP] Keyword[this] , identifier[client] , identifier[firstPage] operator[SEP] identifier[client] operator[SEP] operator[SEP] operator[SEP] }
public static GsonBuilder registerDuration(GsonBuilder builder) { if (builder == null) { throw new NullPointerException("builder cannot be null"); } builder.registerTypeAdapter(DURATION_TYPE, new DurationConverter()); return builder; }
class class_name[name] begin[{] method[registerDuration, return_type[type[GsonBuilder]], modifier[public static], parameter[builder]] begin[{] if[binary_operation[member[.builder], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="builder cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] call[builder.registerTypeAdapter, parameter[member[.DURATION_TYPE], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DurationConverter, sub_type=None))]] return[member[.builder]] end[}] END[}]
Keyword[public] Keyword[static] identifier[GsonBuilder] identifier[registerDuration] operator[SEP] identifier[GsonBuilder] identifier[builder] operator[SEP] { Keyword[if] operator[SEP] identifier[builder] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[registerTypeAdapter] operator[SEP] identifier[DURATION_TYPE] , Keyword[new] identifier[DurationConverter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] }
public final void classBody() throws RecognitionException { int classBody_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 19) ) { return; } // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:351:5: ( '{' ( classBodyDeclaration )* '}' ) // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:351:7: '{' ( classBodyDeclaration )* '}' { match(input,121,FOLLOW_121_in_classBody627); if (state.failed) return; // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:351:11: ( classBodyDeclaration )* loop31: while (true) { int alt31=2; int LA31_0 = input.LA(1); if ( (LA31_0==ENUM||LA31_0==Identifier||(LA31_0 >= 52 && LA31_0 <= 53)||LA31_0==58||LA31_0==63||LA31_0==65||LA31_0==67||(LA31_0 >= 71 && LA31_0 <= 72)||LA31_0==77||LA31_0==83||LA31_0==85||(LA31_0 >= 92 && LA31_0 <= 94)||LA31_0==96||(LA31_0 >= 100 && LA31_0 <= 102)||(LA31_0 >= 105 && LA31_0 <= 107)||LA31_0==110||LA31_0==114||(LA31_0 >= 118 && LA31_0 <= 119)||LA31_0==121) ) { alt31=1; } switch (alt31) { case 1 : // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:351:11: classBodyDeclaration { pushFollow(FOLLOW_classBodyDeclaration_in_classBody629); classBodyDeclaration(); state._fsp--; if (state.failed) return; } break; default : break loop31; } } match(input,125,FOLLOW_125_in_classBody632); if (state.failed) return; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving if ( state.backtracking>0 ) { memoize(input, 19, classBody_StartIndex); } } }
class class_name[name] begin[{] method[classBody, return_type[void], modifier[final public], parameter[]] begin[{] local_variable[type[int], classBody_StartIndex] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=19)], member=alreadyParsedRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=121), MemberReference(member=FOLLOW_121_in_classBody627, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt31)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA31_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ENUM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=Identifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=52), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=53), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=58), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=63), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=65), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=67), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=71), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=72), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=77), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=83), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=85), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=92), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=94), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=96), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=102), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=105), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=107), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=110), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=114), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=118), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=119), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA31_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=121), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt31, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_classBodyDeclaration_in_classBody629, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=classBodyDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=loop31, label=None)])], expression=MemberReference(member=alt31, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=loop31), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=125), MemberReference(member=FOLLOW_125_in_classBody632, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=19), MemberReference(member=classBody_StartIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=memoize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[classBody] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[int] identifier[classBody_StartIndex] operator[=] identifier[input] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[>] Other[0] operator[&&] identifier[alreadyParsedRule] operator[SEP] identifier[input] , Other[19] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } { identifier[match] operator[SEP] identifier[input] , Other[121] , identifier[FOLLOW_121_in_classBody627] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] identifier[loop31] operator[:] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[int] identifier[alt31] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA31_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA31_0] operator[==] identifier[ENUM] operator[||] identifier[LA31_0] operator[==] identifier[Identifier] operator[||] operator[SEP] identifier[LA31_0] operator[>=] Other[52] operator[&&] identifier[LA31_0] operator[<=] Other[53] operator[SEP] operator[||] identifier[LA31_0] operator[==] Other[58] operator[||] identifier[LA31_0] operator[==] Other[63] operator[||] identifier[LA31_0] operator[==] Other[65] operator[||] identifier[LA31_0] operator[==] Other[67] operator[||] operator[SEP] identifier[LA31_0] operator[>=] Other[71] operator[&&] identifier[LA31_0] operator[<=] Other[72] operator[SEP] operator[||] identifier[LA31_0] operator[==] Other[77] operator[||] identifier[LA31_0] operator[==] Other[83] operator[||] identifier[LA31_0] operator[==] Other[85] operator[||] operator[SEP] identifier[LA31_0] operator[>=] Other[92] operator[&&] identifier[LA31_0] operator[<=] Other[94] operator[SEP] operator[||] identifier[LA31_0] operator[==] Other[96] operator[||] operator[SEP] identifier[LA31_0] operator[>=] Other[100] operator[&&] identifier[LA31_0] operator[<=] Other[102] operator[SEP] operator[||] operator[SEP] identifier[LA31_0] operator[>=] Other[105] operator[&&] identifier[LA31_0] operator[<=] Other[107] operator[SEP] operator[||] identifier[LA31_0] operator[==] Other[110] operator[||] identifier[LA31_0] operator[==] Other[114] operator[||] operator[SEP] identifier[LA31_0] operator[>=] Other[118] operator[&&] identifier[LA31_0] operator[<=] Other[119] operator[SEP] operator[||] identifier[LA31_0] operator[==] Other[121] operator[SEP] operator[SEP] { identifier[alt31] operator[=] Other[1] operator[SEP] } Keyword[switch] operator[SEP] identifier[alt31] operator[SEP] { Keyword[case] Other[1] operator[:] { identifier[pushFollow] operator[SEP] identifier[FOLLOW_classBodyDeclaration_in_classBody629] operator[SEP] operator[SEP] identifier[classBodyDeclaration] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] identifier[loop31] operator[SEP] } } identifier[match] operator[SEP] identifier[input] , Other[125] , identifier[FOLLOW_125_in_classBody632] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[>] Other[0] operator[SEP] { identifier[memoize] operator[SEP] identifier[input] , Other[19] , identifier[classBody_StartIndex] operator[SEP] operator[SEP] } } }
public static Map<String, String> getAllTypes(App app) { Map<String, String> map = new LinkedHashMap<>(getCoreTypes()); if (app != null) { map.putAll(app.getDatatypes()); } return map; }
class class_name[name] begin[{] method[getAllTypes, return_type[type[Map]], modifier[public static], parameter[app]] begin[{] local_variable[type[Map], map] if[binary_operation[member[.app], !=, literal[null]]] begin[{] call[map.putAll, parameter[call[app.getDatatypes, parameter[]]]] else begin[{] None end[}] return[member[.map]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getAllTypes] operator[SEP] identifier[App] identifier[app] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] identifier[getCoreTypes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[app] operator[!=] Other[null] operator[SEP] { identifier[map] operator[SEP] identifier[putAll] operator[SEP] identifier[app] operator[SEP] identifier[getDatatypes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[map] operator[SEP] }
private ITag createFileMeta() { // Create tag for onMetaData event IoBuffer buf = IoBuffer.allocate(192); buf.setAutoExpand(true); Output out = new Output(buf); // Duration property out.writeString("onMetaData"); Map<Object, Object> props = new HashMap<Object, Object>(); props.put("duration", duration / 1000.0); if (firstVideoTag != -1) { long old = getCurrentPosition(); setCurrentPosition(firstVideoTag); try { readTagHeader(); fillBuffer(1); int codecId = in.get() & MASK_VIDEO_CODEC; // Video codec id props.put("videocodecid", codecId); } catch (UnsupportedDataTypeException e) { log.warn("createFileMeta for video", e); } setCurrentPosition(old); } if (firstAudioTag != -1) { long old = getCurrentPosition(); setCurrentPosition(firstAudioTag); try { readTagHeader(); fillBuffer(1); int codecId = (in.get() & MASK_SOUND_FORMAT) >> 4; // Audio codec id props.put("audiocodecid", codecId); } catch (UnsupportedDataTypeException e) { log.warn("createFileMeta for audio", e); } setCurrentPosition(old); } props.put("canSeekToEnd", true); out.writeMap(props); buf.flip(); ITag result = new Tag(IoConstants.TYPE_METADATA, 0, buf.limit(), null, 0); result.setBody(buf); out = null; return result; }
class class_name[name] begin[{] method[createFileMeta, return_type[type[ITag]], modifier[private], parameter[]] begin[{] local_variable[type[IoBuffer], buf] call[buf.setAutoExpand, parameter[literal[true]]] local_variable[type[Output], out] call[out.writeString, parameter[literal["onMetaData"]]] local_variable[type[Map], props] call[props.put, parameter[literal["duration"], binary_operation[member[.duration], /, literal[1000.0]]]] if[binary_operation[member[.firstVideoTag], !=, literal[1]]] begin[{] local_variable[type[long], old] call[.setCurrentPosition, parameter[member[.firstVideoTag]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=readTagHeader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=fillBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), operandr=MemberReference(member=MASK_VIDEO_CODEC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), name=codecId)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="videocodecid"), MemberReference(member=codecId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="createFileMeta for video"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedDataTypeException']))], finally_block=None, label=None, resources=None) call[.setCurrentPosition, parameter[member[.old]]] else begin[{] None end[}] if[binary_operation[member[.firstAudioTag], !=, literal[1]]] begin[{] local_variable[type[long], old] call[.setCurrentPosition, parameter[member[.firstAudioTag]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=readTagHeader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=fillBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), operandr=MemberReference(member=MASK_SOUND_FORMAT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=>>), name=codecId)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="audiocodecid"), MemberReference(member=codecId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="createFileMeta for audio"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedDataTypeException']))], finally_block=None, label=None, resources=None) call[.setCurrentPosition, parameter[member[.old]]] else begin[{] None end[}] call[props.put, parameter[literal["canSeekToEnd"], literal[true]]] call[out.writeMap, parameter[member[.props]]] call[buf.flip, parameter[]] local_variable[type[ITag], result] call[result.setBody, parameter[member[.buf]]] assign[member[.out], literal[null]] return[member[.result]] end[}] END[}]
Keyword[private] identifier[ITag] identifier[createFileMeta] operator[SEP] operator[SEP] { identifier[IoBuffer] identifier[buf] operator[=] identifier[IoBuffer] operator[SEP] identifier[allocate] operator[SEP] Other[192] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[setAutoExpand] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[Output] identifier[out] operator[=] Keyword[new] identifier[Output] operator[SEP] identifier[buf] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeString] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[props] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Object] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[duration] operator[/] literal[Float] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[firstVideoTag] operator[!=] operator[-] Other[1] operator[SEP] { Keyword[long] identifier[old] operator[=] identifier[getCurrentPosition] operator[SEP] operator[SEP] operator[SEP] identifier[setCurrentPosition] operator[SEP] identifier[firstVideoTag] operator[SEP] operator[SEP] Keyword[try] { identifier[readTagHeader] operator[SEP] operator[SEP] operator[SEP] identifier[fillBuffer] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[codecId] operator[=] identifier[in] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[&] identifier[MASK_VIDEO_CODEC] operator[SEP] identifier[props] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[codecId] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedDataTypeException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[setCurrentPosition] operator[SEP] identifier[old] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[firstAudioTag] operator[!=] operator[-] Other[1] operator[SEP] { Keyword[long] identifier[old] operator[=] identifier[getCurrentPosition] operator[SEP] operator[SEP] operator[SEP] identifier[setCurrentPosition] operator[SEP] identifier[firstAudioTag] operator[SEP] operator[SEP] Keyword[try] { identifier[readTagHeader] operator[SEP] operator[SEP] operator[SEP] identifier[fillBuffer] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[codecId] operator[=] operator[SEP] identifier[in] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[&] identifier[MASK_SOUND_FORMAT] operator[SEP] operator[>] operator[>] Other[4] operator[SEP] identifier[props] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[codecId] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedDataTypeException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[setCurrentPosition] operator[SEP] identifier[old] operator[SEP] operator[SEP] } identifier[props] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeMap] operator[SEP] identifier[props] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[flip] operator[SEP] operator[SEP] operator[SEP] identifier[ITag] identifier[result] operator[=] Keyword[new] identifier[Tag] operator[SEP] identifier[IoConstants] operator[SEP] identifier[TYPE_METADATA] , Other[0] , identifier[buf] operator[SEP] identifier[limit] operator[SEP] operator[SEP] , Other[null] , Other[0] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setBody] operator[SEP] identifier[buf] operator[SEP] operator[SEP] identifier[out] operator[=] Other[null] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public void init() { String rootPath = ManagePathUtils.getRoot(); String channelRootPath = ManagePathUtils.getChannelRoot(); String nodeRootPath = ManagePathUtils.getNodeRoot(); try { zookeeper.create(rootPath, new byte[0], CreateMode.PERSISTENT); zookeeper.create(channelRootPath, new byte[0], CreateMode.PERSISTENT); zookeeper.create(nodeRootPath, new byte[0], CreateMode.PERSISTENT); } catch (ZkNodeExistsException e) { // 如果节点已经存在,则不抛异常 // ignore } catch (ZkException e) { throw new ArbitrateException("system_init", e); } }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[String], rootPath] local_variable[type[String], channelRootPath] local_variable[type[String], nodeRootPath] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rootPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), MemberReference(member=PERSISTENT, postfix_operators=[], prefix_operators=[], qualifier=CreateMode, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=zookeeper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=channelRootPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), MemberReference(member=PERSISTENT, postfix_operators=[], prefix_operators=[], qualifier=CreateMode, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=zookeeper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodeRootPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), MemberReference(member=PERSISTENT, postfix_operators=[], prefix_operators=[], qualifier=CreateMode, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=zookeeper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ZkNodeExistsException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="system_init"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArbitrateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ZkException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[init] operator[SEP] operator[SEP] { identifier[String] identifier[rootPath] operator[=] identifier[ManagePathUtils] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[channelRootPath] operator[=] identifier[ManagePathUtils] operator[SEP] identifier[getChannelRoot] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[nodeRootPath] operator[=] identifier[ManagePathUtils] operator[SEP] identifier[getNodeRoot] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[zookeeper] operator[SEP] identifier[create] operator[SEP] identifier[rootPath] , Keyword[new] Keyword[byte] operator[SEP] Other[0] operator[SEP] , identifier[CreateMode] operator[SEP] identifier[PERSISTENT] operator[SEP] operator[SEP] identifier[zookeeper] operator[SEP] identifier[create] operator[SEP] identifier[channelRootPath] , Keyword[new] Keyword[byte] operator[SEP] Other[0] operator[SEP] , identifier[CreateMode] operator[SEP] identifier[PERSISTENT] operator[SEP] operator[SEP] identifier[zookeeper] operator[SEP] identifier[create] operator[SEP] identifier[nodeRootPath] , Keyword[new] Keyword[byte] operator[SEP] Other[0] operator[SEP] , identifier[CreateMode] operator[SEP] identifier[PERSISTENT] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ZkNodeExistsException] identifier[e] operator[SEP] { } Keyword[catch] operator[SEP] identifier[ZkException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ArbitrateException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
private boolean isOrContains(SoyType type, SoyType.Kind kind) { if (type.getKind() == kind) { return true; } if (type.getKind() == SoyType.Kind.UNION) { for (SoyType member : ((UnionType) type).getMembers()) { if (member.getKind() == kind) { return true; } } } return false; }
class class_name[name] begin[{] method[isOrContains, return_type[type[boolean]], modifier[private], parameter[type, kind]] begin[{] if[binary_operation[call[type.getKind, parameter[]], ==, member[.kind]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[call[type.getKind, parameter[]], ==, member[SoyType.Kind.UNION]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getKind, postfix_operators=[], prefix_operators=[], qualifier=member, selectors=[], type_arguments=None), operandr=MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=UnionType, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=member)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SoyType, sub_type=None))), label=None) else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isOrContains] operator[SEP] identifier[SoyType] identifier[type] , identifier[SoyType] operator[SEP] identifier[Kind] identifier[kind] operator[SEP] { Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[==] identifier[kind] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[==] identifier[SoyType] operator[SEP] identifier[Kind] operator[SEP] identifier[UNION] operator[SEP] { Keyword[for] operator[SEP] identifier[SoyType] identifier[member] operator[:] operator[SEP] operator[SEP] identifier[UnionType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getMembers] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[member] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[==] identifier[kind] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
@Override public void clearCache() { entityCache.clearCache(CommerceUserSegmentEntryImpl.class); finderCache.clearCache(FINDER_CLASS_NAME_ENTITY); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); }
class class_name[name] begin[{] method[clearCache, return_type[void], modifier[public], parameter[]] begin[{] call[entityCache.clearCache, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceUserSegmentEntryImpl, sub_type=None))]] call[finderCache.clearCache, parameter[member[.FINDER_CLASS_NAME_ENTITY]]] call[finderCache.clearCache, parameter[member[.FINDER_CLASS_NAME_LIST_WITH_PAGINATION]]] call[finderCache.clearCache, parameter[member[.FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[clearCache] operator[SEP] operator[SEP] { identifier[entityCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[CommerceUserSegmentEntryImpl] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[finderCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[FINDER_CLASS_NAME_ENTITY] operator[SEP] operator[SEP] identifier[finderCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[FINDER_CLASS_NAME_LIST_WITH_PAGINATION] operator[SEP] operator[SEP] identifier[finderCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") protected List getUserRoles(DirContext dirContext, String username) throws LoginException, NamingException { String userDn = _userRdnAttribute + "=" + username + "," + _userBaseDn; return getUserRolesByDn(dirContext, userDn, username); }
class class_name[name] begin[{] method[getUserRoles, return_type[type[List]], modifier[protected], parameter[dirContext, username]] begin[{] local_variable[type[String], userDn] return[call[.getUserRolesByDn, parameter[member[.dirContext], member[.userDn], member[.username]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[protected] identifier[List] identifier[getUserRoles] operator[SEP] identifier[DirContext] identifier[dirContext] , identifier[String] identifier[username] operator[SEP] Keyword[throws] identifier[LoginException] , identifier[NamingException] { identifier[String] identifier[userDn] operator[=] identifier[_userRdnAttribute] operator[+] literal[String] operator[+] identifier[username] operator[+] literal[String] operator[+] identifier[_userBaseDn] operator[SEP] Keyword[return] identifier[getUserRolesByDn] operator[SEP] identifier[dirContext] , identifier[userDn] , identifier[username] operator[SEP] operator[SEP] }
public static void parseLinks(CmsObject cms, List<CmsResource> parseables, I_CmsReport report) { int i = 0; sortParseableResources(parseables); for (CmsResource parsableRes : parseables) { String resName = cms.getSitePath(parsableRes); report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(i + 1), String.valueOf(parseables.size())), I_CmsReport.FORMAT_NOTE); LOG.info("Rewriting parsable resource: " + resName); report.print(Messages.get().container(Messages.RPT_PARSE_LINKS_FOR_1, resName), I_CmsReport.FORMAT_NOTE); report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); try { CmsFile file = cms.readFile(resName); // make sure the date last modified is kept... file.setDateLastModified(file.getDateLastModified()); // make sure the file is locked CmsLock lock = cms.getLock(file); if (lock.isUnlocked()) { cms.lockResource(resName); } else if (!lock.isDirectlyOwnedInProjectBy(cms)) { cms.changeLock(resName); } // rewrite the file cms.writeFile(file); report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK); } catch (Throwable e) { report.addWarning(e); report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_FAILED_0), I_CmsReport.FORMAT_ERROR); if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_IMPORTEXPORT_REWRITING_1, resName)); LOG.warn(e.getMessage(), e); } if (LOG.isDebugEnabled()) { LOG.debug(e.getLocalizedMessage(), e); } } i++; } cms.getRequestContext().removeAttribute(CmsLogEntry.ATTR_LOG_ENTRY); }
class class_name[name] begin[{] method[parseLinks, return_type[void], modifier[public static], parameter[cms, parseables, report]] begin[{] local_variable[type[int], i] call[.sortParseableResources, parameter[member[.parseables]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=parsableRes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSitePath, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[], type_arguments=None), name=resName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_SUCCESSION_2, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[]), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=parseables, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_NOTE, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Rewriting parsable resource: "), operandr=MemberReference(member=resName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_PARSE_LINKS_FOR_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=resName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_NOTE, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_DOTS_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=print, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=resName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFile, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[], type_arguments=None), name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsFile, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDateLastModified, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], member=setDateLastModified, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLock, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[], type_arguments=None), name=lock)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsLock, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isUnlocked, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDirectlyOwnedInProjectBy, postfix_operators=[], prefix_operators=['!'], qualifier=lock, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=changeLock, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lockResource, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeFile, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_OK_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_OK, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addWarning, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=RPT_FAILED_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.report.Messages, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=FORMAT_ERROR, postfix_operators=[], prefix_operators=[], qualifier=I_CmsReport, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=report, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isWarnEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_IMPORTEXPORT_REWRITING_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=resName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=parseables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=parsableRes)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=None))), label=None) call[cms.getRequestContext, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[parseLinks] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[parseables] , identifier[I_CmsReport] identifier[report] operator[SEP] { Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[sortParseableResources] operator[SEP] identifier[parseables] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsResource] identifier[parsableRes] operator[:] identifier[parseables] operator[SEP] { identifier[String] identifier[resName] operator[=] identifier[cms] operator[SEP] identifier[getSitePath] operator[SEP] identifier[parsableRes] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_SUCCESSION_2] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[parseables] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[resName] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_PARSE_LINKS_FOR_1] , identifier[resName] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_DOTS_0] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[CmsFile] identifier[file] operator[=] identifier[cms] operator[SEP] identifier[readFile] operator[SEP] identifier[resName] operator[SEP] operator[SEP] identifier[file] operator[SEP] identifier[setDateLastModified] operator[SEP] identifier[file] operator[SEP] identifier[getDateLastModified] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CmsLock] identifier[lock] operator[=] identifier[cms] operator[SEP] identifier[getLock] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lock] operator[SEP] identifier[isUnlocked] operator[SEP] operator[SEP] operator[SEP] { identifier[cms] operator[SEP] identifier[lockResource] operator[SEP] identifier[resName] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[lock] operator[SEP] identifier[isDirectlyOwnedInProjectBy] operator[SEP] identifier[cms] operator[SEP] operator[SEP] { identifier[cms] operator[SEP] identifier[changeLock] operator[SEP] identifier[resName] operator[SEP] operator[SEP] } identifier[cms] operator[SEP] identifier[writeFile] operator[SEP] identifier[file] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_OK_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_OK] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[report] operator[SEP] identifier[addWarning] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[report] operator[SEP] identifier[println] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_FAILED_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_ERROR] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isWarnEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_IMPORTEXPORT_REWRITING_1] , identifier[resName] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[warn] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } identifier[i] operator[++] operator[SEP] } identifier[cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[removeAttribute] operator[SEP] identifier[CmsLogEntry] operator[SEP] identifier[ATTR_LOG_ENTRY] operator[SEP] operator[SEP] }
public void setDestinations(java.util.Collection<DestinationDescription> destinations) { if (destinations == null) { this.destinations = null; return; } this.destinations = new java.util.ArrayList<DestinationDescription>(destinations); }
class class_name[name] begin[{] method[setDestinations, return_type[void], modifier[public], parameter[destinations]] begin[{] if[binary_operation[member[.destinations], ==, literal[null]]] begin[{] assign[THIS[member[None.destinations]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.destinations]], ClassCreator(arguments=[MemberReference(member=destinations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DestinationDescription, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDestinations] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[DestinationDescription] operator[>] identifier[destinations] operator[SEP] { Keyword[if] operator[SEP] identifier[destinations] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[destinations] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[destinations] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[DestinationDescription] operator[>] operator[SEP] identifier[destinations] operator[SEP] operator[SEP] }
protected String addMessageNoCaching(InternalEvent msg, EngineDataAccess edao, String msgid) throws SQLException { if (cacheOption==CACHE_ONLY) { return null; } else { // CACHE_ON/CACHE_OFF edao.persistInternalEvent(msgid, msg.toXml()); return msgid; } }
class class_name[name] begin[{] method[addMessageNoCaching, return_type[type[String]], modifier[protected], parameter[msg, edao, msgid]] begin[{] if[binary_operation[member[.cacheOption], ==, member[.CACHE_ONLY]]] begin[{] return[literal[null]] else begin[{] call[edao.persistInternalEvent, parameter[member[.msgid], call[msg.toXml, parameter[]]]] return[member[.msgid]] end[}] end[}] END[}]
Keyword[protected] identifier[String] identifier[addMessageNoCaching] operator[SEP] identifier[InternalEvent] identifier[msg] , identifier[EngineDataAccess] identifier[edao] , identifier[String] identifier[msgid] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[if] operator[SEP] identifier[cacheOption] operator[==] identifier[CACHE_ONLY] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { identifier[edao] operator[SEP] identifier[persistInternalEvent] operator[SEP] identifier[msgid] , identifier[msg] operator[SEP] identifier[toXml] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[msgid] operator[SEP] } }
public static AlertDto transformToDto(Alert alert) { if (alert == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } AlertDto result = createDtoObject(AlertDto.class, alert); result.setOwnerName(alert.getOwner().getUserName()); for (Trigger trigger : alert.getTriggers()) { result.addTriggersIds(trigger); } for (Notification notification : alert.getNotifications()) { result.addNotificationsIds(notification); } return result; }
class class_name[name] begin[{] method[transformToDto, return_type[type[AlertDto]], modifier[public static], parameter[alert]] begin[{] if[binary_operation[member[.alert], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Null entity object cannot be converted to Dto object."), MemberReference(member=INTERNAL_SERVER_ERROR, postfix_operators=[], prefix_operators=[], qualifier=Status, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WebApplicationException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[AlertDto], result] call[result.setOwnerName, parameter[call[alert.getOwner, parameter[]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=trigger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addTriggersIds, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getTriggers, postfix_operators=[], prefix_operators=[], qualifier=alert, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=trigger)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Trigger, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=notification, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addNotificationsIds, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getNotifications, postfix_operators=[], prefix_operators=[], qualifier=alert, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=notification)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Notification, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[AlertDto] identifier[transformToDto] operator[SEP] identifier[Alert] identifier[alert] operator[SEP] { Keyword[if] operator[SEP] identifier[alert] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[WebApplicationException] operator[SEP] literal[String] , identifier[Status] operator[SEP] identifier[INTERNAL_SERVER_ERROR] operator[SEP] operator[SEP] } identifier[AlertDto] identifier[result] operator[=] identifier[createDtoObject] operator[SEP] identifier[AlertDto] operator[SEP] Keyword[class] , identifier[alert] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setOwnerName] operator[SEP] identifier[alert] operator[SEP] identifier[getOwner] operator[SEP] operator[SEP] operator[SEP] identifier[getUserName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Trigger] identifier[trigger] operator[:] identifier[alert] operator[SEP] identifier[getTriggers] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[addTriggersIds] operator[SEP] identifier[trigger] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Notification] identifier[notification] operator[:] identifier[alert] operator[SEP] identifier[getNotifications] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[addNotificationsIds] operator[SEP] identifier[notification] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public static String addsPfad(String pfad1, String pfad2) { String ret = ""; if (pfad1 != null && pfad2 != null) { if (pfad1.isEmpty()) { ret = pfad2; } else if (pfad2.isEmpty()) { ret = pfad1; } else if (!pfad1.isEmpty() && !pfad2.isEmpty()) { if (pfad1.endsWith(File.separator)) { ret = pfad1.substring(0, pfad1.length() - 1); } else { ret = pfad1; } if (pfad2.charAt(0) == File.separatorChar) { ret += pfad2; } else { ret += File.separator + pfad2; } } } if (ret.isEmpty()) { Log.errorLog(283946015, pfad1 + " - " + pfad2); } return ret; }
class class_name[name] begin[{] method[addsPfad, return_type[type[String]], modifier[public static], parameter[pfad1, pfad2]] begin[{] local_variable[type[String], ret] if[binary_operation[binary_operation[member[.pfad1], !=, literal[null]], &&, binary_operation[member[.pfad2], !=, literal[null]]]] begin[{] if[call[pfad1.isEmpty, parameter[]]] begin[{] assign[member[.ret], member[.pfad2]] else begin[{] if[call[pfad2.isEmpty, parameter[]]] begin[{] assign[member[.ret], member[.pfad1]] else begin[{] if[binary_operation[call[pfad1.isEmpty, parameter[]], &&, call[pfad2.isEmpty, parameter[]]]] begin[{] if[call[pfad1.endsWith, parameter[member[File.separator]]]] begin[{] assign[member[.ret], call[pfad1.substring, parameter[literal[0], binary_operation[call[pfad1.length, parameter[]], -, literal[1]]]]] else begin[{] assign[member[.ret], member[.pfad1]] end[}] if[binary_operation[call[pfad2.charAt, parameter[literal[0]]], ==, member[File.separatorChar]]] begin[{] assign[member[.ret], member[.pfad2]] else begin[{] assign[member[.ret], binary_operation[member[File.separator], +, member[.pfad2]]] end[}] else begin[{] None end[}] end[}] end[}] else begin[{] None end[}] if[call[ret.isEmpty, parameter[]]] begin[{] call[Log.errorLog, parameter[literal[283946015], binary_operation[binary_operation[member[.pfad1], +, literal[" - "]], +, member[.pfad2]]]] else begin[{] None end[}] return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[addsPfad] operator[SEP] identifier[String] identifier[pfad1] , identifier[String] identifier[pfad2] operator[SEP] { identifier[String] identifier[ret] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[pfad1] operator[!=] Other[null] operator[&&] identifier[pfad2] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[pfad1] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[ret] operator[=] identifier[pfad2] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[pfad2] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[ret] operator[=] identifier[pfad1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[pfad1] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[pfad2] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[pfad1] operator[SEP] identifier[endsWith] operator[SEP] identifier[File] operator[SEP] identifier[separator] operator[SEP] operator[SEP] { identifier[ret] operator[=] identifier[pfad1] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[pfad1] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[else] { identifier[ret] operator[=] identifier[pfad1] operator[SEP] } Keyword[if] operator[SEP] identifier[pfad2] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] identifier[File] operator[SEP] identifier[separatorChar] operator[SEP] { identifier[ret] operator[+=] identifier[pfad2] operator[SEP] } Keyword[else] { identifier[ret] operator[+=] identifier[File] operator[SEP] identifier[separator] operator[+] identifier[pfad2] operator[SEP] } } } Keyword[if] operator[SEP] identifier[ret] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Log] operator[SEP] identifier[errorLog] operator[SEP] Other[283946015] , identifier[pfad1] operator[+] literal[String] operator[+] identifier[pfad2] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { if (minuendInstant < subtrahendInstant) { return -getDifference(subtrahendInstant, minuendInstant); } int minuendYear = iChronology.getYear(minuendInstant); int minuendMonth = iChronology.getMonthOfYear(minuendInstant, minuendYear); int subtrahendYear = iChronology.getYear(subtrahendInstant); int subtrahendMonth = iChronology.getMonthOfYear(subtrahendInstant, subtrahendYear); long difference = (minuendYear - subtrahendYear) * ((long) iMax) + minuendMonth - subtrahendMonth; // Before adjusting for remainder, account for special case of add // where the day-of-month is forced to the nearest sane value. int minuendDom = iChronology.getDayOfMonth (minuendInstant, minuendYear, minuendMonth); if (minuendDom == iChronology.getDaysInYearMonth(minuendYear, minuendMonth)) { // Last day of the minuend month... int subtrahendDom = iChronology.getDayOfMonth (subtrahendInstant, subtrahendYear, subtrahendMonth); if (subtrahendDom > minuendDom) { // ...and day of subtrahend month is larger. // Note: This works fine, but it ideally shouldn't invoke other // fields from within a field. subtrahendInstant = iChronology.dayOfMonth().set(subtrahendInstant, minuendDom); } } // Inlined remainder method to avoid duplicate calls. long minuendRem = minuendInstant - iChronology.getYearMonthMillis(minuendYear, minuendMonth); long subtrahendRem = subtrahendInstant - iChronology.getYearMonthMillis(subtrahendYear, subtrahendMonth); if (minuendRem < subtrahendRem) { difference--; } return difference; }
class class_name[name] begin[{] method[getDifferenceAsLong, return_type[type[long]], modifier[public], parameter[minuendInstant, subtrahendInstant]] begin[{] if[binary_operation[member[.minuendInstant], <, member[.subtrahendInstant]]] begin[{] return[call[.getDifference, parameter[member[.subtrahendInstant], member[.minuendInstant]]]] else begin[{] None end[}] local_variable[type[int], minuendYear] local_variable[type[int], minuendMonth] local_variable[type[int], subtrahendYear] local_variable[type[int], subtrahendMonth] local_variable[type[long], difference] local_variable[type[int], minuendDom] if[binary_operation[member[.minuendDom], ==, call[iChronology.getDaysInYearMonth, parameter[member[.minuendYear], member[.minuendMonth]]]]] begin[{] local_variable[type[int], subtrahendDom] if[binary_operation[member[.subtrahendDom], >, member[.minuendDom]]] begin[{] assign[member[.subtrahendInstant], call[iChronology.dayOfMonth, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[long], minuendRem] local_variable[type[long], subtrahendRem] if[binary_operation[member[.minuendRem], <, member[.subtrahendRem]]] begin[{] member[.difference] else begin[{] None end[}] return[member[.difference]] end[}] END[}]
Keyword[public] Keyword[long] identifier[getDifferenceAsLong] operator[SEP] Keyword[long] identifier[minuendInstant] , Keyword[long] identifier[subtrahendInstant] operator[SEP] { Keyword[if] operator[SEP] identifier[minuendInstant] operator[<] identifier[subtrahendInstant] operator[SEP] { Keyword[return] operator[-] identifier[getDifference] operator[SEP] identifier[subtrahendInstant] , identifier[minuendInstant] operator[SEP] operator[SEP] } Keyword[int] identifier[minuendYear] operator[=] identifier[iChronology] operator[SEP] identifier[getYear] operator[SEP] identifier[minuendInstant] operator[SEP] operator[SEP] Keyword[int] identifier[minuendMonth] operator[=] identifier[iChronology] operator[SEP] identifier[getMonthOfYear] operator[SEP] identifier[minuendInstant] , identifier[minuendYear] operator[SEP] operator[SEP] Keyword[int] identifier[subtrahendYear] operator[=] identifier[iChronology] operator[SEP] identifier[getYear] operator[SEP] identifier[subtrahendInstant] operator[SEP] operator[SEP] Keyword[int] identifier[subtrahendMonth] operator[=] identifier[iChronology] operator[SEP] identifier[getMonthOfYear] operator[SEP] identifier[subtrahendInstant] , identifier[subtrahendYear] operator[SEP] operator[SEP] Keyword[long] identifier[difference] operator[=] operator[SEP] identifier[minuendYear] operator[-] identifier[subtrahendYear] operator[SEP] operator[*] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[iMax] operator[SEP] operator[+] identifier[minuendMonth] operator[-] identifier[subtrahendMonth] operator[SEP] Keyword[int] identifier[minuendDom] operator[=] identifier[iChronology] operator[SEP] identifier[getDayOfMonth] operator[SEP] identifier[minuendInstant] , identifier[minuendYear] , identifier[minuendMonth] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[minuendDom] operator[==] identifier[iChronology] operator[SEP] identifier[getDaysInYearMonth] operator[SEP] identifier[minuendYear] , identifier[minuendMonth] operator[SEP] operator[SEP] { Keyword[int] identifier[subtrahendDom] operator[=] identifier[iChronology] operator[SEP] identifier[getDayOfMonth] operator[SEP] identifier[subtrahendInstant] , identifier[subtrahendYear] , identifier[subtrahendMonth] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[subtrahendDom] operator[>] identifier[minuendDom] operator[SEP] { identifier[subtrahendInstant] operator[=] identifier[iChronology] operator[SEP] identifier[dayOfMonth] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[subtrahendInstant] , identifier[minuendDom] operator[SEP] operator[SEP] } } Keyword[long] identifier[minuendRem] operator[=] identifier[minuendInstant] operator[-] identifier[iChronology] operator[SEP] identifier[getYearMonthMillis] operator[SEP] identifier[minuendYear] , identifier[minuendMonth] operator[SEP] operator[SEP] Keyword[long] identifier[subtrahendRem] operator[=] identifier[subtrahendInstant] operator[-] identifier[iChronology] operator[SEP] identifier[getYearMonthMillis] operator[SEP] identifier[subtrahendYear] , identifier[subtrahendMonth] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[minuendRem] operator[<] identifier[subtrahendRem] operator[SEP] { identifier[difference] operator[--] operator[SEP] } Keyword[return] identifier[difference] operator[SEP] }
@SuppressWarnings("unchecked") private Set<Dependency<?>> getInternalDependencies(BindingImpl<?> binding) { if (binding instanceof ConstructorBindingImpl) { return ((ConstructorBindingImpl) binding).getInternalDependencies(); } else if (binding instanceof HasDependencies) { return ((HasDependencies) binding).getDependencies(); } else { return ImmutableSet.of(); } }
class class_name[name] begin[{] method[getInternalDependencies, return_type[type[Set]], modifier[private], parameter[binding]] begin[{] if[binary_operation[member[.binding], instanceof, type[ConstructorBindingImpl]]] begin[{] return[Cast(expression=MemberReference(member=binding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ConstructorBindingImpl, sub_type=None))] else begin[{] if[binary_operation[member[.binding], instanceof, type[HasDependencies]]] begin[{] return[Cast(expression=MemberReference(member=binding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HasDependencies, sub_type=None))] else begin[{] return[call[ImmutableSet.of, parameter[]]] end[}] end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] identifier[Set] operator[<] identifier[Dependency] operator[<] operator[?] operator[>] operator[>] identifier[getInternalDependencies] operator[SEP] identifier[BindingImpl] operator[<] operator[?] operator[>] identifier[binding] operator[SEP] { Keyword[if] operator[SEP] identifier[binding] Keyword[instanceof] identifier[ConstructorBindingImpl] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[ConstructorBindingImpl] operator[SEP] identifier[binding] operator[SEP] operator[SEP] identifier[getInternalDependencies] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[binding] Keyword[instanceof] identifier[HasDependencies] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[HasDependencies] operator[SEP] identifier[binding] operator[SEP] operator[SEP] identifier[getDependencies] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[ImmutableSet] operator[SEP] identifier[of] operator[SEP] operator[SEP] operator[SEP] } }
public void dumpRequest(final HttpServletRequest req) { try { Enumeration names = req.getHeaderNames(); String title = "Request headers"; debug(title); while (names.hasMoreElements()) { String key = (String)names.nextElement(); String val = req.getHeader(key); debug(" " + key + " = \"" + val + "\""); } names = req.getParameterNames(); title = "Request parameters"; debug(title + " - global info and uris"); debug("getRemoteAddr = " + req.getRemoteAddr()); debug("getRequestURI = " + req.getRequestURI()); debug("getRemoteUser = " + req.getRemoteUser()); debug("getRequestedSessionId = " + req.getRequestedSessionId()); debug("HttpUtils.getRequestURL(req) = " + req.getRequestURL()); debug("contextPath=" + req.getContextPath()); debug("query=" + req.getQueryString()); debug("contentlen=" + req.getContentLength()); debug("request=" + req); debug("parameters:"); debug(title); while (names.hasMoreElements()) { String key = (String)names.nextElement(); String val = req.getParameter(key); debug(" " + key + " = \"" + val + "\""); } } catch (Throwable t) { } }
class class_name[name] begin[{] method[dumpRequest, return_type[void], modifier[public], parameter[req]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getHeaderNames, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), name=names)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Enumeration, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request headers"), name=title)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=title, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getHeader, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" = \""), operator=+), operandr=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getParameterNames, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=title, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request parameters")), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=title, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - global info and uris"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getRemoteAddr = "), operandr=MethodInvocation(arguments=[], member=getRemoteAddr, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getRequestURI = "), operandr=MethodInvocation(arguments=[], member=getRequestURI, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getRemoteUser = "), operandr=MethodInvocation(arguments=[], member=getRemoteUser, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getRequestedSessionId = "), operandr=MethodInvocation(arguments=[], member=getRequestedSessionId, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="HttpUtils.getRequestURL(req) = "), operandr=MethodInvocation(arguments=[], member=getRequestURL, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="contextPath="), operandr=MethodInvocation(arguments=[], member=getContextPath, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="query="), operandr=MethodInvocation(arguments=[], member=getQueryString, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="contentlen="), operandr=MethodInvocation(arguments=[], member=getContentLength, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="request="), operandr=MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="parameters:")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=title, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParameter, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" = \""), operator=+), operandr=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[dumpRequest] operator[SEP] Keyword[final] identifier[HttpServletRequest] identifier[req] operator[SEP] { Keyword[try] { identifier[Enumeration] identifier[names] operator[=] identifier[req] operator[SEP] identifier[getHeaderNames] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[title] operator[=] literal[String] operator[SEP] identifier[debug] operator[SEP] identifier[title] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[names] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[key] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[names] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[val] operator[=] identifier[req] operator[SEP] identifier[getHeader] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[val] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[names] operator[=] identifier[req] operator[SEP] identifier[getParameterNames] operator[SEP] operator[SEP] operator[SEP] identifier[title] operator[=] literal[String] operator[SEP] identifier[debug] operator[SEP] identifier[title] operator[+] literal[String] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[getRemoteAddr] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[getRequestURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[getRemoteUser] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[getRequestedSessionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[getRequestURL] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[getContextPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[getQueryString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[debug] operator[SEP] identifier[title] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[names] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[key] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[names] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[val] operator[=] identifier[req] operator[SEP] identifier[getParameter] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[val] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { } }
@Test public void getControlGroupReturnsControlGroup() { server().enqueue(new MockResponse().setBody("<html><body>" + "<form name='f'>" + "<input type='text' name='x'/>" + "<input type='text' name='x'/>" + "</form>" + "</body></html>")); ControlGroup actual = newBrowser().get(url(server())) .getForm("f") .getControlGroup("x"); assertThat("form control group", actual.getName(), is("x")); }
class class_name[name] begin[{] method[getControlGroupReturnsControlGroup, return_type[void], modifier[public], parameter[]] begin[{] call[.server, parameter[]] local_variable[type[ControlGroup], actual] call[.assertThat, parameter[literal["form control group"], call[actual.getName, parameter[]], call[.is, parameter[literal["x"]]]]] end[}] END[}]
annotation[@] identifier[Test] Keyword[public] Keyword[void] identifier[getControlGroupReturnsControlGroup] operator[SEP] operator[SEP] { identifier[server] operator[SEP] operator[SEP] operator[SEP] identifier[enqueue] operator[SEP] Keyword[new] identifier[MockResponse] operator[SEP] operator[SEP] operator[SEP] identifier[setBody] operator[SEP] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ControlGroup] identifier[actual] operator[=] identifier[newBrowser] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[url] operator[SEP] identifier[server] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getForm] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getControlGroup] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[assertThat] operator[SEP] literal[String] , identifier[actual] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[is] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] }
protected static void removeInstance( Object instance ) { Set set = getCycleSet(); set.remove( instance ); if(set.size() == 0) { cycleSet.remove(); } }
class class_name[name] begin[{] method[removeInstance, return_type[void], modifier[static protected], parameter[instance]] begin[{] local_variable[type[Set], set] call[set.remove, parameter[member[.instance]]] if[binary_operation[call[set.size, parameter[]], ==, literal[0]]] begin[{] call[cycleSet.remove, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[void] identifier[removeInstance] operator[SEP] identifier[Object] identifier[instance] operator[SEP] { identifier[Set] identifier[set] operator[=] identifier[getCycleSet] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[remove] operator[SEP] identifier[instance] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[set] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[cycleSet] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } }
public boolean isTrusted(X509Certificate certificate, Store certStore) throws CryptoException { try { if (certificate == null) { throw new CryptoException("Invalid input parameter. Certificate can not be null"); } LOGGER.info("Checking if certificate with subjectDN={} is trusted", certificate.getSubjectDN()); Store certificateStore = certStore; if (certificateStore == null) { certificateStore = new JcaCertStore(new ArrayList()); } checkConstraints(certSelector, certificate); X509CertSelector selector = new X509CertSelector(); selector.setCertificate(certificate); CertStore pkixParamsCertStore = new JcaCertStoreBuilder().addCertificates(certificateStore).build(); PKIXBuilderParameters buildParams = new PKIXBuilderParameters(keyStore, selector); buildParams.addCertStore(pkixParamsCertStore); buildParams.setRevocationEnabled(false); CertPathBuilder builder = CertPathBuilder.getInstance(ALGORITHM_PKIX); PKIXCertPathBuilderResult result = (PKIXCertPathBuilderResult) builder.build(buildParams); // Build certificate path CertPath certPath = result.getCertPath(); // Set validation parameters PKIXParameters params = new PKIXParameters(keyStore); params.setRevocationEnabled(false); // Validate certificate path CertPathValidator validator = CertPathValidator.getInstance(ALGORITHM_PKIX); validator.validate(certPath, params); return true; } catch (CertPathValidatorException e) { LOGGER.debug("Cert path validation failed", e); return false; } catch (CertPathBuilderException e) { LOGGER.debug("Cert path building failed", e); return false; } catch (GeneralSecurityException e) { throw new CryptoException("General security error occurred. " + e.getMessage(), e); } }
class class_name[name] begin[{] method[isTrusted, return_type[type[boolean]], modifier[public], parameter[certificate, certStore]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=certificate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid input parameter. Certificate can not be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CryptoException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Checking if certificate with subjectDN={} is trusted"), MethodInvocation(arguments=[], member=getSubjectDN, postfix_operators=[], prefix_operators=[], qualifier=certificate, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=certStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=certificateStore)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Store, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=certificateStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=certificateStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JcaCertStore, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=certSelector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=certificate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkConstraints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=X509CertSelector, sub_type=None)), name=selector)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=X509CertSelector, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=certificate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCertificate, postfix_operators=[], prefix_operators=[], qualifier=selector, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=certificateStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addCertificates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JcaCertStoreBuilder, sub_type=None)), name=pkixParamsCertStore)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CertStore, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=keyStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=selector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PKIXBuilderParameters, sub_type=None)), name=buildParams)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PKIXBuilderParameters, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pkixParamsCertStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addCertStore, postfix_operators=[], prefix_operators=[], qualifier=buildParams, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setRevocationEnabled, postfix_operators=[], prefix_operators=[], qualifier=buildParams, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ALGORITHM_PKIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=CertPathBuilder, selectors=[], type_arguments=None), name=builder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CertPathBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=buildParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=PKIXCertPathBuilderResult, sub_type=None)), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PKIXCertPathBuilderResult, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCertPath, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), name=certPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CertPath, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=keyStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PKIXParameters, sub_type=None)), name=params)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PKIXParameters, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setRevocationEnabled, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ALGORITHM_PKIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=CertPathValidator, selectors=[], type_arguments=None), name=validator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CertPathValidator, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=certPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validate, postfix_operators=[], prefix_operators=[], qualifier=validator, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cert path validation failed"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CertPathValidatorException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cert path building failed"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CertPathBuilderException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="General security error occurred. "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CryptoException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['GeneralSecurityException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isTrusted] operator[SEP] identifier[X509Certificate] identifier[certificate] , identifier[Store] identifier[certStore] operator[SEP] Keyword[throws] identifier[CryptoException] { Keyword[try] { Keyword[if] operator[SEP] identifier[certificate] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[CryptoException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[certificate] operator[SEP] identifier[getSubjectDN] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Store] identifier[certificateStore] operator[=] identifier[certStore] operator[SEP] Keyword[if] operator[SEP] identifier[certificateStore] operator[==] Other[null] operator[SEP] { identifier[certificateStore] operator[=] Keyword[new] identifier[JcaCertStore] operator[SEP] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[checkConstraints] operator[SEP] identifier[certSelector] , identifier[certificate] operator[SEP] operator[SEP] identifier[X509CertSelector] identifier[selector] operator[=] Keyword[new] identifier[X509CertSelector] operator[SEP] operator[SEP] operator[SEP] identifier[selector] operator[SEP] identifier[setCertificate] operator[SEP] identifier[certificate] operator[SEP] operator[SEP] identifier[CertStore] identifier[pkixParamsCertStore] operator[=] Keyword[new] identifier[JcaCertStoreBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[addCertificates] operator[SEP] identifier[certificateStore] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[PKIXBuilderParameters] identifier[buildParams] operator[=] Keyword[new] identifier[PKIXBuilderParameters] operator[SEP] identifier[keyStore] , identifier[selector] operator[SEP] operator[SEP] identifier[buildParams] operator[SEP] identifier[addCertStore] operator[SEP] identifier[pkixParamsCertStore] operator[SEP] operator[SEP] identifier[buildParams] operator[SEP] identifier[setRevocationEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[CertPathBuilder] identifier[builder] operator[=] identifier[CertPathBuilder] operator[SEP] identifier[getInstance] operator[SEP] identifier[ALGORITHM_PKIX] operator[SEP] operator[SEP] identifier[PKIXCertPathBuilderResult] identifier[result] operator[=] operator[SEP] identifier[PKIXCertPathBuilderResult] operator[SEP] identifier[builder] operator[SEP] identifier[build] operator[SEP] identifier[buildParams] operator[SEP] operator[SEP] identifier[CertPath] identifier[certPath] operator[=] identifier[result] operator[SEP] identifier[getCertPath] operator[SEP] operator[SEP] operator[SEP] identifier[PKIXParameters] identifier[params] operator[=] Keyword[new] identifier[PKIXParameters] operator[SEP] identifier[keyStore] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[setRevocationEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[CertPathValidator] identifier[validator] operator[=] identifier[CertPathValidator] operator[SEP] identifier[getInstance] operator[SEP] identifier[ALGORITHM_PKIX] operator[SEP] operator[SEP] identifier[validator] operator[SEP] identifier[validate] operator[SEP] identifier[certPath] , identifier[params] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[CertPathValidatorException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[CertPathBuilderException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[GeneralSecurityException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CryptoException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public java.util.List<PatchFilter> getPatchFilters() { if (patchFilters == null) { patchFilters = new com.amazonaws.internal.SdkInternalList<PatchFilter>(); } return patchFilters; }
class class_name[name] begin[{] method[getPatchFilters, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.patchFilters], ==, literal[null]]] begin[{] assign[member[.patchFilters], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PatchFilter, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.patchFilters]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[PatchFilter] operator[>] identifier[getPatchFilters] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[patchFilters] operator[==] Other[null] operator[SEP] { identifier[patchFilters] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[PatchFilter] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[patchFilters] operator[SEP] }
public static void verifyValueBounds(DateTimeField field, int value, int lowerBound, int upperBound) { if ((value < lowerBound) || (value > upperBound)) { throw new IllegalFieldValueException (field.getType(), Integer.valueOf(value), Integer.valueOf(lowerBound), Integer.valueOf(upperBound)); } }
class class_name[name] begin[{] method[verifyValueBounds, return_type[void], modifier[public static], parameter[field, value, lowerBound, upperBound]] begin[{] if[binary_operation[binary_operation[member[.value], <, member[.lowerBound]], ||, binary_operation[member[.value], >, member[.upperBound]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=lowerBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=upperBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalFieldValueException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[verifyValueBounds] operator[SEP] identifier[DateTimeField] identifier[field] , Keyword[int] identifier[value] , Keyword[int] identifier[lowerBound] , Keyword[int] identifier[upperBound] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[value] operator[<] identifier[lowerBound] operator[SEP] operator[||] operator[SEP] identifier[value] operator[>] identifier[upperBound] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalFieldValueException] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[lowerBound] operator[SEP] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[upperBound] operator[SEP] operator[SEP] operator[SEP] } }
public static String getReplyCodeAsString(byte code) { switch (code) { // v4 & v4a codes case V4_REPLY_REQUEST_GRANTED: return "Request granted"; case V4_REPLY_REQUEST_REJECTED_OR_FAILED: return "Request rejected or failed"; case V4_REPLY_REQUEST_FAILED_NO_IDENTD: return "Request failed because client is not running identd (or not reachable from the server)"; case V4_REPLY_REQUEST_FAILED_ID_NOT_CONFIRMED: return "Request failed because client's identd could not confirm the user ID string in the request"; // v5 codes case V5_REPLY_SUCCEEDED: return "Request succeeded"; case V5_REPLY_GENERAL_FAILURE: return "Request failed: general SOCKS server failure"; case V5_REPLY_NOT_ALLOWED: return "Request failed: connection not allowed by ruleset"; case V5_REPLY_NETWORK_UNREACHABLE: return "Request failed: network unreachable"; case V5_REPLY_HOST_UNREACHABLE: return "Request failed: host unreachable"; case V5_REPLY_CONNECTION_REFUSED: return "Request failed: connection refused"; case V5_REPLY_TTL_EXPIRED: return "Request failed: TTL expired"; case V5_REPLY_COMMAND_NOT_SUPPORTED: return "Request failed: command not supported"; case V5_REPLY_ADDRESS_TYPE_NOT_SUPPORTED: return "Request failed: address type not supported"; default: return "Unknown reply code"; } }
class class_name[name] begin[{] method[getReplyCodeAsString, return_type[type[String]], modifier[public static], parameter[code]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['V4_REPLY_REQUEST_GRANTED'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request granted"), label=None)]), SwitchStatementCase(case=['V4_REPLY_REQUEST_REJECTED_OR_FAILED'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request rejected or failed"), label=None)]), SwitchStatementCase(case=['V4_REPLY_REQUEST_FAILED_NO_IDENTD'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request failed because client is not running identd (or not reachable from the server)"), label=None)]), SwitchStatementCase(case=['V4_REPLY_REQUEST_FAILED_ID_NOT_CONFIRMED'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request failed because client's identd could not confirm the user ID string in the request"), label=None)]), SwitchStatementCase(case=['V5_REPLY_SUCCEEDED'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request succeeded"), label=None)]), SwitchStatementCase(case=['V5_REPLY_GENERAL_FAILURE'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request failed: general SOCKS server failure"), label=None)]), SwitchStatementCase(case=['V5_REPLY_NOT_ALLOWED'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request failed: connection not allowed by ruleset"), label=None)]), SwitchStatementCase(case=['V5_REPLY_NETWORK_UNREACHABLE'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request failed: network unreachable"), label=None)]), SwitchStatementCase(case=['V5_REPLY_HOST_UNREACHABLE'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request failed: host unreachable"), label=None)]), SwitchStatementCase(case=['V5_REPLY_CONNECTION_REFUSED'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request failed: connection refused"), label=None)]), SwitchStatementCase(case=['V5_REPLY_TTL_EXPIRED'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request failed: TTL expired"), label=None)]), SwitchStatementCase(case=['V5_REPLY_COMMAND_NOT_SUPPORTED'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request failed: command not supported"), label=None)]), SwitchStatementCase(case=['V5_REPLY_ADDRESS_TYPE_NOT_SUPPORTED'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request failed: address type not supported"), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown reply code"), label=None)])], expression=MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getReplyCodeAsString] operator[SEP] Keyword[byte] identifier[code] operator[SEP] { Keyword[switch] operator[SEP] identifier[code] operator[SEP] { Keyword[case] identifier[V4_REPLY_REQUEST_GRANTED] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V4_REPLY_REQUEST_REJECTED_OR_FAILED] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V4_REPLY_REQUEST_FAILED_NO_IDENTD] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V4_REPLY_REQUEST_FAILED_ID_NOT_CONFIRMED] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V5_REPLY_SUCCEEDED] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V5_REPLY_GENERAL_FAILURE] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V5_REPLY_NOT_ALLOWED] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V5_REPLY_NETWORK_UNREACHABLE] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V5_REPLY_HOST_UNREACHABLE] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V5_REPLY_CONNECTION_REFUSED] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V5_REPLY_TTL_EXPIRED] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V5_REPLY_COMMAND_NOT_SUPPORTED] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[case] identifier[V5_REPLY_ADDRESS_TYPE_NOT_SUPPORTED] operator[:] Keyword[return] literal[String] operator[SEP] Keyword[default] operator[:] Keyword[return] literal[String] operator[SEP] } }
public static String[][] createMatrix(final String[] data) { int maxNewLines = 0; for (final String col : data) { maxNewLines = Math.max(maxNewLines, Util.numNewLines(col)); } final String[][] matrix = new String[maxNewLines + 1][data.length]; for (int col = 0; col < data.length; col++) { final String[] exploded = Util.explode(data[col]); for (int row = 0; row < maxNewLines + 1; row++) { if (exploded.length > row) { matrix[row][col] = exploded[row]; } else { matrix[row][col] = ""; } } } return matrix; }
class class_name[name] begin[{] method[createMatrix, return_type[type[String]], modifier[public static], parameter[data]] begin[{] local_variable[type[int], maxNewLines] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxNewLines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=maxNewLines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=numNewLines, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=col)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[String], matrix] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=explode, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None), name=exploded)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=exploded, selectors=[]), operandr=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=exploded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=maxNewLines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=row)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=row, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=col)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=col, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.matrix]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[createMatrix] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[data] operator[SEP] { Keyword[int] identifier[maxNewLines] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[col] operator[:] identifier[data] operator[SEP] { identifier[maxNewLines] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[maxNewLines] , identifier[Util] operator[SEP] identifier[numNewLines] operator[SEP] identifier[col] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[matrix] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[maxNewLines] operator[+] Other[1] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[col] operator[=] Other[0] operator[SEP] identifier[col] operator[<] identifier[data] operator[SEP] identifier[length] operator[SEP] identifier[col] operator[++] operator[SEP] { Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[exploded] operator[=] identifier[Util] operator[SEP] identifier[explode] operator[SEP] identifier[data] operator[SEP] identifier[col] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[row] operator[=] Other[0] operator[SEP] identifier[row] operator[<] identifier[maxNewLines] operator[+] Other[1] operator[SEP] identifier[row] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[exploded] operator[SEP] identifier[length] operator[>] identifier[row] operator[SEP] { identifier[matrix] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[col] operator[SEP] operator[=] identifier[exploded] operator[SEP] identifier[row] operator[SEP] operator[SEP] } Keyword[else] { identifier[matrix] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[col] operator[SEP] operator[=] literal[String] operator[SEP] } } } Keyword[return] identifier[matrix] operator[SEP] }
protected void cleanupSessionToken(String token) { // Empty check if (sessions.isEmpty()) { return; } if (log.isDebugEnabled()) { log.debug("Removing duplicates and cleaning up sessions for site - token: " + site + " - " + token); } synchronized (this.sessions) { // If there are no more session tokens, delete all sessions HttpSessionTokensSet siteTokensSet = extension.getHttpSessionTokensSet(site); if (siteTokensSet == null) { log.info("No more session tokens. Removing all sessions..."); // Invalidate all sessions for (HttpSession session : this.sessions) { session.invalidate(); } // Remove all sessions this.sessions.clear(); this.activeSession = null; this.model.removeAllElements(); return; } // Iterate through all the sessions, eliminate the given token and eliminate any duplicates Map<String, HttpSession> uniqueSession = new HashMap<>(sessions.size()); List<HttpSession> toDelete = new LinkedList<>(); for (HttpSession session : this.sessions) { // Eliminate the token session.removeToken(token); if (session.getTokenValuesCount() == 0 && !session.isActive()) { toDelete.add(session); continue; } else { model.fireHttpSessionUpdated(session); } // If there is already a session with these tokens, mark one of them for deletion if (uniqueSession.containsKey(session.getTokenValuesString())) { HttpSession prevSession = uniqueSession.get(session.getTokenValuesString()); // If the latter session is active, put it into the map and delete the other if (session.isActive()) { toDelete.add(prevSession); session.setMessagesMatched(session.getMessagesMatched() + prevSession.getMessagesMatched()); } else { toDelete.add(session); prevSession.setMessagesMatched(session.getMessagesMatched() + prevSession.getMessagesMatched()); } } // If it's the first one with these token values, keep it else { uniqueSession.put(session.getTokenValuesString(), session); } } // Delete the duplicate sessions if (log.isInfoEnabled()) { log.info("Removing duplicate or empty sessions: " + toDelete); } Iterator<HttpSession> it = toDelete.iterator(); while (it.hasNext()) { HttpSession ses = it.next(); ses.invalidate(); sessions.remove(ses); model.removeHttpSession(ses); } } }
class class_name[name] begin[{] method[cleanupSessionToken, return_type[void], modifier[protected], parameter[token]] begin[{] if[call[sessions.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[binary_operation[binary_operation[binary_operation[literal["Removing duplicates and cleaning up sessions for site - token: "], +, member[.site]], +, literal[" - "]], +, member[.token]]]] else begin[{] None end[}] SYNCHRONIZED[THIS[member[None.sessions]]] BEGIN[{] local_variable[type[HttpSessionTokensSet], siteTokensSet] if[binary_operation[member[.siteTokensSet], ==, literal[null]]] begin[{] call[log.info, parameter[literal["No more session tokens. Removing all sessions..."]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=invalidate, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sessions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=session)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpSession, sub_type=None))), label=None) THIS[member[None.sessions]call[None.clear, parameter[]]] assign[THIS[member[None.activeSession]], literal[null]] THIS[member[None.model]call[None.removeAllElements, parameter[]]] return[None] else begin[{] None end[}] local_variable[type[Map], uniqueSession] local_variable[type[List], toDelete] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeToken, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTokenValuesCount, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=MethodInvocation(arguments=[], member=isActive, postfix_operators=[], prefix_operators=['!'], qualifier=session, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fireHttpSessionUpdated, postfix_operators=[], prefix_operators=[], qualifier=model, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=toDelete, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTokenValuesString, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=uniqueSession, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTokenValuesString, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=uniqueSession, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTokenValuesString, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=uniqueSession, selectors=[], type_arguments=None), name=prevSession)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpSession, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isActive, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=toDelete, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMessagesMatched, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getMessagesMatched, postfix_operators=[], prefix_operators=[], qualifier=prevSession, selectors=[], type_arguments=None), operator=+)], member=setMessagesMatched, postfix_operators=[], prefix_operators=[], qualifier=prevSession, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prevSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=toDelete, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMessagesMatched, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getMessagesMatched, postfix_operators=[], prefix_operators=[], qualifier=prevSession, selectors=[], type_arguments=None), operator=+)], member=setMessagesMatched, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sessions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=session)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpSession, sub_type=None))), label=None) if[call[log.isInfoEnabled, parameter[]]] begin[{] call[log.info, parameter[binary_operation[literal["Removing duplicate or empty sessions: "], +, member[.toDelete]]]] else begin[{] None end[}] local_variable[type[Iterator], it] while[call[it.hasNext, parameter[]]] begin[{] local_variable[type[HttpSession], ses] call[ses.invalidate, parameter[]] call[sessions.remove, parameter[member[.ses]]] call[model.removeHttpSession, parameter[member[.ses]]] end[}] END[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[cleanupSessionToken] operator[SEP] identifier[String] identifier[token] operator[SEP] { Keyword[if] operator[SEP] identifier[sessions] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[site] operator[+] literal[String] operator[+] identifier[token] operator[SEP] operator[SEP] } Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[sessions] operator[SEP] { identifier[HttpSessionTokensSet] identifier[siteTokensSet] operator[=] identifier[extension] operator[SEP] identifier[getHttpSessionTokensSet] operator[SEP] identifier[site] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[siteTokensSet] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[HttpSession] identifier[session] operator[:] Keyword[this] operator[SEP] identifier[sessions] operator[SEP] { identifier[session] operator[SEP] identifier[invalidate] operator[SEP] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[sessions] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[activeSession] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[model] operator[SEP] identifier[removeAllElements] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[HttpSession] operator[>] identifier[uniqueSession] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] identifier[sessions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[HttpSession] operator[>] identifier[toDelete] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[HttpSession] identifier[session] operator[:] Keyword[this] operator[SEP] identifier[sessions] operator[SEP] { identifier[session] operator[SEP] identifier[removeToken] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[session] operator[SEP] identifier[getTokenValuesCount] operator[SEP] operator[SEP] operator[==] Other[0] operator[&&] operator[!] identifier[session] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[SEP] { identifier[toDelete] operator[SEP] identifier[add] operator[SEP] identifier[session] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[else] { identifier[model] operator[SEP] identifier[fireHttpSessionUpdated] operator[SEP] identifier[session] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[uniqueSession] operator[SEP] identifier[containsKey] operator[SEP] identifier[session] operator[SEP] identifier[getTokenValuesString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[HttpSession] identifier[prevSession] operator[=] identifier[uniqueSession] operator[SEP] identifier[get] operator[SEP] identifier[session] operator[SEP] identifier[getTokenValuesString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[session] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[SEP] { identifier[toDelete] operator[SEP] identifier[add] operator[SEP] identifier[prevSession] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[setMessagesMatched] operator[SEP] identifier[session] operator[SEP] identifier[getMessagesMatched] operator[SEP] operator[SEP] operator[+] identifier[prevSession] operator[SEP] identifier[getMessagesMatched] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[toDelete] operator[SEP] identifier[add] operator[SEP] identifier[session] operator[SEP] operator[SEP] identifier[prevSession] operator[SEP] identifier[setMessagesMatched] operator[SEP] identifier[session] operator[SEP] identifier[getMessagesMatched] operator[SEP] operator[SEP] operator[+] identifier[prevSession] operator[SEP] identifier[getMessagesMatched] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[uniqueSession] operator[SEP] identifier[put] operator[SEP] identifier[session] operator[SEP] identifier[getTokenValuesString] operator[SEP] operator[SEP] , identifier[session] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[toDelete] operator[SEP] operator[SEP] } identifier[Iterator] operator[<] identifier[HttpSession] operator[>] identifier[it] operator[=] identifier[toDelete] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[HttpSession] identifier[ses] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[ses] operator[SEP] identifier[invalidate] operator[SEP] operator[SEP] operator[SEP] identifier[sessions] operator[SEP] identifier[remove] operator[SEP] identifier[ses] operator[SEP] operator[SEP] identifier[model] operator[SEP] identifier[removeHttpSession] operator[SEP] identifier[ses] operator[SEP] operator[SEP] } } }
public final Mono<T> metrics() { if (!Metrics.isInstrumentationAvailable()) { return this; } if (this instanceof Fuseable) { return onAssembly(new MonoMetricsFuseable<>(this)); } return onAssembly(new MonoMetrics<>(this)); }
class class_name[name] begin[{] method[metrics, return_type[type[Mono]], modifier[final public], parameter[]] begin[{] if[call[Metrics.isInstrumentationAvailable, parameter[]]] begin[{] return[THIS[]] else begin[{] None end[}] if[binary_operation[THIS[], instanceof, type[Fuseable]]] begin[{] return[call[.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=MonoMetricsFuseable, sub_type=None))]]] else begin[{] None end[}] return[call[.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=MonoMetrics, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[Mono] operator[<] identifier[T] operator[>] identifier[metrics] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[Metrics] operator[SEP] identifier[isInstrumentationAvailable] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] Keyword[instanceof] identifier[Fuseable] operator[SEP] { Keyword[return] identifier[onAssembly] operator[SEP] Keyword[new] identifier[MonoMetricsFuseable] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[onAssembly] operator[SEP] Keyword[new] identifier[MonoMetrics] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP] }
public void setStepDelayTo(String stepDelay) { if ("slow".equals(stepDelay)) { this.stepDelay = 1000; } else if ("fast".equals(stepDelay)) { this.stepDelay = 0; } else { this.stepDelay = Long.parseLong(stepDelay); } }
class class_name[name] begin[{] method[setStepDelayTo, return_type[void], modifier[public], parameter[stepDelay]] begin[{] if[literal["slow"]] begin[{] assign[THIS[member[None.stepDelay]], literal[1000]] else begin[{] if[literal["fast"]] begin[{] assign[THIS[member[None.stepDelay]], literal[0]] else begin[{] assign[THIS[member[None.stepDelay]], call[Long.parseLong, parameter[member[.stepDelay]]]] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setStepDelayTo] operator[SEP] identifier[String] identifier[stepDelay] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[stepDelay] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[stepDelay] operator[=] Other[1000] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[stepDelay] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[stepDelay] operator[=] Other[0] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[stepDelay] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[stepDelay] operator[SEP] operator[SEP] } }
void updateCornerLeft() { if (m_corner != null) { int popupLeft = popup.getPopupLeft(); int dif = (getAbsoluteLeft() - popupLeft) + OFFSET; m_corner.getStyle().setLeft(dif, Unit.PX); } }
class class_name[name] begin[{] method[updateCornerLeft, return_type[void], modifier[default], parameter[]] begin[{] if[binary_operation[member[.m_corner], !=, literal[null]]] begin[{] local_variable[type[int], popupLeft] local_variable[type[int], dif] call[m_corner.getStyle, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[updateCornerLeft] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_corner] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[popupLeft] operator[=] identifier[popup] operator[SEP] identifier[getPopupLeft] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[dif] operator[=] operator[SEP] identifier[getAbsoluteLeft] operator[SEP] operator[SEP] operator[-] identifier[popupLeft] operator[SEP] operator[+] identifier[OFFSET] operator[SEP] identifier[m_corner] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[setLeft] operator[SEP] identifier[dif] , identifier[Unit] operator[SEP] identifier[PX] operator[SEP] operator[SEP] } }
@Override public CreateGroupCertificateAuthorityResult createGroupCertificateAuthority(CreateGroupCertificateAuthorityRequest request) { request = beforeClientExecution(request); return executeCreateGroupCertificateAuthority(request); }
class class_name[name] begin[{] method[createGroupCertificateAuthority, return_type[type[CreateGroupCertificateAuthorityResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeCreateGroupCertificateAuthority, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CreateGroupCertificateAuthorityResult] identifier[createGroupCertificateAuthority] operator[SEP] identifier[CreateGroupCertificateAuthorityRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeCreateGroupCertificateAuthority] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static int findWordEnd(String line, int pos, String noWordSep, boolean joinNonWordChars, boolean eatWhitespace) { if (pos != 0) { pos--; } char ch = line.charAt(pos); if (noWordSep == null) { noWordSep = ""; } int type; if (Character.isWhitespace(ch)) { type = WHITESPACE; } else if (Character.isLetterOrDigit(ch) || noWordSep.indexOf(ch) != -1) { type = WORD_CHAR; } else { type = SYMBOL; } //}}} for (int i = pos; i < line.length(); i++) { ch = line.charAt(i); switch (type) { case WHITESPACE: // only select other whitespace in this case if (Character.isWhitespace(ch)) { break; } else { return i; } case WORD_CHAR: if (Character.isLetterOrDigit(ch) || noWordSep.indexOf(ch) != -1) { break; } // whitespace; include in word if eating else if (Character.isWhitespace(ch) && eatWhitespace) { type = WHITESPACE; break; } else { return i; //}}} } case SYMBOL: if (!joinNonWordChars && i != pos) { return i; } // if we see whitespace, set flag. if (Character.isWhitespace(ch)) { if (eatWhitespace) { type = WHITESPACE; break; } else { return i; } } else if (Character.isLetterOrDigit(ch) || noWordSep.indexOf(ch) != -1) { return i; } else { break; } } } return line.length(); }
class class_name[name] begin[{] method[findWordEnd, return_type[type[int]], modifier[public static], parameter[line, pos, noWordSep, joinNonWordChars, eatWhitespace]] begin[{] if[binary_operation[member[.pos], !=, literal[0]]] begin[{] member[.pos] else begin[{] None end[}] local_variable[type[char], ch] if[binary_operation[member[.noWordSep], ==, literal[null]]] begin[{] assign[member[.noWordSep], literal[""]] else begin[{] None end[}] local_variable[type[int], type] if[call[Character.isWhitespace, parameter[member[.ch]]]] begin[{] assign[member[.type], member[.WHITESPACE]] else begin[{] if[binary_operation[call[Character.isLetterOrDigit, parameter[member[.ch]]], ||, binary_operation[call[noWordSep.indexOf, parameter[member[.ch]]], !=, literal[1]]]] begin[{] assign[member[.type], member[.WORD_CHAR]] else begin[{] assign[member[.type], member[.SYMBOL]] end[}] end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)), label=None), SwitchStatement(cases=[SwitchStatementCase(case=['WHITESPACE'], statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isWhitespace, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), SwitchStatementCase(case=['WORD_CHAR'], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLetterOrDigit, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=noWordSep, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isWhitespace, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operandr=MemberReference(member=eatWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=WHITESPACE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), SwitchStatementCase(case=['SYMBOL'], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=joinNonWordChars, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isWhitespace, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLetterOrDigit, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=noWordSep, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), operator=||), else_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=eatWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=WHITESPACE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]))])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[line.length, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[findWordEnd] operator[SEP] identifier[String] identifier[line] , Keyword[int] identifier[pos] , identifier[String] identifier[noWordSep] , Keyword[boolean] identifier[joinNonWordChars] , Keyword[boolean] identifier[eatWhitespace] operator[SEP] { Keyword[if] operator[SEP] identifier[pos] operator[!=] Other[0] operator[SEP] { identifier[pos] operator[--] operator[SEP] } Keyword[char] identifier[ch] operator[=] identifier[line] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[noWordSep] operator[==] Other[null] operator[SEP] { identifier[noWordSep] operator[=] literal[String] operator[SEP] } Keyword[int] identifier[type] operator[SEP] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[ch] operator[SEP] operator[SEP] { identifier[type] operator[=] identifier[WHITESPACE] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isLetterOrDigit] operator[SEP] identifier[ch] operator[SEP] operator[||] identifier[noWordSep] operator[SEP] identifier[indexOf] operator[SEP] identifier[ch] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[type] operator[=] identifier[WORD_CHAR] operator[SEP] } Keyword[else] { identifier[type] operator[=] identifier[SYMBOL] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[pos] operator[SEP] identifier[i] operator[<] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ch] operator[=] identifier[line] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[WHITESPACE] operator[:] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[ch] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } Keyword[else] { Keyword[return] identifier[i] operator[SEP] } Keyword[case] identifier[WORD_CHAR] operator[:] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isLetterOrDigit] operator[SEP] identifier[ch] operator[SEP] operator[||] identifier[noWordSep] operator[SEP] identifier[indexOf] operator[SEP] identifier[ch] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { Keyword[break] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[ch] operator[SEP] operator[&&] identifier[eatWhitespace] operator[SEP] { identifier[type] operator[=] identifier[WHITESPACE] operator[SEP] Keyword[break] operator[SEP] } Keyword[else] { Keyword[return] identifier[i] operator[SEP] } Keyword[case] identifier[SYMBOL] operator[:] Keyword[if] operator[SEP] operator[!] identifier[joinNonWordChars] operator[&&] identifier[i] operator[!=] identifier[pos] operator[SEP] { Keyword[return] identifier[i] operator[SEP] } Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[ch] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[eatWhitespace] operator[SEP] { identifier[type] operator[=] identifier[WHITESPACE] operator[SEP] Keyword[break] operator[SEP] } Keyword[else] { Keyword[return] identifier[i] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isLetterOrDigit] operator[SEP] identifier[ch] operator[SEP] operator[||] identifier[noWordSep] operator[SEP] identifier[indexOf] operator[SEP] identifier[ch] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { Keyword[return] identifier[i] operator[SEP] } Keyword[else] { Keyword[break] operator[SEP] } } } Keyword[return] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] }
public ByteBuffer getFloats(int index, ByteBuffer dest) { MemUtil.INSTANCE.putf(this, index, dest); return dest; }
class class_name[name] begin[{] method[getFloats, return_type[type[ByteBuffer]], modifier[public], parameter[index, dest]] begin[{] call[MemUtil.INSTANCE.putf, parameter[THIS[], member[.index], member[.dest]]] return[member[.dest]] end[}] END[}]
Keyword[public] identifier[ByteBuffer] identifier[getFloats] operator[SEP] Keyword[int] identifier[index] , identifier[ByteBuffer] identifier[dest] operator[SEP] { identifier[MemUtil] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[putf] operator[SEP] Keyword[this] , identifier[index] , identifier[dest] operator[SEP] operator[SEP] Keyword[return] identifier[dest] operator[SEP] }
public static Role get(final String _name) throws CacheReloadException { final Cache<String, Role> cache = InfinispanCache.get().<String, Role>getCache(Role.NAMECACHE); if (!cache.containsKey(_name) && !Role.getRoleFromDB(Role.SQL_NAME, _name)) { cache.put(_name, Role.NULL, 100, TimeUnit.SECONDS); } final Role ret = cache.get(_name); return ret.equals(Role.NULL) ? null : ret; }
class class_name[name] begin[{] method[get, return_type[type[Role]], modifier[public static], parameter[_name]] begin[{] local_variable[type[Cache], cache] if[binary_operation[call[cache.containsKey, parameter[member[._name]]], &&, call[Role.getRoleFromDB, parameter[member[Role.SQL_NAME], member[._name]]]]] begin[{] call[cache.put, parameter[member[._name], member[Role.NULL], literal[100], member[TimeUnit.SECONDS]]] else begin[{] None end[}] local_variable[type[Role], ret] return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=Role, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), if_false=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Role] identifier[get] operator[SEP] Keyword[final] identifier[String] identifier[_name] operator[SEP] Keyword[throws] identifier[CacheReloadException] { Keyword[final] identifier[Cache] operator[<] identifier[String] , identifier[Role] operator[>] identifier[cache] operator[=] identifier[InfinispanCache] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[<] identifier[String] , identifier[Role] operator[>] identifier[getCache] operator[SEP] identifier[Role] operator[SEP] identifier[NAMECACHE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[cache] operator[SEP] identifier[containsKey] operator[SEP] identifier[_name] operator[SEP] operator[&&] operator[!] identifier[Role] operator[SEP] identifier[getRoleFromDB] operator[SEP] identifier[Role] operator[SEP] identifier[SQL_NAME] , identifier[_name] operator[SEP] operator[SEP] { identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[_name] , identifier[Role] operator[SEP] identifier[NULL] , Other[100] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] } Keyword[final] identifier[Role] identifier[ret] operator[=] identifier[cache] operator[SEP] identifier[get] operator[SEP] identifier[_name] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] identifier[equals] operator[SEP] identifier[Role] operator[SEP] identifier[NULL] operator[SEP] operator[?] Other[null] operator[:] identifier[ret] operator[SEP] }
public Field createFieldTable( Field formFieldParam, Form formDefinitionParam, boolean sumDecimalsParam) { if(formFieldParam != null && this.serviceTicket != null) { formFieldParam.setServiceTicket(this.serviceTicket); } if(formFieldParam != null) { formFieldParam.setTypeAsEnum(Field.Type.Table); formFieldParam.setTypeMetaData( this.getMetaDataForTableField( formDefinitionParam, sumDecimalsParam)); } return new Field(this.putJson( formFieldParam, WS.Path.FormField.Version1.formFieldCreate())); }
class class_name[name] begin[{] method[createFieldTable, return_type[type[Field]], modifier[public], parameter[formFieldParam, formDefinitionParam, sumDecimalsParam]] begin[{] if[binary_operation[binary_operation[member[.formFieldParam], !=, literal[null]], &&, binary_operation[THIS[member[None.serviceTicket]], !=, literal[null]]]] begin[{] call[formFieldParam.setServiceTicket, parameter[THIS[member[None.serviceTicket]]]] else begin[{] None end[}] if[binary_operation[member[.formFieldParam], !=, literal[null]]] begin[{] call[formFieldParam.setTypeAsEnum, parameter[member[Field.Type.Table]]] call[formFieldParam.setTypeMetaData, parameter[THIS[call[None.getMetaDataForTableField, parameter[member[.formDefinitionParam], member[.sumDecimalsParam]]]]]] else begin[{] None end[}] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=formFieldParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=formFieldCreate, postfix_operators=[], prefix_operators=[], qualifier=WS.Path.FormField.Version1, selectors=[], type_arguments=None)], member=putJson, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Field, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Field] identifier[createFieldTable] operator[SEP] identifier[Field] identifier[formFieldParam] , identifier[Form] identifier[formDefinitionParam] , Keyword[boolean] identifier[sumDecimalsParam] operator[SEP] { Keyword[if] operator[SEP] identifier[formFieldParam] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[serviceTicket] operator[!=] Other[null] operator[SEP] { identifier[formFieldParam] operator[SEP] identifier[setServiceTicket] operator[SEP] Keyword[this] operator[SEP] identifier[serviceTicket] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[formFieldParam] operator[!=] Other[null] operator[SEP] { identifier[formFieldParam] operator[SEP] identifier[setTypeAsEnum] operator[SEP] identifier[Field] operator[SEP] identifier[Type] operator[SEP] identifier[Table] operator[SEP] operator[SEP] identifier[formFieldParam] operator[SEP] identifier[setTypeMetaData] operator[SEP] Keyword[this] operator[SEP] identifier[getMetaDataForTableField] operator[SEP] identifier[formDefinitionParam] , identifier[sumDecimalsParam] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Field] operator[SEP] Keyword[this] operator[SEP] identifier[putJson] operator[SEP] identifier[formFieldParam] , identifier[WS] operator[SEP] identifier[Path] operator[SEP] identifier[FormField] operator[SEP] identifier[Version1] operator[SEP] identifier[formFieldCreate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public int replace(Replaceable text, int start, int limit, int[] cursor) { int outLen = 0; // Copy segment with out-of-band data int dest = limit; // If there was no match, that means that a quantifier // matched zero-length. E.g., x (a)* y matched "xy". if (matchStart >= 0) { if (matchStart != matchLimit) { text.copy(matchStart, matchLimit, dest); outLen = matchLimit - matchStart; } } text.replace(start, limit, ""); // delete original text return outLen; }
class class_name[name] begin[{] method[replace, return_type[type[int]], modifier[public], parameter[text, start, limit, cursor]] begin[{] local_variable[type[int], outLen] local_variable[type[int], dest] if[binary_operation[member[.matchStart], >=, literal[0]]] begin[{] if[binary_operation[member[.matchStart], !=, member[.matchLimit]]] begin[{] call[text.copy, parameter[member[.matchStart], member[.matchLimit], member[.dest]]] assign[member[.outLen], binary_operation[member[.matchLimit], -, member[.matchStart]]] else begin[{] None end[}] else begin[{] None end[}] call[text.replace, parameter[member[.start], member[.limit], literal[""]]] return[member[.outLen]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[replace] operator[SEP] identifier[Replaceable] identifier[text] , Keyword[int] identifier[start] , Keyword[int] identifier[limit] , Keyword[int] operator[SEP] operator[SEP] identifier[cursor] operator[SEP] { Keyword[int] identifier[outLen] operator[=] Other[0] operator[SEP] Keyword[int] identifier[dest] operator[=] identifier[limit] operator[SEP] Keyword[if] operator[SEP] identifier[matchStart] operator[>=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[matchStart] operator[!=] identifier[matchLimit] operator[SEP] { identifier[text] operator[SEP] identifier[copy] operator[SEP] identifier[matchStart] , identifier[matchLimit] , identifier[dest] operator[SEP] operator[SEP] identifier[outLen] operator[=] identifier[matchLimit] operator[-] identifier[matchStart] operator[SEP] } } identifier[text] operator[SEP] identifier[replace] operator[SEP] identifier[start] , identifier[limit] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[outLen] operator[SEP] }
public ListTotalCategoryVideoOperation buildListTotalCategoryVideoOperation(String databasePath, VideoFilter videoFilter){ return new ListTotalCategoryVideoOperation(getOperationFactory(), databasePath, videoFilter); }
class class_name[name] begin[{] method[buildListTotalCategoryVideoOperation, return_type[type[ListTotalCategoryVideoOperation]], modifier[public], parameter[databasePath, videoFilter]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getOperationFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=databasePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=videoFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ListTotalCategoryVideoOperation, sub_type=None))] end[}] END[}]
Keyword[public] identifier[ListTotalCategoryVideoOperation] identifier[buildListTotalCategoryVideoOperation] operator[SEP] identifier[String] identifier[databasePath] , identifier[VideoFilter] identifier[videoFilter] operator[SEP] { Keyword[return] Keyword[new] identifier[ListTotalCategoryVideoOperation] operator[SEP] identifier[getOperationFactory] operator[SEP] operator[SEP] , identifier[databasePath] , identifier[videoFilter] operator[SEP] operator[SEP] }
@Override public int read (byte bytes[], int offset, int length) throws IOException { int r; if ((r = in.read(bytes, offset, length)) == -1) return -1; md5.Update(bytes, offset, r); return r; }
class class_name[name] begin[{] method[read, return_type[type[int]], modifier[public], parameter[bytes, offset, length]] begin[{] local_variable[type[int], r] if[binary_operation[assign[member[.r], call[in.read, parameter[member[.bytes], member[.offset], member[.length]]]], ==, literal[1]]] begin[{] return[literal[1]] else begin[{] None end[}] call[md5.Update, parameter[member[.bytes], member[.offset], member[.r]]] return[member[.r]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[read] operator[SEP] Keyword[byte] identifier[bytes] operator[SEP] operator[SEP] , Keyword[int] identifier[offset] , Keyword[int] identifier[length] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[r] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[r] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] identifier[bytes] , identifier[offset] , identifier[length] operator[SEP] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] identifier[md5] operator[SEP] identifier[Update] operator[SEP] identifier[bytes] , identifier[offset] , identifier[r] operator[SEP] operator[SEP] Keyword[return] identifier[r] operator[SEP] }
public static Color disable(Color color) { int alpha = color.getAlpha(); alpha /= 2; return new Color((color.getRGB() & 0xFFFFFF) | (alpha << 24), true); }
class class_name[name] begin[{] method[disable, return_type[type[Color]], modifier[public static], parameter[color]] begin[{] local_variable[type[int], alpha] assign[member[.alpha], literal[2]] return[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRGB, postfix_operators=[], prefix_operators=[], qualifier=color, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFFFFFF), operator=&), operandr=BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=<<), operator=|), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Color, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Color] identifier[disable] operator[SEP] identifier[Color] identifier[color] operator[SEP] { Keyword[int] identifier[alpha] operator[=] identifier[color] operator[SEP] identifier[getAlpha] operator[SEP] operator[SEP] operator[SEP] identifier[alpha] operator[/=] Other[2] operator[SEP] Keyword[return] Keyword[new] identifier[Color] operator[SEP] operator[SEP] identifier[color] operator[SEP] identifier[getRGB] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] identifier[alpha] operator[<<] Other[24] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] }
public long getEventsRouted(int executor, EventTypeID eventTypeID) { final EventRouterExecutorStatistics executorStats = getExecutors()[executor].getStatistics(); return executorStats == null ? 0 : executorStats.getEventsRouted(eventTypeID); }
class class_name[name] begin[{] method[getEventsRouted, return_type[type[long]], modifier[public], parameter[executor, eventTypeID]] begin[{] local_variable[type[EventRouterExecutorStatistics], executorStats] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=executorStats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=eventTypeID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEventsRouted, postfix_operators=[], prefix_operators=[], qualifier=executorStats, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))] end[}] END[}]
Keyword[public] Keyword[long] identifier[getEventsRouted] operator[SEP] Keyword[int] identifier[executor] , identifier[EventTypeID] identifier[eventTypeID] operator[SEP] { Keyword[final] identifier[EventRouterExecutorStatistics] identifier[executorStats] operator[=] identifier[getExecutors] operator[SEP] operator[SEP] operator[SEP] identifier[executor] operator[SEP] operator[SEP] identifier[getStatistics] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[executorStats] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[executorStats] operator[SEP] identifier[getEventsRouted] operator[SEP] identifier[eventTypeID] operator[SEP] operator[SEP] }
public Object execute(final Map<Object, Object> iArgs) { if (name == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); getDatabase().getMetadata().getIndexManager().dropIndex(name); return null; }
class class_name[name] begin[{] method[execute, return_type[type[Object]], modifier[public], parameter[iArgs]] begin[{] if[binary_operation[member[.name], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot execute the command because it has not been parsed yet")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OCommandExecutionException, sub_type=None)), label=None) else begin[{] None end[}] call[.getDatabase, parameter[]] return[literal[null]] end[}] END[}]
Keyword[public] identifier[Object] identifier[execute] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[iArgs] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[OCommandExecutionException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[getIndexManager] operator[SEP] operator[SEP] operator[SEP] identifier[dropIndex] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
protected void unmarshallingFileHandle(Xdr xdr, boolean force) { if (force || xdr.getBoolean()) { _fileHandle = xdr.getByteArray(); } }
class class_name[name] begin[{] method[unmarshallingFileHandle, return_type[void], modifier[protected], parameter[xdr, force]] begin[{] if[binary_operation[member[.force], ||, call[xdr.getBoolean, parameter[]]]] begin[{] assign[member[._fileHandle], call[xdr.getByteArray, parameter[]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[unmarshallingFileHandle] operator[SEP] identifier[Xdr] identifier[xdr] , Keyword[boolean] identifier[force] operator[SEP] { Keyword[if] operator[SEP] identifier[force] operator[||] identifier[xdr] operator[SEP] identifier[getBoolean] operator[SEP] operator[SEP] operator[SEP] { identifier[_fileHandle] operator[=] identifier[xdr] operator[SEP] identifier[getByteArray] operator[SEP] operator[SEP] operator[SEP] } }
protected void bindToSpringApplication(ConfigurableEnvironment environment) { try { Binder.get(environment).bind("spring.main", Bindable.ofInstance(this)); } catch (Exception ex) { throw new IllegalStateException("Cannot bind to SpringApplication", ex); } }
class class_name[name] begin[{] method[bindToSpringApplication, return_type[void], modifier[protected], parameter[environment]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=environment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=Binder, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="spring.main"), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=ofInstance, postfix_operators=[], prefix_operators=[], qualifier=Bindable, selectors=[], type_arguments=None)], member=bind, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot bind to SpringApplication"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[bindToSpringApplication] operator[SEP] identifier[ConfigurableEnvironment] identifier[environment] operator[SEP] { Keyword[try] { identifier[Binder] operator[SEP] identifier[get] operator[SEP] identifier[environment] operator[SEP] operator[SEP] identifier[bind] operator[SEP] literal[String] , identifier[Bindable] operator[SEP] identifier[ofInstance] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] } }
public ServiceFuture<StreamingJobInner> updateAsync(String resourceGroupName, String jobName, StreamingJobInner streamingJob, String ifMatch, final ServiceCallback<StreamingJobInner> serviceCallback) { return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(resourceGroupName, jobName, streamingJob, ifMatch), serviceCallback); }
class class_name[name] begin[{] method[updateAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, jobName, streamingJob, ifMatch, serviceCallback]] begin[{] return[call[ServiceFuture.fromHeaderResponse, parameter[call[.updateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.jobName], member[.streamingJob], member[.ifMatch]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[StreamingJobInner] operator[>] identifier[updateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[jobName] , identifier[StreamingJobInner] identifier[streamingJob] , identifier[String] identifier[ifMatch] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[StreamingJobInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromHeaderResponse] operator[SEP] identifier[updateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[jobName] , identifier[streamingJob] , identifier[ifMatch] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
private static <T> T loadAndInstantiateClassImpl( AddOnClassLoader addOnClassLoader, String classname, Class<T> clazz, String type) { Class<?> cls; try { cls = addOnClassLoader.loadClass(classname); } catch (ClassNotFoundException e) { LOGGER.error("Declared \"" + type + "\" was not found: " + classname, e); return null; } catch (LinkageError e) { LOGGER.error("Declared \"" + type + "\" could not be loaded: " + classname, e); return null; } if (Modifier.isAbstract(cls.getModifiers()) || Modifier.isInterface(cls.getModifiers())) { LOGGER.error("Declared \"" + type + "\" is abstract or an interface: " + classname); return null; } if (!clazz.isAssignableFrom(cls)) { LOGGER.error("Declared \"" + type + "\" is not of type \"" + clazz.getName() + "\": " + classname); return null; } try { @SuppressWarnings("unchecked") Constructor<T> c = (Constructor<T>) cls.getConstructor(); return c.newInstance(); } catch (LinkageError | Exception e) { LOGGER.error("Failed to initialise: " + classname, e); } return null; }
class class_name[name] begin[{] method[loadAndInstantiateClassImpl, return_type[type[T]], modifier[private static], parameter[addOnClassLoader, classname, clazz, type]] begin[{] local_variable[type[Class], cls] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=classname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=addOnClassLoader, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Declared \""), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" was not found: "), operator=+), operandr=MemberReference(member=classname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Declared \""), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" could not be loaded: "), operator=+), operandr=MemberReference(member=classname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['LinkageError']))], finally_block=None, label=None, resources=None) if[binary_operation[call[Modifier.isAbstract, parameter[call[cls.getModifiers, parameter[]]]], ||, call[Modifier.isInterface, parameter[call[cls.getModifiers, parameter[]]]]]] begin[{] call[LOGGER.error, parameter[binary_operation[binary_operation[binary_operation[literal["Declared \""], +, member[.type]], +, literal["\" is abstract or an interface: "]], +, member[.classname]]]] return[literal[null]] else begin[{] None end[}] if[call[clazz.isAssignableFrom, parameter[member[.cls]]]] begin[{] call[LOGGER.error, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Declared \""], +, member[.type]], +, literal["\" is not of type \""]], +, call[clazz.getName, parameter[]]], +, literal["\": "]], +, member[.classname]]]] return[literal[null]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=cls, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), name=c)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to initialise: "), operandr=MemberReference(member=classname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['LinkageError', 'Exception']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[loadAndInstantiateClassImpl] operator[SEP] identifier[AddOnClassLoader] identifier[addOnClassLoader] , identifier[String] identifier[classname] , identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] , identifier[String] identifier[type] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[cls] operator[SEP] Keyword[try] { identifier[cls] operator[=] identifier[addOnClassLoader] operator[SEP] identifier[loadClass] operator[SEP] identifier[classname] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[type] operator[+] literal[String] operator[+] identifier[classname] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[catch] operator[SEP] identifier[LinkageError] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[type] operator[+] literal[String] operator[+] identifier[classname] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[cls] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[Modifier] operator[SEP] identifier[isInterface] operator[SEP] identifier[cls] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[type] operator[+] literal[String] operator[+] identifier[classname] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[clazz] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[cls] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[type] operator[+] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[classname] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[try] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Constructor] operator[<] identifier[T] operator[>] identifier[c] operator[=] operator[SEP] identifier[Constructor] operator[<] identifier[T] operator[>] operator[SEP] identifier[cls] operator[SEP] identifier[getConstructor] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[c] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[LinkageError] operator[|] identifier[Exception] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[classname] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public void invalidateCache(String table, String key) { cache.invalidateCache(new TableCacheKey<>(table, key, x -> null)); }
class class_name[name] begin[{] method[invalidateCache, return_type[void], modifier[public], parameter[table, key]] begin[{] call[cache.invalidateCache, parameter[ClassCreator(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), parameters=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=TableCacheKey, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[invalidateCache] operator[SEP] identifier[String] identifier[table] , identifier[String] identifier[key] operator[SEP] { identifier[cache] operator[SEP] identifier[invalidateCache] operator[SEP] Keyword[new] identifier[TableCacheKey] operator[<] operator[>] operator[SEP] identifier[table] , identifier[key] , identifier[x] operator[->] Other[null] operator[SEP] operator[SEP] operator[SEP] }
public Path getInputFileForWrite(TaskID mapId, TaskAttemptID reduceTaskId, long size) throws IOException { // TODO *oom* should use a format here return lDirAlloc.getLocalPathForWrite(TaskTracker.getIntermediateOutputDir( jobId.toString(), reduceTaskId.toString()) + "/map_" + mapId.getId() + ".out", size, conf); }
class class_name[name] begin[{] method[getInputFileForWrite, return_type[type[Path]], modifier[public], parameter[mapId, reduceTaskId, size]] begin[{] return[call[lDirAlloc.getLocalPathForWrite, parameter[binary_operation[binary_operation[binary_operation[call[TaskTracker.getIntermediateOutputDir, parameter[call[jobId.toString, parameter[]], call[reduceTaskId.toString, parameter[]]]], +, literal["/map_"]], +, call[mapId.getId, parameter[]]], +, literal[".out"]], member[.size], member[.conf]]]] end[}] END[}]
Keyword[public] identifier[Path] identifier[getInputFileForWrite] operator[SEP] identifier[TaskID] identifier[mapId] , identifier[TaskAttemptID] identifier[reduceTaskId] , Keyword[long] identifier[size] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[lDirAlloc] operator[SEP] identifier[getLocalPathForWrite] operator[SEP] identifier[TaskTracker] operator[SEP] identifier[getIntermediateOutputDir] operator[SEP] identifier[jobId] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[reduceTaskId] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[mapId] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[size] , identifier[conf] operator[SEP] operator[SEP] }
public ObjectFunctionSetSpecificationObjType createObjectFunctionSetSpecificationObjTypeFromString(EDataType eDataType, String initialValue) { ObjectFunctionSetSpecificationObjType result = ObjectFunctionSetSpecificationObjType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
class class_name[name] begin[{] method[createObjectFunctionSetSpecificationObjTypeFromString, return_type[type[ObjectFunctionSetSpecificationObjType]], modifier[public], parameter[eDataType, initialValue]] begin[{] local_variable[type[ObjectFunctionSetSpecificationObjType], result] if[binary_operation[member[.result], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[ObjectFunctionSetSpecificationObjType] identifier[createObjectFunctionSetSpecificationObjTypeFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] { identifier[ObjectFunctionSetSpecificationObjType] identifier[result] operator[=] identifier[ObjectFunctionSetSpecificationObjType] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
protected DependencyContextGenerator getContextGenerator() { StructuredVectorSpace svs = SerializableUtil.load(new File( argOptions.getStringOption('l'))); return new SelPrefDependencyContextGenerator(svs); }
class class_name[name] begin[{] method[getContextGenerator, return_type[type[DependencyContextGenerator]], modifier[protected], parameter[]] begin[{] local_variable[type[StructuredVectorSpace], svs] return[ClassCreator(arguments=[MemberReference(member=svs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SelPrefDependencyContextGenerator, sub_type=None))] end[}] END[}]
Keyword[protected] identifier[DependencyContextGenerator] identifier[getContextGenerator] operator[SEP] operator[SEP] { identifier[StructuredVectorSpace] identifier[svs] operator[=] identifier[SerializableUtil] operator[SEP] identifier[load] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[argOptions] operator[SEP] identifier[getStringOption] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[SelPrefDependencyContextGenerator] operator[SEP] identifier[svs] operator[SEP] operator[SEP] }
public static MessageBox showMessageBox(String title, SafeHtml message, MessageStyleType styleType) { MessageBox box = new MessageBox(title, message); box.setMessageStyleType(styleType); box.setMessageBoxType(MessageBoxType.MESSAGE); box.center(); return box; }
class class_name[name] begin[{] method[showMessageBox, return_type[type[MessageBox]], modifier[public static], parameter[title, message, styleType]] begin[{] local_variable[type[MessageBox], box] call[box.setMessageStyleType, parameter[member[.styleType]]] call[box.setMessageBoxType, parameter[member[MessageBoxType.MESSAGE]]] call[box.center, parameter[]] return[member[.box]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MessageBox] identifier[showMessageBox] operator[SEP] identifier[String] identifier[title] , identifier[SafeHtml] identifier[message] , identifier[MessageStyleType] identifier[styleType] operator[SEP] { identifier[MessageBox] identifier[box] operator[=] Keyword[new] identifier[MessageBox] operator[SEP] identifier[title] , identifier[message] operator[SEP] operator[SEP] identifier[box] operator[SEP] identifier[setMessageStyleType] operator[SEP] identifier[styleType] operator[SEP] operator[SEP] identifier[box] operator[SEP] identifier[setMessageBoxType] operator[SEP] identifier[MessageBoxType] operator[SEP] identifier[MESSAGE] operator[SEP] operator[SEP] identifier[box] operator[SEP] identifier[center] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[box] operator[SEP] }
public final TimeZone getTimeZone(final String id) { Validate.notBlank(id, "Invalid TimeZone ID: [%s]", id); TimeZone timezone = timezones.get(id); if (timezone == null) { timezone = DEFAULT_TIMEZONES.get(id); if (timezone == null) { // if timezone not found with identifier, try loading an alias.. final String alias = ALIASES.getProperty(id); if (alias != null) { return getTimeZone(alias); } else { synchronized (DEFAULT_TIMEZONES) { // check again as it may be loaded now.. timezone = DEFAULT_TIMEZONES.get(id); if (timezone == null) { try { final VTimeZone vTimeZone = timeZoneLoader.loadVTimeZone(id); if (vTimeZone != null) { // XXX: temporary kludge.. // ((TzId) vTimeZone.getProperties().getProperty(Property.TZID)).setValue(id); timezone = new TimeZone(vTimeZone); DEFAULT_TIMEZONES.put(timezone.getID(), timezone); } else if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) { // strip global part of id and match on default tz.. Matcher matcher = TZ_ID_SUFFIX.matcher(id); if (matcher.find()) { return getTimeZone(matcher.group()); } } } catch (IOException | ParserException | ParseException e) { Logger log = LoggerFactory.getLogger(TimeZoneRegistryImpl.class); log.warn("Error occurred loading VTimeZone", e); } } } } } } return timezone; }
class class_name[name] begin[{] method[getTimeZone, return_type[type[TimeZone]], modifier[final public], parameter[id]] begin[{] call[Validate.notBlank, parameter[member[.id], literal["Invalid TimeZone ID: [%s]"], member[.id]]] local_variable[type[TimeZone], timezone] if[binary_operation[member[.timezone], ==, literal[null]]] begin[{] assign[member[.timezone], call[DEFAULT_TIMEZONES.get, parameter[member[.id]]]] if[binary_operation[member[.timezone], ==, literal[null]]] begin[{] local_variable[type[String], alias] if[binary_operation[member[.alias], !=, literal[null]]] begin[{] return[call[.getTimeZone, parameter[member[.alias]]]] else begin[{] SYNCHRONIZED[member[.DEFAULT_TIMEZONES]] BEGIN[{] assign[member[.timezone], call[DEFAULT_TIMEZONES.get, parameter[member[.id]]]] if[binary_operation[member[.timezone], ==, literal[null]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadVTimeZone, postfix_operators=[], prefix_operators=[], qualifier=timeZoneLoader, selectors=[], type_arguments=None), name=vTimeZone)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=VTimeZone, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=vTimeZone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=KEY_RELAXED_PARSING, postfix_operators=[], prefix_operators=[], qualifier=CompatibilityHints, selectors=[])], member=isHintEnabled, postfix_operators=[], prefix_operators=[], qualifier=CompatibilityHints, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=TZ_ID_SUFFIX, selectors=[], type_arguments=None), name=matcher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=find, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=group, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None)], member=getTimeZone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=timezone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=vTimeZone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TimeZone, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getID, postfix_operators=[], prefix_operators=[], qualifier=timezone, selectors=[], type_arguments=None), MemberReference(member=timezone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=DEFAULT_TIMEZONES, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TimeZoneRegistryImpl, sub_type=None))], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=LoggerFactory, selectors=[], type_arguments=None), name=log)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Logger, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error occurred loading VTimeZone"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException', 'ParserException', 'ParseException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] END[}] end[}] else begin[{] None end[}] else begin[{] None end[}] return[member[.timezone]] end[}] END[}]
Keyword[public] Keyword[final] identifier[TimeZone] identifier[getTimeZone] operator[SEP] Keyword[final] identifier[String] identifier[id] operator[SEP] { identifier[Validate] operator[SEP] identifier[notBlank] operator[SEP] identifier[id] , literal[String] , identifier[id] operator[SEP] operator[SEP] identifier[TimeZone] identifier[timezone] operator[=] identifier[timezones] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timezone] operator[==] Other[null] operator[SEP] { identifier[timezone] operator[=] identifier[DEFAULT_TIMEZONES] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timezone] operator[==] Other[null] operator[SEP] { Keyword[final] identifier[String] identifier[alias] operator[=] identifier[ALIASES] operator[SEP] identifier[getProperty] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[alias] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[getTimeZone] operator[SEP] identifier[alias] operator[SEP] operator[SEP] } Keyword[else] { Keyword[synchronized] operator[SEP] identifier[DEFAULT_TIMEZONES] operator[SEP] { identifier[timezone] operator[=] identifier[DEFAULT_TIMEZONES] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timezone] operator[==] Other[null] operator[SEP] { Keyword[try] { Keyword[final] identifier[VTimeZone] identifier[vTimeZone] operator[=] identifier[timeZoneLoader] operator[SEP] identifier[loadVTimeZone] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vTimeZone] operator[!=] Other[null] operator[SEP] { identifier[timezone] operator[=] Keyword[new] identifier[TimeZone] operator[SEP] identifier[vTimeZone] operator[SEP] operator[SEP] identifier[DEFAULT_TIMEZONES] operator[SEP] identifier[put] operator[SEP] identifier[timezone] operator[SEP] identifier[getID] operator[SEP] operator[SEP] , identifier[timezone] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[CompatibilityHints] operator[SEP] identifier[isHintEnabled] operator[SEP] identifier[CompatibilityHints] operator[SEP] identifier[KEY_RELAXED_PARSING] operator[SEP] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[TZ_ID_SUFFIX] operator[SEP] identifier[matcher] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[getTimeZone] operator[SEP] identifier[matcher] operator[SEP] identifier[group] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[IOException] operator[|] identifier[ParserException] operator[|] identifier[ParseException] identifier[e] operator[SEP] { identifier[Logger] identifier[log] operator[=] identifier[LoggerFactory] operator[SEP] identifier[getLogger] operator[SEP] identifier[TimeZoneRegistryImpl] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } } } } } Keyword[return] identifier[timezone] operator[SEP] }
private void ensureReferencedPKs(ModelDef modelDef, ReferenceDescriptorDef refDef) throws ConstraintException { String targetClassName = refDef.getProperty(PropertyHelper.OJB_PROPERTY_CLASS_REF); ClassDescriptorDef targetClassDef = modelDef.getClass(targetClassName); ensurePKsFromHierarchy(targetClassDef); }
class class_name[name] begin[{] method[ensureReferencedPKs, return_type[void], modifier[private], parameter[modelDef, refDef]] begin[{] local_variable[type[String], targetClassName] local_variable[type[ClassDescriptorDef], targetClassDef] call[.ensurePKsFromHierarchy, parameter[member[.targetClassDef]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[ensureReferencedPKs] operator[SEP] identifier[ModelDef] identifier[modelDef] , identifier[ReferenceDescriptorDef] identifier[refDef] operator[SEP] Keyword[throws] identifier[ConstraintException] { identifier[String] identifier[targetClassName] operator[=] identifier[refDef] operator[SEP] identifier[getProperty] operator[SEP] identifier[PropertyHelper] operator[SEP] identifier[OJB_PROPERTY_CLASS_REF] operator[SEP] operator[SEP] identifier[ClassDescriptorDef] identifier[targetClassDef] operator[=] identifier[modelDef] operator[SEP] identifier[getClass] operator[SEP] identifier[targetClassName] operator[SEP] operator[SEP] identifier[ensurePKsFromHierarchy] operator[SEP] identifier[targetClassDef] operator[SEP] operator[SEP] }
public static boolean isVarArg(List<? extends XtendParameter> params) { assert params != null; if (params.size() > 0) { final XtendParameter param = params.get(params.size() - 1); assert param != null; return param.isVarArg(); } return false; }
class class_name[name] begin[{] method[isVarArg, return_type[type[boolean]], modifier[public static], parameter[params]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) if[binary_operation[call[params.size, parameter[]], >, literal[0]]] begin[{] local_variable[type[XtendParameter], param] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) return[call[param.isVarArg, parameter[]]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isVarArg] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[XtendParameter] operator[>] identifier[params] operator[SEP] { Keyword[assert] identifier[params] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[params] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[final] identifier[XtendParameter] identifier[param] operator[=] identifier[params] operator[SEP] identifier[get] operator[SEP] identifier[params] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[assert] identifier[param] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[param] operator[SEP] identifier[isVarArg] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static BuildDocHandler fromDirectoryAndJar(File directory, JarFile jarFile, String base) { return fromDirectoryAndJar(directory, jarFile, base, false); }
class class_name[name] begin[{] method[fromDirectoryAndJar, return_type[type[BuildDocHandler]], modifier[public static], parameter[directory, jarFile, base]] begin[{] return[call[.fromDirectoryAndJar, parameter[member[.directory], member[.jarFile], member[.base], literal[false]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BuildDocHandler] identifier[fromDirectoryAndJar] operator[SEP] identifier[File] identifier[directory] , identifier[JarFile] identifier[jarFile] , identifier[String] identifier[base] operator[SEP] { Keyword[return] identifier[fromDirectoryAndJar] operator[SEP] identifier[directory] , identifier[jarFile] , identifier[base] , literal[boolean] operator[SEP] operator[SEP] }
@NonNull public static <T> Array<T> arrayOf(Class<T> clazz) { assertIsNotParameterized(clazz, msg("arrayOf")); return Array.ofAll(Any.listOf(clazz)); }
class class_name[name] begin[{] method[arrayOf, return_type[type[Array]], modifier[public static], parameter[clazz]] begin[{] call[.assertIsNotParameterized, parameter[member[.clazz], call[.msg, parameter[literal["arrayOf"]]]]] return[call[Array.ofAll, parameter[call[Any.listOf, parameter[member[.clazz]]]]]] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Array] operator[<] identifier[T] operator[>] identifier[arrayOf] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] { identifier[assertIsNotParameterized] operator[SEP] identifier[clazz] , identifier[msg] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Array] operator[SEP] identifier[ofAll] operator[SEP] identifier[Any] operator[SEP] identifier[listOf] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] operator[SEP] }
public void setResourceShareArns(java.util.Collection<String> resourceShareArns) { if (resourceShareArns == null) { this.resourceShareArns = null; return; } this.resourceShareArns = new java.util.ArrayList<String>(resourceShareArns); }
class class_name[name] begin[{] method[setResourceShareArns, return_type[void], modifier[public], parameter[resourceShareArns]] begin[{] if[binary_operation[member[.resourceShareArns], ==, literal[null]]] begin[{] assign[THIS[member[None.resourceShareArns]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.resourceShareArns]], ClassCreator(arguments=[MemberReference(member=resourceShareArns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setResourceShareArns] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[resourceShareArns] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceShareArns] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[resourceShareArns] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[resourceShareArns] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[resourceShareArns] operator[SEP] operator[SEP] }
@Override public UpdateIndexingConfigurationResult updateIndexingConfiguration(UpdateIndexingConfigurationRequest request) { request = beforeClientExecution(request); return executeUpdateIndexingConfiguration(request); }
class class_name[name] begin[{] method[updateIndexingConfiguration, return_type[type[UpdateIndexingConfigurationResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeUpdateIndexingConfiguration, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[UpdateIndexingConfigurationResult] identifier[updateIndexingConfiguration] operator[SEP] identifier[UpdateIndexingConfigurationRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateIndexingConfiguration] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static OutputStream getOutputStream(Socket socket, long timeout) throws IOException { return (socket.getChannel() == null) ? socket.getOutputStream() : new SocketOutputStream(socket, timeout); }
class class_name[name] begin[{] method[getOutputStream, return_type[type[OutputStream]], modifier[public static], parameter[socket, timeout]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=ClassCreator(arguments=[MemberReference(member=socket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SocketOutputStream, sub_type=None)), if_true=MethodInvocation(arguments=[], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=socket, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[OutputStream] identifier[getOutputStream] operator[SEP] identifier[Socket] identifier[socket] , Keyword[long] identifier[timeout] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] operator[SEP] identifier[socket] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[?] identifier[socket] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[:] Keyword[new] identifier[SocketOutputStream] operator[SEP] identifier[socket] , identifier[timeout] operator[SEP] operator[SEP] }
public <T extends Enum<T>> T answer(final Class<T> enumClass) { return answer(enumClass, "unknown value"); }
class class_name[name] begin[{] method[answer, return_type[type[T]], modifier[public], parameter[enumClass]] begin[{] return[call[.answer, parameter[member[.enumClass], literal["unknown value"]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Enum] operator[<] identifier[T] operator[>] operator[>] identifier[T] identifier[answer] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[enumClass] operator[SEP] { Keyword[return] identifier[answer] operator[SEP] identifier[enumClass] , literal[String] operator[SEP] operator[SEP] }
public static URL getResource(String resourceName, Class<?> callingClass) { URL url = getContextClassLoader().getResource(resourceName); if (url == null && resourceName.startsWith("/")) { //certain classloaders need it without the leading / url = getContextClassLoader().getResource(resourceName.substring(1)); } ClassLoader cluClassloader = ClassLoaderUtils.class.getClassLoader(); if (cluClassloader == null) { cluClassloader = ClassLoader.getSystemClassLoader(); } if (url == null) { url = cluClassloader.getResource(resourceName); } if (url == null && resourceName.startsWith("/")) { //certain classloaders need it without the leading / url = cluClassloader.getResource(resourceName.substring(1)); } if (url == null) { ClassLoader cl = callingClass.getClassLoader(); if (cl != null) { url = cl.getResource(resourceName); } } if (url == null) { url = callingClass.getResource(resourceName); } if ((url == null) && (resourceName != null) && (resourceName.charAt(0) != '/')) { return getResource('/' + resourceName, callingClass); } return url; }
class class_name[name] begin[{] method[getResource, return_type[type[URL]], modifier[public static], parameter[resourceName, callingClass]] begin[{] local_variable[type[URL], url] if[binary_operation[binary_operation[member[.url], ==, literal[null]], &&, call[resourceName.startsWith, parameter[literal["/"]]]]] begin[{] assign[member[.url], call[.getContextClassLoader, parameter[]]] else begin[{] None end[}] local_variable[type[ClassLoader], cluClassloader] if[binary_operation[member[.cluClassloader], ==, literal[null]]] begin[{] assign[member[.cluClassloader], call[ClassLoader.getSystemClassLoader, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.url], ==, literal[null]]] begin[{] assign[member[.url], call[cluClassloader.getResource, parameter[member[.resourceName]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.url], ==, literal[null]], &&, call[resourceName.startsWith, parameter[literal["/"]]]]] begin[{] assign[member[.url], call[cluClassloader.getResource, parameter[call[resourceName.substring, parameter[literal[1]]]]]] else begin[{] None end[}] if[binary_operation[member[.url], ==, literal[null]]] begin[{] local_variable[type[ClassLoader], cl] if[binary_operation[member[.cl], !=, literal[null]]] begin[{] assign[member[.url], call[cl.getResource, parameter[member[.resourceName]]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.url], ==, literal[null]]] begin[{] assign[member[.url], call[callingClass.getResource, parameter[member[.resourceName]]]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[member[.url], ==, literal[null]], &&, binary_operation[member[.resourceName], !=, literal[null]]], &&, binary_operation[call[resourceName.charAt, parameter[literal[0]]], !=, literal['/']]]] begin[{] return[call[.getResource, parameter[binary_operation[literal['/'], +, member[.resourceName]], member[.callingClass]]]] else begin[{] None end[}] return[member[.url]] end[}] END[}]
Keyword[public] Keyword[static] identifier[URL] identifier[getResource] operator[SEP] identifier[String] identifier[resourceName] , identifier[Class] operator[<] operator[?] operator[>] identifier[callingClass] operator[SEP] { identifier[URL] identifier[url] operator[=] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getResource] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[&&] identifier[resourceName] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[url] operator[=] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getResource] operator[SEP] identifier[resourceName] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } identifier[ClassLoader] identifier[cluClassloader] operator[=] identifier[ClassLoaderUtils] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cluClassloader] operator[==] Other[null] operator[SEP] { identifier[cluClassloader] operator[=] identifier[ClassLoader] operator[SEP] identifier[getSystemClassLoader] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] { identifier[url] operator[=] identifier[cluClassloader] operator[SEP] identifier[getResource] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[&&] identifier[resourceName] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[url] operator[=] identifier[cluClassloader] operator[SEP] identifier[getResource] operator[SEP] identifier[resourceName] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] { identifier[ClassLoader] identifier[cl] operator[=] identifier[callingClass] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cl] operator[!=] Other[null] operator[SEP] { identifier[url] operator[=] identifier[cl] operator[SEP] identifier[getResource] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] { identifier[url] operator[=] identifier[callingClass] operator[SEP] identifier[getResource] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[resourceName] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[resourceName] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[!=] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[getResource] operator[SEP] literal[String] operator[+] identifier[resourceName] , identifier[callingClass] operator[SEP] operator[SEP] } Keyword[return] identifier[url] operator[SEP] }
public XMLGregorianCalendar newGYear(int year) { XMLGregorianCalendar cal=dataFactory.newXMLGregorianCalendar(); cal.setYear(year); return cal; }
class class_name[name] begin[{] method[newGYear, return_type[type[XMLGregorianCalendar]], modifier[public], parameter[year]] begin[{] local_variable[type[XMLGregorianCalendar], cal] call[cal.setYear, parameter[member[.year]]] return[member[.cal]] end[}] END[}]
Keyword[public] identifier[XMLGregorianCalendar] identifier[newGYear] operator[SEP] Keyword[int] identifier[year] operator[SEP] { identifier[XMLGregorianCalendar] identifier[cal] operator[=] identifier[dataFactory] operator[SEP] identifier[newXMLGregorianCalendar] operator[SEP] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[setYear] operator[SEP] identifier[year] operator[SEP] operator[SEP] Keyword[return] identifier[cal] operator[SEP] }
public void stopRecording(final Publication publication) { final String recordingChannel = ChannelUri.addSessionId(publication.channel(), publication.sessionId()); stopRecording(recordingChannel, publication.streamId()); }
class class_name[name] begin[{] method[stopRecording, return_type[void], modifier[public], parameter[publication]] begin[{] local_variable[type[String], recordingChannel] call[.stopRecording, parameter[member[.recordingChannel], call[publication.streamId, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[stopRecording] operator[SEP] Keyword[final] identifier[Publication] identifier[publication] operator[SEP] { Keyword[final] identifier[String] identifier[recordingChannel] operator[=] identifier[ChannelUri] operator[SEP] identifier[addSessionId] operator[SEP] identifier[publication] operator[SEP] identifier[channel] operator[SEP] operator[SEP] , identifier[publication] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stopRecording] operator[SEP] identifier[recordingChannel] , identifier[publication] operator[SEP] identifier[streamId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void setupFields() { FieldInfo field = null; field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null); field.setDataClass(Integer.class); field.setHidden(true); field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null); field.setDataClass(Date.class); field.setHidden(true); field = new FieldInfo(this, DELETED, 10, null, new Boolean(false)); field.setDataClass(Boolean.class); field.setHidden(true); field = new FieldInfo(this, START_ICON, Constants.DEFAULT_FIELD_LENGTH, null, null); field.setDataClass(Object.class); field = new FieldInfo(this, END_ICON, Constants.DEFAULT_FIELD_LENGTH, null, null); field.setDataClass(Object.class); field = new FieldInfo(this, START_PARENT_ICON, Constants.DEFAULT_FIELD_LENGTH, null, null); field.setDataClass(Object.class); field = new FieldInfo(this, END_PARENT_ICON, Constants.DEFAULT_FIELD_LENGTH, null, null); field.setDataClass(Object.class); field = new FieldInfo(this, TASK_COLOR, 10, null, null); field.setDataClass(Integer.class); field = new FieldInfo(this, TASK_SELECT_COLOR, 10, null, null); field.setDataClass(Integer.class); field = new FieldInfo(this, PARENT_TASK_COLOR, 10, null, null); field.setDataClass(Integer.class); field = new FieldInfo(this, PARENT_TASK_SELECT_COLOR, 10, null, null); field.setDataClass(Integer.class); }
class class_name[name] begin[{] method[setupFields, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[FieldInfo], field] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]] call[field.setHidden, parameter[literal[true]]] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=LAST_CHANGED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]] call[field.setHidden, parameter[literal[true]]] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=DELETED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]] call[field.setHidden, parameter[literal[true]]] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=START_ICON, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=END_ICON, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=START_PARENT_ICON, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=END_PARENT_ICON, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=TASK_COLOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=TASK_SELECT_COLOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=PARENT_TASK_COLOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=PARENT_TASK_SELECT_COLOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))] call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setupFields] operator[SEP] operator[SEP] { identifier[FieldInfo] identifier[field] operator[=] Other[null] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[ID] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setHidden] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[LAST_CHANGED] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Date] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setHidden] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[DELETED] , Other[10] , Other[null] , Keyword[new] identifier[Boolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setHidden] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[START_ICON] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[END_ICON] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[START_PARENT_ICON] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[END_PARENT_ICON] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[TASK_COLOR] , Other[10] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[TASK_SELECT_COLOR] , Other[10] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[PARENT_TASK_COLOR] , Other[10] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[PARENT_TASK_SELECT_COLOR] , Other[10] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public static String toHex(String str, Charset charset) { return HexUtil.encodeHexStr(str, charset); }
class class_name[name] begin[{] method[toHex, return_type[type[String]], modifier[public static], parameter[str, charset]] begin[{] return[call[HexUtil.encodeHexStr, parameter[member[.str], member[.charset]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[toHex] operator[SEP] identifier[String] identifier[str] , identifier[Charset] identifier[charset] operator[SEP] { Keyword[return] identifier[HexUtil] operator[SEP] identifier[encodeHexStr] operator[SEP] identifier[str] , identifier[charset] operator[SEP] operator[SEP] }
@Nullable public static XMLGregorianCalendar getXMLCalendarTime (@Nullable final XMLGregorianCalendar aBase) { if (aBase == null) return null; return s_aDTFactory.newXMLGregorianCalendarTime (aBase.getHour (), aBase.getMinute (), aBase.getSecond (), aBase.getMillisecond (), aBase.getTimezone ()); }
class class_name[name] begin[{] method[getXMLCalendarTime, return_type[type[XMLGregorianCalendar]], modifier[public static], parameter[aBase]] begin[{] if[binary_operation[member[.aBase], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[s_aDTFactory.newXMLGregorianCalendarTime, parameter[call[aBase.getHour, parameter[]], call[aBase.getMinute, parameter[]], call[aBase.getSecond, parameter[]], call[aBase.getMillisecond, parameter[]], call[aBase.getTimezone, parameter[]]]]] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[XMLGregorianCalendar] identifier[getXMLCalendarTime] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[XMLGregorianCalendar] identifier[aBase] operator[SEP] { Keyword[if] operator[SEP] identifier[aBase] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] identifier[s_aDTFactory] operator[SEP] identifier[newXMLGregorianCalendarTime] operator[SEP] identifier[aBase] operator[SEP] identifier[getHour] operator[SEP] operator[SEP] , identifier[aBase] operator[SEP] identifier[getMinute] operator[SEP] operator[SEP] , identifier[aBase] operator[SEP] identifier[getSecond] operator[SEP] operator[SEP] , identifier[aBase] operator[SEP] identifier[getMillisecond] operator[SEP] operator[SEP] , identifier[aBase] operator[SEP] identifier[getTimezone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void paint(Graphics g) { for (int i = 0; i < axis.length; i++) { axis[i].paint(g); } }
class class_name[name] begin[{] method[paint, return_type[void], modifier[public], parameter[g]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=axis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=paint, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=axis, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[paint] operator[SEP] identifier[Graphics] identifier[g] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[axis] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[axis] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[paint] operator[SEP] identifier[g] operator[SEP] operator[SEP] } }
public void addBookmarkedConference(String name, EntityBareJid jid, boolean isAutoJoin, Resourcepart nickname, String password) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { retrieveBookmarks(); BookmarkedConference bookmark = new BookmarkedConference(name, jid, isAutoJoin, nickname, password); List<BookmarkedConference> conferences = bookmarks.getBookmarkedConferences(); if (conferences.contains(bookmark)) { BookmarkedConference oldConference = conferences.get(conferences.indexOf(bookmark)); if (oldConference.isShared()) { throw new IllegalArgumentException("Cannot modify shared bookmark"); } oldConference.setAutoJoin(isAutoJoin); oldConference.setName(name); oldConference.setNickname(nickname); oldConference.setPassword(password); } else { bookmarks.addBookmarkedConference(bookmark); } privateDataManager.setPrivateData(bookmarks); }
class class_name[name] begin[{] method[addBookmarkedConference, return_type[void], modifier[public], parameter[name, jid, isAutoJoin, nickname, password]] begin[{] call[.retrieveBookmarks, parameter[]] local_variable[type[BookmarkedConference], bookmark] local_variable[type[List], conferences] if[call[conferences.contains, parameter[member[.bookmark]]]] begin[{] local_variable[type[BookmarkedConference], oldConference] if[call[oldConference.isShared, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot modify shared bookmark")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[oldConference.setAutoJoin, parameter[member[.isAutoJoin]]] call[oldConference.setName, parameter[member[.name]]] call[oldConference.setNickname, parameter[member[.nickname]]] call[oldConference.setPassword, parameter[member[.password]]] else begin[{] call[bookmarks.addBookmarkedConference, parameter[member[.bookmark]]] end[}] call[privateDataManager.setPrivateData, parameter[member[.bookmarks]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addBookmarkedConference] operator[SEP] identifier[String] identifier[name] , identifier[EntityBareJid] identifier[jid] , Keyword[boolean] identifier[isAutoJoin] , identifier[Resourcepart] identifier[nickname] , identifier[String] identifier[password] operator[SEP] Keyword[throws] identifier[NoResponseException] , identifier[XMPPErrorException] , identifier[NotConnectedException] , identifier[InterruptedException] { identifier[retrieveBookmarks] operator[SEP] operator[SEP] operator[SEP] identifier[BookmarkedConference] identifier[bookmark] operator[=] Keyword[new] identifier[BookmarkedConference] operator[SEP] identifier[name] , identifier[jid] , identifier[isAutoJoin] , identifier[nickname] , identifier[password] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[BookmarkedConference] operator[>] identifier[conferences] operator[=] identifier[bookmarks] operator[SEP] identifier[getBookmarkedConferences] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conferences] operator[SEP] identifier[contains] operator[SEP] identifier[bookmark] operator[SEP] operator[SEP] { identifier[BookmarkedConference] identifier[oldConference] operator[=] identifier[conferences] operator[SEP] identifier[get] operator[SEP] identifier[conferences] operator[SEP] identifier[indexOf] operator[SEP] identifier[bookmark] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldConference] operator[SEP] identifier[isShared] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[oldConference] operator[SEP] identifier[setAutoJoin] operator[SEP] identifier[isAutoJoin] operator[SEP] operator[SEP] identifier[oldConference] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[oldConference] operator[SEP] identifier[setNickname] operator[SEP] identifier[nickname] operator[SEP] operator[SEP] identifier[oldConference] operator[SEP] identifier[setPassword] operator[SEP] identifier[password] operator[SEP] operator[SEP] } Keyword[else] { identifier[bookmarks] operator[SEP] identifier[addBookmarkedConference] operator[SEP] identifier[bookmark] operator[SEP] operator[SEP] } identifier[privateDataManager] operator[SEP] identifier[setPrivateData] operator[SEP] identifier[bookmarks] operator[SEP] operator[SEP] }
public static FedoraAPIM getStub(String protocol, String host, int port, String username, String password) throws MalformedURLException, ServiceException { if (!"http".equalsIgnoreCase(protocol) && !"https".equalsIgnoreCase(protocol)) { throw new javax.xml.rpc.ServiceException("The protocol" + " " + protocol + " is not supported by this service."); } Map<String, Object> props = new HashMap<String, Object>(); props.put("mtom-enabled", Boolean.FALSE); org.apache.cxf.jaxws.JaxWsProxyFactoryBean clientFactory = new org.apache.cxf.jaxws.JaxWsProxyFactoryBean(); clientFactory.setAddress(protocol + "://" + host + ":" + port + "/fedora/services/management"); clientFactory.setServiceClass(FedoraAPIM.class); clientFactory.setUsername(username); clientFactory.setPassword(password); clientFactory.setProperties(props); // LoggingInInterceptor log1 = new LoggingInInterceptor(new PrintWriter(System.out)); // LoggingOutInterceptor log2 = new LoggingOutInterceptor(new PrintWriter(System.out)); // clientFactory.getInInterceptors().add(log1); // clientFactory.getInInterceptors().add(log2); // temporarily turn off err stream, because initialization of service spams the stream PrintStream aux = System.err; System.setErr(new PrintStream(new OutputStream() { @Override public void write(int arg0) throws IOException { } })); FedoraAPIM service = (FedoraAPIM) clientFactory.create(); System.setErr(aux); if (Administrator.INSTANCE == null) { // if running without Administrator, don't wrap it with the statusbar stuff return service; } else { return new APIMStubWrapper(service); } }
class class_name[name] begin[{] method[getStub, return_type[type[FedoraAPIM]], modifier[public static], parameter[protocol, host, port, username, password]] begin[{] if[binary_operation[literal["http"], &&, literal["https"]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The protocol"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MemberReference(member=protocol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not supported by this service."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=xml, sub_type=ReferenceType(arguments=None, dimensions=None, name=rpc, sub_type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None))))), label=None) else begin[{] None end[}] local_variable[type[Map], props] call[props.put, parameter[literal["mtom-enabled"], member[Boolean.FALSE]]] local_variable[type[org], clientFactory] call[clientFactory.setAddress, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.protocol], +, literal["://"]], +, member[.host]], +, literal[":"]], +, member[.port]], +, literal["/fedora/services/management"]]]] call[clientFactory.setServiceClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FedoraAPIM, sub_type=None))]] call[clientFactory.setUsername, parameter[member[.username]]] call[clientFactory.setPassword, parameter[member[.password]]] call[clientFactory.setProperties, parameter[member[.props]]] local_variable[type[PrintStream], aux] call[System.setErr, parameter[ClassCreator(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[], documentation=None, modifiers={'public'}, name=write, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=BasicType(dimensions=[], name=int), varargs=False)], return_type=None, throws=['IOException'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OutputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PrintStream, sub_type=None))]] local_variable[type[FedoraAPIM], service] call[System.setErr, parameter[member[.aux]]] if[binary_operation[member[Administrator.INSTANCE], ==, literal[null]]] begin[{] return[member[.service]] else begin[{] return[ClassCreator(arguments=[MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=APIMStubWrapper, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[FedoraAPIM] identifier[getStub] operator[SEP] identifier[String] identifier[protocol] , identifier[String] identifier[host] , Keyword[int] identifier[port] , identifier[String] identifier[username] , identifier[String] identifier[password] operator[SEP] Keyword[throws] identifier[MalformedURLException] , identifier[ServiceException] { Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[protocol] operator[SEP] operator[&&] operator[!] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[protocol] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[rpc] operator[SEP] identifier[ServiceException] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[protocol] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[props] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[cxf] operator[SEP] identifier[jaxws] operator[SEP] identifier[JaxWsProxyFactoryBean] identifier[clientFactory] operator[=] Keyword[new] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[cxf] operator[SEP] identifier[jaxws] operator[SEP] identifier[JaxWsProxyFactoryBean] operator[SEP] operator[SEP] operator[SEP] identifier[clientFactory] operator[SEP] identifier[setAddress] operator[SEP] identifier[protocol] operator[+] literal[String] operator[+] identifier[host] operator[+] literal[String] operator[+] identifier[port] operator[+] literal[String] operator[SEP] operator[SEP] identifier[clientFactory] operator[SEP] identifier[setServiceClass] operator[SEP] identifier[FedoraAPIM] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[clientFactory] operator[SEP] identifier[setUsername] operator[SEP] identifier[username] operator[SEP] operator[SEP] identifier[clientFactory] operator[SEP] identifier[setPassword] operator[SEP] identifier[password] operator[SEP] operator[SEP] identifier[clientFactory] operator[SEP] identifier[setProperties] operator[SEP] identifier[props] operator[SEP] operator[SEP] identifier[PrintStream] identifier[aux] operator[=] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[System] operator[SEP] identifier[setErr] operator[SEP] Keyword[new] identifier[PrintStream] operator[SEP] Keyword[new] identifier[OutputStream] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[write] operator[SEP] Keyword[int] identifier[arg0] operator[SEP] Keyword[throws] identifier[IOException] { } } operator[SEP] operator[SEP] operator[SEP] identifier[FedoraAPIM] identifier[service] operator[=] operator[SEP] identifier[FedoraAPIM] operator[SEP] identifier[clientFactory] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setErr] operator[SEP] identifier[aux] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Administrator] operator[SEP] identifier[INSTANCE] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[service] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[APIMStubWrapper] operator[SEP] identifier[service] operator[SEP] operator[SEP] } }
@Override public void onTaskFailure(Execution taskExecution, Throwable cause) { executionGraph.getJobMasterMainThreadExecutor().assertRunningInMainThread(); // to better handle the lack of resources (potentially by a scale-in), we // make failures due to missing resources global failures if (cause instanceof NoResourceAvailableException) { LOG.info("Not enough resources to schedule {} - triggering full recovery.", taskExecution); executionGraph.failGlobal(cause); return; } LOG.info("Recovering task failure for {} (#{}) via individual restart.", taskExecution.getVertex().getTaskNameWithSubtaskIndex(), taskExecution.getAttemptNumber()); numTaskFailures.inc(); // trigger the restart once the task has reached its terminal state // Note: currently all tasks passed here are already in their terminal state, // so we could actually avoid the future. We use it anyways because it is cheap and // it helps to support better testing final CompletableFuture<ExecutionState> terminationFuture = taskExecution.getTerminalStateFuture(); terminationFuture.thenRun( () -> performExecutionVertexRestart(taskExecution.getVertex(), taskExecution.getGlobalModVersion())); }
class class_name[name] begin[{] method[onTaskFailure, return_type[void], modifier[public], parameter[taskExecution, cause]] begin[{] call[executionGraph.getJobMasterMainThreadExecutor, parameter[]] if[binary_operation[member[.cause], instanceof, type[NoResourceAvailableException]]] begin[{] call[LOG.info, parameter[literal["Not enough resources to schedule {} - triggering full recovery."], member[.taskExecution]]] call[executionGraph.failGlobal, parameter[member[.cause]]] return[None] else begin[{] None end[}] call[LOG.info, parameter[literal["Recovering task failure for {} (#{}) via individual restart."], call[taskExecution.getVertex, parameter[]], call[taskExecution.getAttemptNumber, parameter[]]]] call[numTaskFailures.inc, parameter[]] local_variable[type[CompletableFuture], terminationFuture] call[terminationFuture.thenRun, parameter[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getVertex, postfix_operators=[], prefix_operators=[], qualifier=taskExecution, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getGlobalModVersion, postfix_operators=[], prefix_operators=[], qualifier=taskExecution, selectors=[], type_arguments=None)], member=performExecutionVertexRestart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[])]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onTaskFailure] operator[SEP] identifier[Execution] identifier[taskExecution] , identifier[Throwable] identifier[cause] operator[SEP] { identifier[executionGraph] operator[SEP] identifier[getJobMasterMainThreadExecutor] operator[SEP] operator[SEP] operator[SEP] identifier[assertRunningInMainThread] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cause] Keyword[instanceof] identifier[NoResourceAvailableException] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[taskExecution] operator[SEP] operator[SEP] identifier[executionGraph] operator[SEP] identifier[failGlobal] operator[SEP] identifier[cause] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[taskExecution] operator[SEP] identifier[getVertex] operator[SEP] operator[SEP] operator[SEP] identifier[getTaskNameWithSubtaskIndex] operator[SEP] operator[SEP] , identifier[taskExecution] operator[SEP] identifier[getAttemptNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[numTaskFailures] operator[SEP] identifier[inc] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[CompletableFuture] operator[<] identifier[ExecutionState] operator[>] identifier[terminationFuture] operator[=] identifier[taskExecution] operator[SEP] identifier[getTerminalStateFuture] operator[SEP] operator[SEP] operator[SEP] identifier[terminationFuture] operator[SEP] identifier[thenRun] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[performExecutionVertexRestart] operator[SEP] identifier[taskExecution] operator[SEP] identifier[getVertex] operator[SEP] operator[SEP] , identifier[taskExecution] operator[SEP] identifier[getGlobalModVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public <E extends Model> LazyList<E> orderBy(String orderBy){ if(fullQuery != null && !forPaginator) throw new IllegalArgumentException("Cannot use .orderBy() if using free form SQL"); orderBys.add(orderBy); return (LazyList<E>) this; }
class class_name[name] begin[{] method[orderBy, return_type[type[LazyList]], modifier[public], parameter[orderBy]] begin[{] if[binary_operation[binary_operation[member[.fullQuery], !=, literal[null]], &&, member[.forPaginator]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot use .orderBy() if using free form SQL")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[orderBys.add, parameter[member[.orderBy]]] return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=[], name=LazyList, sub_type=None))] end[}] END[}]
Keyword[public] operator[<] identifier[E] Keyword[extends] identifier[Model] operator[>] identifier[LazyList] operator[<] identifier[E] operator[>] identifier[orderBy] operator[SEP] identifier[String] identifier[orderBy] operator[SEP] { Keyword[if] operator[SEP] identifier[fullQuery] operator[!=] Other[null] operator[&&] operator[!] identifier[forPaginator] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[orderBys] operator[SEP] identifier[add] operator[SEP] identifier[orderBy] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[LazyList] operator[<] identifier[E] operator[>] operator[SEP] Keyword[this] operator[SEP] }
public final void debug(String message, Throwable throwable) { if (isDebugEnabled()) { out.print( "[ maven embedder DEBUG] " ); out.println( message ); if (null != throwable) { throwable.printStackTrace( out ); } } }
class class_name[name] begin[{] method[debug, return_type[void], modifier[final public], parameter[message, throwable]] begin[{] if[call[.isDebugEnabled, parameter[]]] begin[{] call[out.print, parameter[literal["[ maven embedder DEBUG] "]]] call[out.println, parameter[member[.message]]] if[binary_operation[literal[null], !=, member[.throwable]]] begin[{] call[throwable.printStackTrace, parameter[member[.out]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[debug] operator[SEP] identifier[String] identifier[message] , identifier[Throwable] identifier[throwable] operator[SEP] { Keyword[if] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[message] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[throwable] operator[SEP] { identifier[throwable] operator[SEP] identifier[printStackTrace] operator[SEP] identifier[out] operator[SEP] operator[SEP] } } }
public static RealMatrix colSubtract (RealMatrix matrix, double[] vector) { // Declare and initialize the new matrix: double[][] retval = new double[matrix.getRowDimension()][matrix.getColumnDimension()]; // Iterate over rows: for (int col = 0; col < retval.length; col++) { // Iterate over columns: for (int row = 0; row < retval[0].length; row++) { retval[row][col] = matrix.getEntry(row, col) - vector[row]; } } // Done, return a new matrix: return MatrixUtils.createRealMatrix(retval); }
class class_name[name] begin[{] method[colSubtract, return_type[type[RealMatrix]], modifier[public static], parameter[matrix, vector]] begin[{] local_variable[type[double], retval] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEntry, postfix_operators=[], prefix_operators=[], qualifier=matrix, selectors=[], type_arguments=None), operandr=MemberReference(member=vector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=row)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=row, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=col)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=col, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[MatrixUtils.createRealMatrix, parameter[member[.retval]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[RealMatrix] identifier[colSubtract] operator[SEP] identifier[RealMatrix] identifier[matrix] , Keyword[double] operator[SEP] operator[SEP] identifier[vector] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[matrix] operator[SEP] identifier[getRowDimension] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[matrix] operator[SEP] identifier[getColumnDimension] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[col] operator[=] Other[0] operator[SEP] identifier[col] operator[<] identifier[retval] operator[SEP] identifier[length] operator[SEP] identifier[col] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[row] operator[=] Other[0] operator[SEP] identifier[row] operator[<] identifier[retval] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[row] operator[++] operator[SEP] { identifier[retval] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[col] operator[SEP] operator[=] identifier[matrix] operator[SEP] identifier[getEntry] operator[SEP] identifier[row] , identifier[col] operator[SEP] operator[-] identifier[vector] operator[SEP] identifier[row] operator[SEP] operator[SEP] } } Keyword[return] identifier[MatrixUtils] operator[SEP] identifier[createRealMatrix] operator[SEP] identifier[retval] operator[SEP] operator[SEP] }
public boolean lockBean(BeanO beanO, ContainerTx containerTx) throws RemoteException { return activator.lockBean(containerTx, beanO.beanId); // d140003.29 }
class class_name[name] begin[{] method[lockBean, return_type[type[boolean]], modifier[public], parameter[beanO, containerTx]] begin[{] return[call[activator.lockBean, parameter[member[.containerTx], member[beanO.beanId]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[lockBean] operator[SEP] identifier[BeanO] identifier[beanO] , identifier[ContainerTx] identifier[containerTx] operator[SEP] Keyword[throws] identifier[RemoteException] { Keyword[return] identifier[activator] operator[SEP] identifier[lockBean] operator[SEP] identifier[containerTx] , identifier[beanO] operator[SEP] identifier[beanId] operator[SEP] operator[SEP] }
public void initSchema() { List<Resource> scripts = getScripts("spring.datasource.data", this.properties.getData(), "data"); if (!scripts.isEmpty()) { if (!isEnabled()) { logger.debug("Initialization disabled (not running data scripts)"); return; } String username = this.properties.getDataUsername(); String password = this.properties.getDataPassword(); runScripts(scripts, username, password); } }
class class_name[name] begin[{] method[initSchema, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[List], scripts] if[call[scripts.isEmpty, parameter[]]] begin[{] if[call[.isEnabled, parameter[]]] begin[{] call[logger.debug, parameter[literal["Initialization disabled (not running data scripts)"]]] return[None] else begin[{] None end[}] local_variable[type[String], username] local_variable[type[String], password] call[.runScripts, parameter[member[.scripts], member[.username], member[.password]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[initSchema] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Resource] operator[>] identifier[scripts] operator[=] identifier[getScripts] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[properties] operator[SEP] identifier[getData] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[scripts] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[String] identifier[username] operator[=] Keyword[this] operator[SEP] identifier[properties] operator[SEP] identifier[getDataUsername] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[password] operator[=] Keyword[this] operator[SEP] identifier[properties] operator[SEP] identifier[getDataPassword] operator[SEP] operator[SEP] operator[SEP] identifier[runScripts] operator[SEP] identifier[scripts] , identifier[username] , identifier[password] operator[SEP] operator[SEP] } }
public int getLayerSize() { if (lookupTable != null && lookupTable.getWeights() != null) { return lookupTable.getWeights().columns(); } else return layerSize; }
class class_name[name] begin[{] method[getLayerSize, return_type[type[int]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[member[.lookupTable], !=, literal[null]], &&, binary_operation[call[lookupTable.getWeights, parameter[]], !=, literal[null]]]] begin[{] return[call[lookupTable.getWeights, parameter[]]] else begin[{] return[member[.layerSize]] end[}] end[}] END[}]
Keyword[public] Keyword[int] identifier[getLayerSize] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[lookupTable] operator[!=] Other[null] operator[&&] identifier[lookupTable] operator[SEP] identifier[getWeights] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[lookupTable] operator[SEP] identifier[getWeights] operator[SEP] operator[SEP] operator[SEP] identifier[columns] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[return] identifier[layerSize] operator[SEP] }
public static Set<Class<?>> getInterfaces(Class<?>target, ClassFilter filter) { Class<?> clazz = target; Set<Class<?>> interfacesFound = getDeclaredInterfaces(clazz, filter); while((clazz = clazz.getSuperclass()) != null) { interfacesFound.addAll(getDeclaredInterfaces(clazz, filter)); } return interfacesFound; }
class class_name[name] begin[{] method[getInterfaces, return_type[type[Set]], modifier[public static], parameter[target, filter]] begin[{] local_variable[type[Class], clazz] local_variable[type[Set], interfacesFound] while[binary_operation[assign[member[.clazz], call[clazz.getSuperclass, parameter[]]], !=, literal[null]]] begin[{] call[interfacesFound.addAll, parameter[call[.getDeclaredInterfaces, parameter[member[.clazz], member[.filter]]]]] end[}] return[member[.interfacesFound]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[getInterfaces] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[target] , identifier[ClassFilter] identifier[filter] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[target] operator[SEP] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[interfacesFound] operator[=] identifier[getDeclaredInterfaces] operator[SEP] identifier[clazz] , identifier[filter] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[clazz] operator[=] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[interfacesFound] operator[SEP] identifier[addAll] operator[SEP] identifier[getDeclaredInterfaces] operator[SEP] identifier[clazz] , identifier[filter] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[interfacesFound] operator[SEP] }
static String toChars(String p) { if (p.length() >= 3 && p.charAt(0) == '[' && p.charAt(p.length() - 1) == ']') { return p.substring(1, p.length() - 1); } return p; }
class class_name[name] begin[{] method[toChars, return_type[type[String]], modifier[static], parameter[p]] begin[{] if[binary_operation[binary_operation[binary_operation[call[p.length, parameter[]], >=, literal[3]], &&, binary_operation[call[p.charAt, parameter[literal[0]]], ==, literal['[']]], &&, binary_operation[call[p.charAt, parameter[binary_operation[call[p.length, parameter[]], -, literal[1]]]], ==, literal[']']]]] begin[{] return[call[p.substring, parameter[literal[1], binary_operation[call[p.length, parameter[]], -, literal[1]]]]] else begin[{] None end[}] return[member[.p]] end[}] END[}]
Keyword[static] identifier[String] identifier[toChars] operator[SEP] identifier[String] identifier[p] operator[SEP] { Keyword[if] operator[SEP] identifier[p] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>=] Other[3] operator[&&] identifier[p] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[&&] identifier[p] operator[SEP] identifier[charAt] operator[SEP] identifier[p] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] { Keyword[return] identifier[p] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[p] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[return] identifier[p] operator[SEP] }
@Override public ReadSupport.ReadContext init(InitContext context) { final Configuration configuration = context.getConfiguration(); final MessageType fileMessageType = context.getFileSchema(); MessageType requestedProjection = fileMessageType; String partialSchemaString = configuration.get(ReadSupport.PARQUET_READ_SCHEMA); FieldProjectionFilter projectionFilter = getFieldProjectionFilter(configuration); if (partialSchemaString != null && projectionFilter != null) { throw new ThriftProjectionException( String.format("You cannot provide both a partial schema and field projection filter." + "Only one of (%s, %s, %s) should be set.", PARQUET_READ_SCHEMA, STRICT_THRIFT_COLUMN_FILTER_KEY, THRIFT_COLUMN_FILTER_KEY)); } else if (partialSchemaString != null) { requestedProjection = getSchemaForRead(fileMessageType, partialSchemaString); } else if (projectionFilter != null) { try { if (thriftClass == null) { thriftClass = getThriftClassFromMultipleFiles(context.getKeyValueMetadata(), configuration); } requestedProjection = getProjectedSchema(projectionFilter); } catch (ClassNotFoundException e) { throw new ThriftProjectionException("can not find thriftClass from configuration", e); } } MessageType schemaForRead = getSchemaForRead(fileMessageType, requestedProjection); return new ReadContext(schemaForRead); }
class class_name[name] begin[{] method[init, return_type[type[ReadSupport]], modifier[public], parameter[context]] begin[{] local_variable[type[Configuration], configuration] local_variable[type[MessageType], fileMessageType] local_variable[type[MessageType], requestedProjection] local_variable[type[String], partialSchemaString] local_variable[type[FieldProjectionFilter], projectionFilter] if[binary_operation[binary_operation[member[.partialSchemaString], !=, literal[null]], &&, binary_operation[member[.projectionFilter], !=, literal[null]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You cannot provide both a partial schema and field projection filter."), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Only one of (%s, %s, %s) should be set."), operator=+), MemberReference(member=PARQUET_READ_SCHEMA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=STRICT_THRIFT_COLUMN_FILTER_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=THRIFT_COLUMN_FILTER_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ThriftProjectionException, sub_type=None)), label=None) else begin[{] if[binary_operation[member[.partialSchemaString], !=, literal[null]]] begin[{] assign[member[.requestedProjection], call[.getSchemaForRead, parameter[member[.fileMessageType], member[.partialSchemaString]]]] else begin[{] if[binary_operation[member[.projectionFilter], !=, literal[null]]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=thriftClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=thriftClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKeyValueMetadata, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), MemberReference(member=configuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getThriftClassFromMultipleFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=requestedProjection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=projectionFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProjectedSchema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="can not find thriftClass from configuration"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ThriftProjectionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] end[}] local_variable[type[MessageType], schemaForRead] return[ClassCreator(arguments=[MemberReference(member=schemaForRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReadContext, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ReadSupport] operator[SEP] identifier[ReadContext] identifier[init] operator[SEP] identifier[InitContext] identifier[context] operator[SEP] { Keyword[final] identifier[Configuration] identifier[configuration] operator[=] identifier[context] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[MessageType] identifier[fileMessageType] operator[=] identifier[context] operator[SEP] identifier[getFileSchema] operator[SEP] operator[SEP] operator[SEP] identifier[MessageType] identifier[requestedProjection] operator[=] identifier[fileMessageType] operator[SEP] identifier[String] identifier[partialSchemaString] operator[=] identifier[configuration] operator[SEP] identifier[get] operator[SEP] identifier[ReadSupport] operator[SEP] identifier[PARQUET_READ_SCHEMA] operator[SEP] operator[SEP] identifier[FieldProjectionFilter] identifier[projectionFilter] operator[=] identifier[getFieldProjectionFilter] operator[SEP] identifier[configuration] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[partialSchemaString] operator[!=] Other[null] operator[&&] identifier[projectionFilter] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ThriftProjectionException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] literal[String] , identifier[PARQUET_READ_SCHEMA] , identifier[STRICT_THRIFT_COLUMN_FILTER_KEY] , identifier[THRIFT_COLUMN_FILTER_KEY] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[partialSchemaString] operator[!=] Other[null] operator[SEP] { identifier[requestedProjection] operator[=] identifier[getSchemaForRead] operator[SEP] identifier[fileMessageType] , identifier[partialSchemaString] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[projectionFilter] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[thriftClass] operator[==] Other[null] operator[SEP] { identifier[thriftClass] operator[=] identifier[getThriftClassFromMultipleFiles] operator[SEP] identifier[context] operator[SEP] identifier[getKeyValueMetadata] operator[SEP] operator[SEP] , identifier[configuration] operator[SEP] operator[SEP] } identifier[requestedProjection] operator[=] identifier[getProjectedSchema] operator[SEP] identifier[projectionFilter] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ThriftProjectionException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } identifier[MessageType] identifier[schemaForRead] operator[=] identifier[getSchemaForRead] operator[SEP] identifier[fileMessageType] , identifier[requestedProjection] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ReadContext] operator[SEP] identifier[schemaForRead] operator[SEP] operator[SEP] }
public static String[] internInPlace(String[] input) { if (input == null) { return null; } else if (input.length == 0) { return EMPTY_STRING_ARRAY; } for (int i=0; i<input.length; i++) { input[i] = Util.intern(input[i]); } return input; }
class class_name[name] begin[{] method[internInPlace, return_type[type[String]], modifier[public static], parameter[input]] begin[{] if[binary_operation[member[.input], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] if[binary_operation[member[input.length], ==, literal[0]]] begin[{] return[member[.EMPTY_STRING_ARRAY]] else begin[{] None end[}] end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=intern, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.input]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[internInPlace] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[input] operator[SEP] { Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[EMPTY_STRING_ARRAY] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[input] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[input] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[Util] operator[SEP] identifier[intern] operator[SEP] identifier[input] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[input] operator[SEP] }
public int put(Object key, int value) { if (key == null) key = NULL_KEY; synchronized (this) { int hash = key.hashCode() & _mask; for (Item item = _entries[hash]; item != null; item = item._next) { Object testKey = item._key; if (testKey == key || testKey.equals(key)) { int oldValue = item._value; item._value = value; return oldValue; } } Item item = new Item(key, value); item._next = _entries[hash]; _entries[hash] = item; _size++; } return NULL; }
class class_name[name] begin[{] method[put, return_type[type[int]], modifier[public], parameter[key, value]] begin[{] if[binary_operation[member[.key], ==, literal[null]]] begin[{] assign[member[.key], member[.NULL_KEY]] else begin[{] None end[}] SYNCHRONIZED[THIS[]] BEGIN[{] local_variable[type[int], hash] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=_key, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[]), name=testKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=testKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=testKey, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=_value, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[]), name=oldValue)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_value, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[]), type==, value=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ReturnStatement(expression=MemberReference(member=oldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=_entries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Item, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=_next, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[]))]), label=None) local_variable[type[Item], item] assign[member[item._next], member[._entries]] assign[member[._entries], member[.item]] member[._size] END[}] return[member[.NULL]] end[}] END[}]
Keyword[public] Keyword[int] identifier[put] operator[SEP] identifier[Object] identifier[key] , Keyword[int] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] identifier[key] operator[=] identifier[NULL_KEY] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[int] identifier[hash] operator[=] identifier[key] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[&] identifier[_mask] operator[SEP] Keyword[for] operator[SEP] identifier[Item] identifier[item] operator[=] identifier[_entries] operator[SEP] identifier[hash] operator[SEP] operator[SEP] identifier[item] operator[!=] Other[null] operator[SEP] identifier[item] operator[=] identifier[item] operator[SEP] identifier[_next] operator[SEP] { identifier[Object] identifier[testKey] operator[=] identifier[item] operator[SEP] identifier[_key] operator[SEP] Keyword[if] operator[SEP] identifier[testKey] operator[==] identifier[key] operator[||] identifier[testKey] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[int] identifier[oldValue] operator[=] identifier[item] operator[SEP] identifier[_value] operator[SEP] identifier[item] operator[SEP] identifier[_value] operator[=] identifier[value] operator[SEP] Keyword[return] identifier[oldValue] operator[SEP] } } identifier[Item] identifier[item] operator[=] Keyword[new] identifier[Item] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[_next] operator[=] identifier[_entries] operator[SEP] identifier[hash] operator[SEP] operator[SEP] identifier[_entries] operator[SEP] identifier[hash] operator[SEP] operator[=] identifier[item] operator[SEP] identifier[_size] operator[++] operator[SEP] } Keyword[return] identifier[NULL] operator[SEP] }
public static <T extends Comparable<? super T>> T median(T[] a) { return QuickSelect.median(a); }
class class_name[name] begin[{] method[median, return_type[type[T]], modifier[public static], parameter[a]] begin[{] return[call[QuickSelect.median, parameter[member[.a]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Comparable] operator[<] operator[?] Keyword[super] identifier[T] operator[>] operator[>] identifier[T] identifier[median] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[a] operator[SEP] { Keyword[return] identifier[QuickSelect] operator[SEP] identifier[median] operator[SEP] identifier[a] operator[SEP] operator[SEP] }