code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
@Override public Object parseObject(String source, ParsePosition pos) { if (!msgPattern.hasNamedArguments()) { return parse(source, pos); } else { return parseToMap(source, pos); } }
class class_name[name] begin[{] method[parseObject, return_type[type[Object]], modifier[public], parameter[source, pos]] begin[{] if[call[msgPattern.hasNamedArguments, parameter[]]] begin[{] return[call[.parse, parameter[member[.source], member[.pos]]]] else begin[{] return[call[.parseToMap, parameter[member[.source], member[.pos]]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[parseObject] operator[SEP] identifier[String] identifier[source] , identifier[ParsePosition] identifier[pos] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[msgPattern] operator[SEP] identifier[hasNamedArguments] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[parse] operator[SEP] identifier[source] , identifier[pos] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[parseToMap] operator[SEP] identifier[source] , identifier[pos] operator[SEP] operator[SEP] } }
public static ServerConnector createServerConnectorAndAddToServer(Server server) { ServerConnector connector = new ServerConnector(server, JettySetting.createHttpConnectionFactory()); connector.setHost(setting.getStr("host", "http", "0.0.0.0")); connector.setPort(setting.getInt("port", "http", 8090)); connector.setIdleTimeout(setting.getLong("idle-timeout", "http", 30000L)); server.addConnector(connector); return connector; }
class class_name[name] begin[{] method[createServerConnectorAndAddToServer, return_type[type[ServerConnector]], modifier[public static], parameter[server]] begin[{] local_variable[type[ServerConnector], connector] call[connector.setHost, parameter[call[setting.getStr, parameter[literal["host"], literal["http"], literal["0.0.0.0"]]]]] call[connector.setPort, parameter[call[setting.getInt, parameter[literal["port"], literal["http"], literal[8090]]]]] call[connector.setIdleTimeout, parameter[call[setting.getLong, parameter[literal["idle-timeout"], literal["http"], literal[30000L]]]]] call[server.addConnector, parameter[member[.connector]]] return[member[.connector]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ServerConnector] identifier[createServerConnectorAndAddToServer] operator[SEP] identifier[Server] identifier[server] operator[SEP] { identifier[ServerConnector] identifier[connector] operator[=] Keyword[new] identifier[ServerConnector] operator[SEP] identifier[server] , identifier[JettySetting] operator[SEP] identifier[createHttpConnectionFactory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[connector] operator[SEP] identifier[setHost] operator[SEP] identifier[setting] operator[SEP] identifier[getStr] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[connector] operator[SEP] identifier[setPort] operator[SEP] identifier[setting] operator[SEP] identifier[getInt] operator[SEP] literal[String] , literal[String] , Other[8090] operator[SEP] operator[SEP] operator[SEP] identifier[connector] operator[SEP] identifier[setIdleTimeout] operator[SEP] identifier[setting] operator[SEP] identifier[getLong] operator[SEP] literal[String] , literal[String] , Other[30000L] operator[SEP] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[addConnector] operator[SEP] identifier[connector] operator[SEP] operator[SEP] Keyword[return] identifier[connector] operator[SEP] }
protected InferredPrototype createPrototype(QualifiedActionName id, boolean isVarargs, FormalParameterProvider parameters) { assert parameters != null; final ActionParameterTypes key = new ActionParameterTypes(isVarargs, parameters.getFormalParameterCount()); final Map<ActionParameterTypes, List<InferredStandardParameter>> ip = buildSignaturesForArgDefaultValues( id.getDeclaringType(), key.toActionPrototype(id.getActionName()).toActionId(), parameters, key); final List<InferredStandardParameter> op = ip.remove(key); final InferredPrototype proto = new DefaultInferredPrototype( id, parameters, key, op, ip); final String containerID = id.getContainerID(); Map<String, Map<ActionParameterTypes, InferredPrototype>> c = this.prototypes.get(containerID); if (c == null) { c = new TreeMap<>(); this.prototypes.put(containerID, c); } Map<ActionParameterTypes, InferredPrototype> list = c.get(id.getActionName()); if (list == null) { list = new TreeMap<>(); c.put(id.getActionName(), list); } list.put(key, proto); return proto; }
class class_name[name] begin[{] method[createPrototype, return_type[type[InferredPrototype]], modifier[protected], parameter[id, isVarargs, parameters]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) local_variable[type[ActionParameterTypes], key] local_variable[type[Map], ip] local_variable[type[List], op] local_variable[type[InferredPrototype], proto] local_variable[type[String], containerID] local_variable[type[Map], c] if[binary_operation[member[.c], ==, literal[null]]] begin[{] assign[member[.c], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=TreeMap, sub_type=None))] THIS[member[None.prototypes]call[None.put, parameter[member[.containerID], member[.c]]]] else begin[{] None end[}] local_variable[type[Map], list] if[binary_operation[member[.list], ==, literal[null]]] begin[{] assign[member[.list], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=TreeMap, sub_type=None))] call[c.put, parameter[call[id.getActionName, parameter[]], member[.list]]] else begin[{] None end[}] call[list.put, parameter[member[.key], member[.proto]]] return[member[.proto]] end[}] END[}]
Keyword[protected] identifier[InferredPrototype] identifier[createPrototype] operator[SEP] identifier[QualifiedActionName] identifier[id] , Keyword[boolean] identifier[isVarargs] , identifier[FormalParameterProvider] identifier[parameters] operator[SEP] { Keyword[assert] identifier[parameters] operator[!=] Other[null] operator[SEP] Keyword[final] identifier[ActionParameterTypes] identifier[key] operator[=] Keyword[new] identifier[ActionParameterTypes] operator[SEP] identifier[isVarargs] , identifier[parameters] operator[SEP] identifier[getFormalParameterCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[ActionParameterTypes] , identifier[List] operator[<] identifier[InferredStandardParameter] operator[>] operator[>] identifier[ip] operator[=] identifier[buildSignaturesForArgDefaultValues] operator[SEP] identifier[id] operator[SEP] identifier[getDeclaringType] operator[SEP] operator[SEP] , identifier[key] operator[SEP] identifier[toActionPrototype] operator[SEP] identifier[id] operator[SEP] identifier[getActionName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toActionId] operator[SEP] operator[SEP] , identifier[parameters] , identifier[key] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[InferredStandardParameter] operator[>] identifier[op] operator[=] identifier[ip] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[final] identifier[InferredPrototype] identifier[proto] operator[=] Keyword[new] identifier[DefaultInferredPrototype] operator[SEP] identifier[id] , identifier[parameters] , identifier[key] , identifier[op] , identifier[ip] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[containerID] operator[=] identifier[id] operator[SEP] identifier[getContainerID] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[ActionParameterTypes] , identifier[InferredPrototype] operator[>] operator[>] identifier[c] operator[=] Keyword[this] operator[SEP] identifier[prototypes] operator[SEP] identifier[get] operator[SEP] identifier[containerID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] Other[null] operator[SEP] { identifier[c] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[prototypes] operator[SEP] identifier[put] operator[SEP] identifier[containerID] , identifier[c] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[ActionParameterTypes] , identifier[InferredPrototype] operator[>] identifier[list] operator[=] identifier[c] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] identifier[getActionName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[==] Other[null] operator[SEP] { identifier[list] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[put] operator[SEP] identifier[id] operator[SEP] identifier[getActionName] operator[SEP] operator[SEP] , identifier[list] operator[SEP] operator[SEP] } identifier[list] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[proto] operator[SEP] operator[SEP] Keyword[return] identifier[proto] operator[SEP] }
public String[] getFieldNames() { String[] s = new String[nfields]; for (int i = 0; i < nfields; i++) { s[i] = getFieldName(i); } return s; }
class class_name[name] begin[{] method[getFieldNames, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], s] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nfields, postfix_operators=[], prefix_operators=[], qualifier=, 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[.s]] end[}] END[}]
Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[getFieldNames] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[s] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[nfields] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nfields] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[s] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[getFieldName] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[s] operator[SEP] }
protected String createSortQuery(final List<DefaultKeyValue<String, Boolean>> fields) { StringBuilder builder = new StringBuilder("{"); Iterator<DefaultKeyValue<String, Boolean>> iter = fields.iterator(); while (iter.hasNext()) { DefaultKeyValue<String, Boolean> field = iter.next(); builder.append("\""); builder.append(field.getKey()); builder.append("\""); builder.append(":"); if (field.getValue()) { builder.append(1); } else { builder.append(-1); } if (iter.hasNext()) { builder.append(","); } } builder.append("}"); return builder.toString(); }
class class_name[name] begin[{] method[createSortQuery, return_type[type[String]], modifier[protected], parameter[fields]] begin[{] local_variable[type[StringBuilder], builder] local_variable[type[Iterator], iter] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[DefaultKeyValue], field] call[builder.append, parameter[literal["\""]]] call[builder.append, parameter[call[field.getKey, parameter[]]]] call[builder.append, parameter[literal["\""]]] call[builder.append, parameter[literal[":"]]] if[call[field.getValue, parameter[]]] begin[{] call[builder.append, parameter[literal[1]]] else begin[{] call[builder.append, parameter[literal[1]]] end[}] if[call[iter.hasNext, parameter[]]] begin[{] call[builder.append, parameter[literal[","]]] else begin[{] None end[}] end[}] call[builder.append, parameter[literal["}"]]] return[call[builder.toString, parameter[]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[createSortQuery] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[DefaultKeyValue] operator[<] identifier[String] , identifier[Boolean] operator[>] operator[>] identifier[fields] operator[SEP] { identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[DefaultKeyValue] operator[<] identifier[String] , identifier[Boolean] operator[>] operator[>] identifier[iter] operator[=] identifier[fields] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[DefaultKeyValue] operator[<] identifier[String] , identifier[Boolean] operator[>] identifier[field] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[field] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[else] { identifier[builder] operator[SEP] identifier[append] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
static INode[] getINodeArray(INode inode) throws IOException { // calculate the depth of this inode from root int depth = getPathDepth(inode); INode[] inodes = new INode[depth]; // fill up the inodes in the path from this inode to root for (int i = 0; i < depth; i++) { inodes[depth-i-1] = inode; inode = inode.parent; } return inodes; }
class class_name[name] begin[{] method[getINodeArray, return_type[type[INode]], modifier[static], parameter[inode]] begin[{] local_variable[type[int], depth] local_variable[type[INode], inodes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=inodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=depth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), type==, value=MemberReference(member=inode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=inode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=inode, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=depth, postfix_operators=[], prefix_operators=[], qualifier=, 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[.inodes]] end[}] END[}]
Keyword[static] identifier[INode] operator[SEP] operator[SEP] identifier[getINodeArray] operator[SEP] identifier[INode] identifier[inode] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[depth] operator[=] identifier[getPathDepth] operator[SEP] identifier[inode] operator[SEP] operator[SEP] identifier[INode] operator[SEP] operator[SEP] identifier[inodes] operator[=] Keyword[new] identifier[INode] operator[SEP] identifier[depth] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[depth] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[inodes] operator[SEP] identifier[depth] operator[-] identifier[i] operator[-] Other[1] operator[SEP] operator[=] identifier[inode] operator[SEP] identifier[inode] operator[=] identifier[inode] operator[SEP] identifier[parent] operator[SEP] } Keyword[return] identifier[inodes] operator[SEP] }
@Override public GetReservedInstancesExchangeQuoteResult getReservedInstancesExchangeQuote(GetReservedInstancesExchangeQuoteRequest request) { request = beforeClientExecution(request); return executeGetReservedInstancesExchangeQuote(request); }
class class_name[name] begin[{] method[getReservedInstancesExchangeQuote, return_type[type[GetReservedInstancesExchangeQuoteResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetReservedInstancesExchangeQuote, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetReservedInstancesExchangeQuoteResult] identifier[getReservedInstancesExchangeQuote] operator[SEP] identifier[GetReservedInstancesExchangeQuoteRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetReservedInstancesExchangeQuote] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public ClassReloadingStrategy reset(ClassFileLocator classFileLocator, Class<?>... type) throws IOException { if (type.length > 0) { try { strategy.reset(instrumentation, classFileLocator, Arrays.asList(type)); } catch (ClassNotFoundException exception) { throw new IllegalArgumentException("Cannot locate types " + Arrays.toString(type), exception); } catch (UnmodifiableClassException exception) { throw new IllegalStateException("Cannot reset types " + Arrays.toString(type), exception); } } return this; }
class class_name[name] begin[{] method[reset, return_type[type[ClassReloadingStrategy]], modifier[public], parameter[classFileLocator, type]] begin[{] if[binary_operation[member[type.length], >, literal[0]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=instrumentation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classFileLocator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=reset, postfix_operators=[], prefix_operators=[], qualifier=strategy, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot locate types "), operandr=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+), MemberReference(member=exception, 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=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['ClassNotFoundException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot reset types "), operandr=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+), MemberReference(member=exception, 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=exception, types=['UnmodifiableClassException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ClassReloadingStrategy] identifier[reset] operator[SEP] identifier[ClassFileLocator] identifier[classFileLocator] , identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[type] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[try] { identifier[strategy] operator[SEP] identifier[reset] operator[SEP] identifier[instrumentation] , identifier[classFileLocator] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[exception] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[type] operator[SEP] , identifier[exception] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnmodifiableClassException] identifier[exception] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[type] operator[SEP] , identifier[exception] operator[SEP] operator[SEP] } } Keyword[return] Keyword[this] operator[SEP] }
public static void setNumConverter(Class customClass, Class<? extends NumConverter> converterClass) { NumConverter nc = converterCache.get(customClass); if (nc == null) { synchronized (converterClass) { nc = converterCache.get(customClass); if (nc == null) { try { nc = (NumConverter) converterClass.newInstance(); } catch (Exception e) { throw new CalculatorException(e); } if (nc != null) { if (converterClass.isAnnotationPresent(SingletonExtension.class)) converterCache.put(customClass, nc); } } } } }
class class_name[name] begin[{] method[setNumConverter, return_type[void], modifier[public static], parameter[customClass, converterClass]] begin[{] local_variable[type[NumConverter], nc] if[binary_operation[member[.nc], ==, literal[null]]] begin[{] SYNCHRONIZED[member[.converterClass]] BEGIN[{] assign[member[.nc], call[converterCache.get, parameter[member[.customClass]]]] if[binary_operation[member[.nc], ==, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=converterClass, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=NumConverter, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[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=CalculatorException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.nc], !=, literal[null]]] begin[{] if[call[converterClass.isAnnotationPresent, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SingletonExtension, sub_type=None))]]] begin[{] call[converterCache.put, parameter[member[.customClass], member[.nc]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] END[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setNumConverter] operator[SEP] identifier[Class] identifier[customClass] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[NumConverter] operator[>] identifier[converterClass] operator[SEP] { identifier[NumConverter] identifier[nc] operator[=] identifier[converterCache] operator[SEP] identifier[get] operator[SEP] identifier[customClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nc] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[converterClass] operator[SEP] { identifier[nc] operator[=] identifier[converterCache] operator[SEP] identifier[get] operator[SEP] identifier[customClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nc] operator[==] Other[null] operator[SEP] { Keyword[try] { identifier[nc] operator[=] operator[SEP] identifier[NumConverter] operator[SEP] identifier[converterClass] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CalculatorException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[nc] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[converterClass] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[SingletonExtension] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[converterCache] operator[SEP] identifier[put] operator[SEP] identifier[customClass] , identifier[nc] operator[SEP] operator[SEP] } } } } }
public java.util.List<String> getAddIamRoles() { if (addIamRoles == null) { addIamRoles = new com.amazonaws.internal.SdkInternalList<String>(); } return addIamRoles; }
class class_name[name] begin[{] method[getAddIamRoles, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.addIamRoles], ==, literal[null]]] begin[{] assign[member[.addIamRoles], 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=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.addIamRoles]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[getAddIamRoles] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[addIamRoles] operator[==] Other[null] operator[SEP] { identifier[addIamRoles] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[addIamRoles] operator[SEP] }
public static AbstractExpression eliminateDuplicates(Collection<AbstractExpression> exprList) { // Eliminate duplicates by building the map of expression's ids, values. Map<String, AbstractExpression> subExprMap = new HashMap<String, AbstractExpression>(); for (AbstractExpression subExpr : exprList) { subExprMap.put(subExpr.m_id, subExpr); } // Now reconstruct the expression return ExpressionUtil.combinePredicates(subExprMap.values()); }
class class_name[name] begin[{] method[eliminateDuplicates, return_type[type[AbstractExpression]], modifier[public static], parameter[exprList]] begin[{] local_variable[type[Map], subExprMap] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_id, postfix_operators=[], prefix_operators=[], qualifier=subExpr, selectors=[]), MemberReference(member=subExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=subExprMap, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=exprList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subExpr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractExpression, sub_type=None))), label=None) return[call[ExpressionUtil.combinePredicates, parameter[call[subExprMap.values, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[AbstractExpression] identifier[eliminateDuplicates] operator[SEP] identifier[Collection] operator[<] identifier[AbstractExpression] operator[>] identifier[exprList] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[AbstractExpression] operator[>] identifier[subExprMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[AbstractExpression] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AbstractExpression] identifier[subExpr] operator[:] identifier[exprList] operator[SEP] { identifier[subExprMap] operator[SEP] identifier[put] operator[SEP] identifier[subExpr] operator[SEP] identifier[m_id] , identifier[subExpr] operator[SEP] operator[SEP] } Keyword[return] identifier[ExpressionUtil] operator[SEP] identifier[combinePredicates] operator[SEP] identifier[subExprMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static Date truncate(final Date date, final int field) { validateDateNotNull(date); final Calendar gval = Calendar.getInstance(); gval.setTime(date); modify(gval, field, ModifyType.TRUNCATE); return gval.getTime(); }
class class_name[name] begin[{] method[truncate, return_type[type[Date]], modifier[public static], parameter[date, field]] begin[{] call[.validateDateNotNull, parameter[member[.date]]] local_variable[type[Calendar], gval] call[gval.setTime, parameter[member[.date]]] call[.modify, parameter[member[.gval], member[.field], member[ModifyType.TRUNCATE]]] return[call[gval.getTime, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Date] identifier[truncate] operator[SEP] Keyword[final] identifier[Date] identifier[date] , Keyword[final] Keyword[int] identifier[field] operator[SEP] { identifier[validateDateNotNull] operator[SEP] identifier[date] operator[SEP] operator[SEP] Keyword[final] identifier[Calendar] identifier[gval] operator[=] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[gval] operator[SEP] identifier[setTime] operator[SEP] identifier[date] operator[SEP] operator[SEP] identifier[modify] operator[SEP] identifier[gval] , identifier[field] , identifier[ModifyType] operator[SEP] identifier[TRUNCATE] operator[SEP] operator[SEP] Keyword[return] identifier[gval] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] }
private static void addSpecificBrowserSettings( final DesiredCapabilities capabilities, final Builder builder) { if (capabilities.getBrowserName().equalsIgnoreCase( Constants.Browsers.FIREFOX)) { LOG.info("Browser is Firefox. Getting local profile"); FirefoxProfile profile = null; if (builder.profileLocation != null && !"".equalsIgnoreCase(builder.profileLocation)) { profile = new FirefoxProfile(new File(builder.profileLocation)); LOG.info("Firefox profile: " + builder.profileLocation); } else { LOG.info("Loading Firefox default sprofile"); ProfilesIni allProfiles = new ProfilesIni(); allProfiles.getProfile("default"); } capabilities.setCapability(FirefoxDriver.PROFILE, profile); if (builder.userAgent != null) { profile.setPreference("general.useragent.override", builder.userAgent); } } else if (capabilities.getBrowserName().equalsIgnoreCase( Constants.Browsers.CHROME)) { ChromeOptions options = new ChromeOptions(); if (builder.userAgent != null) { options.addArguments("user-agent=" + builder.userAgent); } capabilities.setCapability(ChromeOptions.CAPABILITY, options); } else if (capabilities.getBrowserName().equalsIgnoreCase( Constants.Browsers.IE)) { capabilities .setCapability( InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, builder.flakinessForIe); } LOG.info("Finished adding specific browser settings"); }
class class_name[name] begin[{] method[addSpecificBrowserSettings, return_type[void], modifier[private static], parameter[capabilities, builder]] begin[{] if[call[capabilities.getBrowserName, parameter[]]] begin[{] call[LOG.info, parameter[literal["Browser is Firefox. Getting local profile"]]] local_variable[type[FirefoxProfile], profile] if[binary_operation[binary_operation[member[builder.profileLocation], !=, literal[null]], &&, literal[""]]] begin[{] assign[member[.profile], ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=profileLocation, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FirefoxProfile, sub_type=None))] call[LOG.info, parameter[binary_operation[literal["Firefox profile: "], +, member[builder.profileLocation]]]] else begin[{] call[LOG.info, parameter[literal["Loading Firefox default sprofile"]]] local_variable[type[ProfilesIni], allProfiles] call[allProfiles.getProfile, parameter[literal["default"]]] end[}] call[capabilities.setCapability, parameter[member[FirefoxDriver.PROFILE], member[.profile]]] if[binary_operation[member[builder.userAgent], !=, literal[null]]] begin[{] call[profile.setPreference, parameter[literal["general.useragent.override"], member[builder.userAgent]]] else begin[{] None end[}] else begin[{] if[call[capabilities.getBrowserName, parameter[]]] begin[{] local_variable[type[ChromeOptions], options] if[binary_operation[member[builder.userAgent], !=, literal[null]]] begin[{] call[options.addArguments, parameter[binary_operation[literal["user-agent="], +, member[builder.userAgent]]]] else begin[{] None end[}] call[capabilities.setCapability, parameter[member[ChromeOptions.CAPABILITY], member[.options]]] else begin[{] if[call[capabilities.getBrowserName, parameter[]]] begin[{] call[capabilities.setCapability, parameter[member[InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS], member[builder.flakinessForIe]]] else begin[{] None end[}] end[}] end[}] call[LOG.info, parameter[literal["Finished adding specific browser settings"]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[addSpecificBrowserSettings] operator[SEP] Keyword[final] identifier[DesiredCapabilities] identifier[capabilities] , Keyword[final] identifier[Builder] identifier[builder] operator[SEP] { Keyword[if] operator[SEP] identifier[capabilities] operator[SEP] identifier[getBrowserName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[Constants] operator[SEP] identifier[Browsers] operator[SEP] identifier[FIREFOX] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[FirefoxProfile] identifier[profile] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[builder] operator[SEP] identifier[profileLocation] operator[!=] Other[null] operator[&&] operator[!] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[builder] operator[SEP] identifier[profileLocation] operator[SEP] operator[SEP] { identifier[profile] operator[=] Keyword[new] identifier[FirefoxProfile] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[builder] operator[SEP] identifier[profileLocation] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[builder] operator[SEP] identifier[profileLocation] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ProfilesIni] identifier[allProfiles] operator[=] Keyword[new] identifier[ProfilesIni] operator[SEP] operator[SEP] operator[SEP] identifier[allProfiles] operator[SEP] identifier[getProfile] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[capabilities] operator[SEP] identifier[setCapability] operator[SEP] identifier[FirefoxDriver] operator[SEP] identifier[PROFILE] , identifier[profile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[builder] operator[SEP] identifier[userAgent] operator[!=] Other[null] operator[SEP] { identifier[profile] operator[SEP] identifier[setPreference] operator[SEP] literal[String] , identifier[builder] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[capabilities] operator[SEP] identifier[getBrowserName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[Constants] operator[SEP] identifier[Browsers] operator[SEP] identifier[CHROME] operator[SEP] operator[SEP] { identifier[ChromeOptions] identifier[options] operator[=] Keyword[new] identifier[ChromeOptions] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[builder] operator[SEP] identifier[userAgent] operator[!=] Other[null] operator[SEP] { identifier[options] operator[SEP] identifier[addArguments] operator[SEP] literal[String] operator[+] identifier[builder] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] } identifier[capabilities] operator[SEP] identifier[setCapability] operator[SEP] identifier[ChromeOptions] operator[SEP] identifier[CAPABILITY] , identifier[options] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[capabilities] operator[SEP] identifier[getBrowserName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[Constants] operator[SEP] identifier[Browsers] operator[SEP] identifier[IE] operator[SEP] operator[SEP] { identifier[capabilities] operator[SEP] identifier[setCapability] operator[SEP] identifier[InternetExplorerDriver] operator[SEP] identifier[INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS] , identifier[builder] operator[SEP] identifier[flakinessForIe] operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") private static Map<String, Object> replaceWithLonghand(Map<String, Object> predicate) { Map<String, Object> accumulator = new HashMap<String, Object>(); if (predicate == null || predicate.isEmpty()) { return predicate; } String operator = (String) predicate.keySet().toArray()[0]; Object subPredicate = predicate.get(operator); if (subPredicate instanceof Map) { accumulator.put(operator, replaceWithLonghand((Map<String, Object>) subPredicate)); } else if (negatedShortHand.get(operator) != null) { Map<String, Object> positivePredicate = new HashMap<String, Object>(); positivePredicate.put(negatedShortHand.get(operator), subPredicate); accumulator.put(NOT, positivePredicate); } else { accumulator.put(operator, subPredicate); } return accumulator; }
class class_name[name] begin[{] method[replaceWithLonghand, return_type[type[Map]], modifier[private static], parameter[predicate]] begin[{] local_variable[type[Map], accumulator] if[binary_operation[binary_operation[member[.predicate], ==, literal[null]], ||, call[predicate.isEmpty, parameter[]]]] begin[{] return[member[.predicate]] else begin[{] None end[}] local_variable[type[String], operator] local_variable[type[Object], subPredicate] if[binary_operation[member[.subPredicate], instanceof, type[Map]]] begin[{] call[accumulator.put, parameter[member[.operator], call[.replaceWithLonghand, parameter[Cast(expression=MemberReference(member=subPredicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))]]]] else begin[{] if[binary_operation[call[negatedShortHand.get, parameter[member[.operator]]], !=, literal[null]]] begin[{] local_variable[type[Map], positivePredicate] call[positivePredicate.put, parameter[call[negatedShortHand.get, parameter[member[.operator]]], member[.subPredicate]]] call[accumulator.put, parameter[member[.NOT], member[.positivePredicate]]] else begin[{] call[accumulator.put, parameter[member[.operator], member[.subPredicate]]] end[}] end[}] return[member[.accumulator]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[replaceWithLonghand] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[predicate] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[accumulator] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[predicate] operator[==] Other[null] operator[||] identifier[predicate] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[predicate] operator[SEP] } identifier[String] identifier[operator] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[predicate] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Object] identifier[subPredicate] operator[=] identifier[predicate] operator[SEP] identifier[get] operator[SEP] identifier[operator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[subPredicate] Keyword[instanceof] identifier[Map] operator[SEP] { identifier[accumulator] operator[SEP] identifier[put] operator[SEP] identifier[operator] , identifier[replaceWithLonghand] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[subPredicate] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[negatedShortHand] operator[SEP] identifier[get] operator[SEP] identifier[operator] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[positivePredicate] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[positivePredicate] operator[SEP] identifier[put] operator[SEP] identifier[negatedShortHand] operator[SEP] identifier[get] operator[SEP] identifier[operator] operator[SEP] , identifier[subPredicate] operator[SEP] operator[SEP] identifier[accumulator] operator[SEP] identifier[put] operator[SEP] identifier[NOT] , identifier[positivePredicate] operator[SEP] operator[SEP] } Keyword[else] { identifier[accumulator] operator[SEP] identifier[put] operator[SEP] identifier[operator] , identifier[subPredicate] operator[SEP] operator[SEP] } Keyword[return] identifier[accumulator] operator[SEP] }
public Proxy setPort( int port ) { if ( this.port == port ) { return this; } return new Proxy( type, host, port, auth ); }
class class_name[name] begin[{] method[setPort, return_type[type[Proxy]], modifier[public], parameter[port]] begin[{] if[binary_operation[THIS[member[None.port]], ==, member[.port]]] begin[{] return[THIS[]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=auth, 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=Proxy, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Proxy] identifier[setPort] operator[SEP] Keyword[int] identifier[port] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[port] operator[==] identifier[port] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } Keyword[return] Keyword[new] identifier[Proxy] operator[SEP] identifier[type] , identifier[host] , identifier[port] , identifier[auth] operator[SEP] operator[SEP] }
public static Document buildDocument(DocumentBuilder withBuilder, InputSource fromSource) throws IOException, SAXException { return withBuilder.parse(fromSource); }
class class_name[name] begin[{] method[buildDocument, return_type[type[Document]], modifier[public static], parameter[withBuilder, fromSource]] begin[{] return[call[withBuilder.parse, parameter[member[.fromSource]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Document] identifier[buildDocument] operator[SEP] identifier[DocumentBuilder] identifier[withBuilder] , identifier[InputSource] identifier[fromSource] operator[SEP] Keyword[throws] identifier[IOException] , identifier[SAXException] { Keyword[return] identifier[withBuilder] operator[SEP] identifier[parse] operator[SEP] identifier[fromSource] operator[SEP] operator[SEP] }
@Override public void configure() throws Exception { final Namespaces ns = new Namespaces("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); ns.add("indexing", "http://fedora.info/definitions/v4/indexing#"); final XPathBuilder indexable = new XPathBuilder( String.format("/rdf:RDF/rdf:Description/rdf:type[@rdf:resource='%s']", "http://fedora.info/definitions/v4/indexing#Indexable")); indexable.namespaces(ns); /** * A generic error handler (specific to this RouteBuilder) */ onException(Exception.class) .maximumRedeliveries("{{error.maxRedeliveries}}") .log("Index Routing Error: ${routeId}"); /** * route a message to the proper queue, based on whether * it is a DELETE or UPDATE operation. */ from("{{input.stream}}") .routeId("FcrepoTriplestoreRouter") .process(new EventProcessor()) .choice() .when(or(header(FCREPO_EVENT_TYPE).contains(RESOURCE_DELETION), header(FCREPO_EVENT_TYPE).contains(DELETE))) .to("direct:delete.triplestore") .otherwise() .to("direct:index.triplestore"); /** * Handle re-index events */ from("{{triplestore.reindex.stream}}") .routeId("FcrepoTriplestoreReindex") .to("direct:index.triplestore"); /** * Based on an item's metadata, determine if it is indexable. */ from("direct:index.triplestore") .routeId("FcrepoTriplestoreIndexer") .filter(not(in(tokenizePropertyPlaceholder(getContext(), "{{filter.containers}}", ",").stream() .map(uri -> or( header(FCREPO_URI).startsWith(constant(uri + "/")), header(FCREPO_URI).isEqualTo(constant(uri)))) .collect(toList())))) .removeHeaders("CamelHttp*") .choice() .when(simple("{{indexing.predicate}} != 'true'")) .to("direct:update.triplestore") .otherwise() .to("fcrepo:{{fcrepo.baseUrl}}?preferInclude=PreferMinimalContainer&accept=application/rdf+xml") .choice() .when(indexable) .to("direct:update.triplestore") .otherwise() .to("direct:delete.triplestore"); /** * Remove an item from the triplestore index. */ from("direct:delete.triplestore") .routeId("FcrepoTriplestoreDeleter") .process(new SparqlDeleteProcessor()) .log(LoggingLevel.INFO, LOGGER, "Deleting Triplestore Object ${headers[CamelFcrepoUri]}") .to("{{triplestore.baseUrl}}?useSystemProperties=true"); /** * Perform the sparql update. */ from("direct:update.triplestore") .routeId("FcrepoTriplestoreUpdater") .setHeader(FCREPO_NAMED_GRAPH) .simple("{{triplestore.namedGraph}}") .to("fcrepo:{{fcrepo.baseUrl}}?accept=application/n-triples" + "&preferOmit={{prefer.omit}}&preferInclude={{prefer.include}}") .process(new SparqlUpdateProcessor()) .log(LoggingLevel.INFO, LOGGER, "Indexing Triplestore Object ${headers[CamelFcrepoUri]}") .to("{{triplestore.baseUrl}}?useSystemProperties=true"); }
class class_name[name] begin[{] method[configure, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[Namespaces], ns] call[ns.add, parameter[literal["indexing"], literal["http://fedora.info/definitions/v4/indexing#"]]] local_variable[type[XPathBuilder], indexable] call[indexable.namespaces, parameter[member[.ns]]] call[.onException, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None))]] call[.from, parameter[literal["{{input.stream}}"]]] call[.from, parameter[literal["{{triplestore.reindex.stream}}"]]] call[.from, parameter[literal["direct:index.triplestore"]]] call[.from, parameter[literal["direct:delete.triplestore"]]] call[.from, parameter[literal["direct:update.triplestore"]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[configure] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[final] identifier[Namespaces] identifier[ns] operator[=] Keyword[new] identifier[Namespaces] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[ns] operator[SEP] identifier[add] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[XPathBuilder] identifier[indexable] operator[=] Keyword[new] identifier[XPathBuilder] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[indexable] operator[SEP] identifier[namespaces] operator[SEP] identifier[ns] operator[SEP] operator[SEP] identifier[onException] operator[SEP] identifier[Exception] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[maximumRedeliveries] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[log] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[from] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[routeId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[process] operator[SEP] Keyword[new] identifier[EventProcessor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[choice] operator[SEP] operator[SEP] operator[SEP] identifier[when] operator[SEP] identifier[or] operator[SEP] identifier[header] operator[SEP] identifier[FCREPO_EVENT_TYPE] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[RESOURCE_DELETION] operator[SEP] , identifier[header] operator[SEP] identifier[FCREPO_EVENT_TYPE] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[DELETE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[to] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[otherwise] operator[SEP] operator[SEP] operator[SEP] identifier[to] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[from] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[routeId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[to] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[from] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[routeId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[not] operator[SEP] identifier[in] operator[SEP] identifier[tokenizePropertyPlaceholder] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[uri] operator[->] identifier[or] operator[SEP] identifier[header] operator[SEP] identifier[FCREPO_URI] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[constant] operator[SEP] identifier[uri] operator[+] literal[String] operator[SEP] operator[SEP] , identifier[header] operator[SEP] identifier[FCREPO_URI] operator[SEP] operator[SEP] identifier[isEqualTo] operator[SEP] identifier[constant] operator[SEP] identifier[uri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[removeHeaders] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[choice] operator[SEP] operator[SEP] operator[SEP] identifier[when] operator[SEP] identifier[simple] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[to] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[otherwise] operator[SEP] operator[SEP] operator[SEP] identifier[to] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[choice] operator[SEP] operator[SEP] operator[SEP] identifier[when] operator[SEP] identifier[indexable] operator[SEP] operator[SEP] identifier[to] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[otherwise] operator[SEP] operator[SEP] operator[SEP] identifier[to] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[from] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[routeId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[process] operator[SEP] Keyword[new] identifier[SparqlDeleteProcessor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[LoggingLevel] operator[SEP] identifier[INFO] , identifier[LOGGER] , literal[String] operator[SEP] operator[SEP] identifier[to] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[from] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[routeId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[setHeader] operator[SEP] identifier[FCREPO_NAMED_GRAPH] operator[SEP] operator[SEP] identifier[simple] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[to] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[process] operator[SEP] Keyword[new] identifier[SparqlUpdateProcessor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[LoggingLevel] operator[SEP] identifier[INFO] , identifier[LOGGER] , literal[String] operator[SEP] operator[SEP] identifier[to] operator[SEP] literal[String] operator[SEP] operator[SEP] }
@Override public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) { writeReqContext = x; muxCallback = c; // callback will need to know how to get back to this write queue. // This means one and only one H2WriteTree per H2InboundLink which has just one true TCP Channel facing write callback muxCallback.setH2WorkQ(this); tree = new Tree(); }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[x, c]] begin[{] assign[member[.writeReqContext], member[.x]] assign[member[.muxCallback], member[.c]] call[muxCallback.setH2WorkQ, parameter[THIS[]]] assign[member[.tree], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Tree, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[TCPWriteRequestContext] identifier[x] , identifier[H2MuxTCPWriteCallback] identifier[c] operator[SEP] { identifier[writeReqContext] operator[=] identifier[x] operator[SEP] identifier[muxCallback] operator[=] identifier[c] operator[SEP] identifier[muxCallback] operator[SEP] identifier[setH2WorkQ] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[tree] operator[=] Keyword[new] identifier[Tree] operator[SEP] operator[SEP] operator[SEP] }
@Override public int nextDoc() throws IOException { do { IndexDoc indexDoc = mtasCodecInfo.getNextDoc(field, docId); if (indexDoc != null) { docId = indexDoc.docId; minPosition = Math.max(start, indexDoc.minPosition); maxPosition = Math.min(end, indexDoc.maxPosition); currentStartPosition = -1; currentEndPosition = -1; } else { docId = NO_MORE_DOCS; minPosition = NO_MORE_POSITIONS; maxPosition = NO_MORE_POSITIONS; currentStartPosition = NO_MORE_POSITIONS; currentEndPosition = NO_MORE_POSITIONS; } } while (docId != NO_MORE_DOCS && (minPosition > maxPosition)); return docId; }
class class_name[name] begin[{] method[nextDoc, return_type[type[int]], modifier[public], parameter[]] begin[{] do[binary_operation[binary_operation[member[.docId], !=, member[.NO_MORE_DOCS]], &&, binary_operation[member[.minPosition], >, member[.maxPosition]]]] begin[{] local_variable[type[IndexDoc], indexDoc] if[binary_operation[member[.indexDoc], !=, literal[null]]] begin[{] assign[member[.docId], member[indexDoc.docId]] assign[member[.minPosition], call[Math.max, parameter[member[.start], member[indexDoc.minPosition]]]] assign[member[.maxPosition], call[Math.min, parameter[member[.end], member[indexDoc.maxPosition]]]] assign[member[.currentStartPosition], literal[1]] assign[member[.currentEndPosition], literal[1]] else begin[{] assign[member[.docId], member[.NO_MORE_DOCS]] assign[member[.minPosition], member[.NO_MORE_POSITIONS]] assign[member[.maxPosition], member[.NO_MORE_POSITIONS]] assign[member[.currentStartPosition], member[.NO_MORE_POSITIONS]] assign[member[.currentEndPosition], member[.NO_MORE_POSITIONS]] end[}] end[}] return[member[.docId]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[nextDoc] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[do] { identifier[IndexDoc] identifier[indexDoc] operator[=] identifier[mtasCodecInfo] operator[SEP] identifier[getNextDoc] operator[SEP] identifier[field] , identifier[docId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[indexDoc] operator[!=] Other[null] operator[SEP] { identifier[docId] operator[=] identifier[indexDoc] operator[SEP] identifier[docId] operator[SEP] identifier[minPosition] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[start] , identifier[indexDoc] operator[SEP] identifier[minPosition] operator[SEP] operator[SEP] identifier[maxPosition] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[end] , identifier[indexDoc] operator[SEP] identifier[maxPosition] operator[SEP] operator[SEP] identifier[currentStartPosition] operator[=] operator[-] Other[1] operator[SEP] identifier[currentEndPosition] operator[=] operator[-] Other[1] operator[SEP] } Keyword[else] { identifier[docId] operator[=] identifier[NO_MORE_DOCS] operator[SEP] identifier[minPosition] operator[=] identifier[NO_MORE_POSITIONS] operator[SEP] identifier[maxPosition] operator[=] identifier[NO_MORE_POSITIONS] operator[SEP] identifier[currentStartPosition] operator[=] identifier[NO_MORE_POSITIONS] operator[SEP] identifier[currentEndPosition] operator[=] identifier[NO_MORE_POSITIONS] operator[SEP] } } Keyword[while] operator[SEP] identifier[docId] operator[!=] identifier[NO_MORE_DOCS] operator[&&] operator[SEP] identifier[minPosition] operator[>] identifier[maxPosition] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[docId] operator[SEP] }
public Throwable getOriginalException() { if (tc.isEntryEnabled()) Tr.entry(tc, "getOriginalException"); if (tc.isEntryEnabled()) Tr.exit(tc, "getOriginalException", _originalException); return _originalException; }
class class_name[name] begin[{] method[getOriginalException, return_type[type[Throwable]], modifier[public], parameter[]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["getOriginalException"]]] else begin[{] None end[}] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["getOriginalException"], member[._originalException]]] else begin[{] None end[}] return[member[._originalException]] end[}] END[}]
Keyword[public] identifier[Throwable] identifier[getOriginalException] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[_originalException] operator[SEP] operator[SEP] Keyword[return] identifier[_originalException] operator[SEP] }
private Boolean constraintsExists(String labelName, List<String> propertyNames) { Schema schema = db.schema(); for (ConstraintDefinition constraintDefinition : Iterables.asList(schema.getConstraints(Label.label(labelName)))) { List<String> properties = Iterables.asList(constraintDefinition.getPropertyKeys()); if (properties.equals(propertyNames)) { return true; } } return false; }
class class_name[name] begin[{] method[constraintsExists, return_type[type[Boolean]], modifier[private], parameter[labelName, propertyNames]] begin[{] local_variable[type[Schema], schema] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPropertyKeys, postfix_operators=[], prefix_operators=[], qualifier=constraintDefinition, selectors=[], type_arguments=None)], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Iterables, selectors=[], type_arguments=None), name=properties)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=propertyNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), 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=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=labelName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=label, postfix_operators=[], prefix_operators=[], qualifier=Label, selectors=[], type_arguments=None)], member=getConstraints, postfix_operators=[], prefix_operators=[], qualifier=schema, selectors=[], type_arguments=None)], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Iterables, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=constraintDefinition)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConstraintDefinition, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[private] identifier[Boolean] identifier[constraintsExists] operator[SEP] identifier[String] identifier[labelName] , identifier[List] operator[<] identifier[String] operator[>] identifier[propertyNames] operator[SEP] { identifier[Schema] identifier[schema] operator[=] identifier[db] operator[SEP] identifier[schema] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ConstraintDefinition] identifier[constraintDefinition] operator[:] identifier[Iterables] operator[SEP] identifier[asList] operator[SEP] identifier[schema] operator[SEP] identifier[getConstraints] operator[SEP] identifier[Label] operator[SEP] identifier[label] operator[SEP] identifier[labelName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[properties] operator[=] identifier[Iterables] operator[SEP] identifier[asList] operator[SEP] identifier[constraintDefinition] operator[SEP] identifier[getPropertyKeys] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[equals] operator[SEP] identifier[propertyNames] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
@Override public void cacheResult( CommerceNotificationQueueEntry commerceNotificationQueueEntry) { entityCache.putResult(CommerceNotificationQueueEntryModelImpl.ENTITY_CACHE_ENABLED, CommerceNotificationQueueEntryImpl.class, commerceNotificationQueueEntry.getPrimaryKey(), commerceNotificationQueueEntry); commerceNotificationQueueEntry.resetOriginalValues(); }
class class_name[name] begin[{] method[cacheResult, return_type[void], modifier[public], parameter[commerceNotificationQueueEntry]] begin[{] call[entityCache.putResult, parameter[member[CommerceNotificationQueueEntryModelImpl.ENTITY_CACHE_ENABLED], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceNotificationQueueEntryImpl, sub_type=None)), call[commerceNotificationQueueEntry.getPrimaryKey, parameter[]], member[.commerceNotificationQueueEntry]]] call[commerceNotificationQueueEntry.resetOriginalValues, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[cacheResult] operator[SEP] identifier[CommerceNotificationQueueEntry] identifier[commerceNotificationQueueEntry] operator[SEP] { identifier[entityCache] operator[SEP] identifier[putResult] operator[SEP] identifier[CommerceNotificationQueueEntryModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CommerceNotificationQueueEntryImpl] operator[SEP] Keyword[class] , identifier[commerceNotificationQueueEntry] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] , identifier[commerceNotificationQueueEntry] operator[SEP] operator[SEP] identifier[commerceNotificationQueueEntry] operator[SEP] identifier[resetOriginalValues] operator[SEP] operator[SEP] operator[SEP] }
protected void updateLocaleNodeSorting() { // check if the locale nodes require sorting List<Locale> locales = new ArrayList<Locale>(m_locales); Collections.sort(locales, new Comparator<Locale>() { public int compare(Locale o1, Locale o2) { return o1.toString().compareTo(o2.toString()); } }); List<Element> localeNodes = new ArrayList<Element>(m_document.getRootElement().elements()); boolean sortRequired = false; if (localeNodes.size() != locales.size()) { sortRequired = true; } else { int i = 0; for (Element el : localeNodes) { if (!locales.get(i).toString().equals(el.attributeValue("language"))) { sortRequired = true; break; } i++; } } if (sortRequired) { // do the actual node sorting, by removing the nodes first for (Element el : localeNodes) { m_document.getRootElement().remove(el); } Collections.sort(localeNodes, new Comparator<Object>() { public int compare(Object o1, Object o2) { String locale1 = ((Element)o1).attributeValue("language"); String locale2 = ((Element)o2).attributeValue("language"); return locale1.compareTo(locale2); } }); // re-adding the nodes in alphabetical order for (Element el : localeNodes) { m_document.getRootElement().add(el); } } }
class class_name[name] begin[{] method[updateLocaleNodeSorting, return_type[void], modifier[protected], parameter[]] begin[{] local_variable[type[List], locales] call[Collections.sort, parameter[member[.locales], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=o1, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=o2, selectors=[], type_arguments=None)], member=compareTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=compare, parameters=[FormalParameter(annotations=[], modifiers=set(), name=o1, type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=o2, type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None))], dimensions=None, name=Comparator, sub_type=None))]] local_variable[type[List], localeNodes] local_variable[type[boolean], sortRequired] if[binary_operation[call[localeNodes.size, parameter[]], !=, call[locales.size, parameter[]]]] begin[{] assign[member[.sortRequired], literal[true]] else begin[{] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=['!'], qualifier=locales, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="language")], member=attributeValue, postfix_operators=[], prefix_operators=[], qualifier=el, selectors=[], type_arguments=None)], member=equals, 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=sortRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=localeNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=el)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))), label=None) end[}] if[member[.sortRequired]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getRootElement, postfix_operators=[], prefix_operators=[], qualifier=m_document, selectors=[MethodInvocation(arguments=[MemberReference(member=el, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=localeNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=el)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))), label=None) call[Collections.sort, parameter[member[.localeNodes], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=locale1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=locale2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=locale2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareTo, postfix_operators=[], prefix_operators=[], qualifier=locale1, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=compare, parameters=[FormalParameter(annotations=[], modifiers=set(), name=o1, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=o2, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Comparator, sub_type=None))]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getRootElement, postfix_operators=[], prefix_operators=[], qualifier=m_document, selectors=[MethodInvocation(arguments=[MemberReference(member=el, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=localeNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=el)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[updateLocaleNodeSorting] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Locale] operator[>] identifier[locales] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Locale] operator[>] operator[SEP] identifier[m_locales] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[locales] , Keyword[new] identifier[Comparator] operator[<] identifier[Locale] operator[>] operator[SEP] operator[SEP] { Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[Locale] identifier[o1] , identifier[Locale] identifier[o2] operator[SEP] { Keyword[return] identifier[o1] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] identifier[o2] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Element] operator[>] identifier[localeNodes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Element] operator[>] operator[SEP] identifier[m_document] operator[SEP] identifier[getRootElement] operator[SEP] operator[SEP] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[sortRequired] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[localeNodes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[locales] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[sortRequired] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Element] identifier[el] operator[:] identifier[localeNodes] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[locales] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[el] operator[SEP] identifier[attributeValue] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] { identifier[sortRequired] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } identifier[i] operator[++] operator[SEP] } } Keyword[if] operator[SEP] identifier[sortRequired] operator[SEP] { Keyword[for] operator[SEP] identifier[Element] identifier[el] operator[:] identifier[localeNodes] operator[SEP] { identifier[m_document] operator[SEP] identifier[getRootElement] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[el] operator[SEP] operator[SEP] } identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[localeNodes] , Keyword[new] identifier[Comparator] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] { Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[Object] identifier[o1] , identifier[Object] identifier[o2] operator[SEP] { identifier[String] identifier[locale1] operator[=] operator[SEP] operator[SEP] identifier[Element] operator[SEP] identifier[o1] operator[SEP] operator[SEP] identifier[attributeValue] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[locale2] operator[=] operator[SEP] operator[SEP] identifier[Element] operator[SEP] identifier[o2] operator[SEP] operator[SEP] identifier[attributeValue] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[locale1] operator[SEP] identifier[compareTo] operator[SEP] identifier[locale2] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Element] identifier[el] operator[:] identifier[localeNodes] operator[SEP] { identifier[m_document] operator[SEP] identifier[getRootElement] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[el] operator[SEP] operator[SEP] } } }
public ConfigurationResult getConfiguration () throws ServiceException { requireAdminUser(); final ServletWaiter<ConfigurationResult> waiter = new ServletWaiter<ConfigurationResult>("getConfiguration"); _omgr.postRunnable(new Runnable() { public void run () { Map<String, ConfigurationRecord> tabs = Maps.newHashMap(); for (String key : _confReg.getKeys()) { ConfigurationRecord record = buildRecord(key); if (record == null) { waiter.requestFailed( new ServiceException(InvocationCodes.E_INTERNAL_ERROR)); return; } tabs.put(key, record); } ConfigurationResult result = new ConfigurationResult(); result.records = tabs; waiter.requestCompleted(result); } }); return waiter.waitForResult(); }
class class_name[name] begin[{] method[getConfiguration, return_type[type[ConfigurationResult]], modifier[public], parameter[]] begin[{] call[.requireAdminUser, parameter[]] local_variable[type[ServletWaiter], waiter] call[_omgr.postRunnable, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newHashMap, postfix_operators=[], prefix_operators=[], qualifier=Maps, selectors=[], type_arguments=None), name=tabs)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationRecord, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=record)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationRecord, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=record, 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=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=E_INTERNAL_ERROR, postfix_operators=[], prefix_operators=[], qualifier=InvocationCodes, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None))], member=requestFailed, postfix_operators=[], prefix_operators=[], qualifier=waiter, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=tabs, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getKeys, postfix_operators=[], prefix_operators=[], qualifier=_confReg, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=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=ConfigurationResult, sub_type=None)), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationResult, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=records, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MemberReference(member=tabs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=requestCompleted, postfix_operators=[], prefix_operators=[], qualifier=waiter, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))]] return[call[waiter.waitForResult, parameter[]]] end[}] END[}]
Keyword[public] identifier[ConfigurationResult] identifier[getConfiguration] operator[SEP] operator[SEP] Keyword[throws] identifier[ServiceException] { identifier[requireAdminUser] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ServletWaiter] operator[<] identifier[ConfigurationResult] operator[>] identifier[waiter] operator[=] Keyword[new] identifier[ServletWaiter] operator[<] identifier[ConfigurationResult] operator[>] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[_omgr] operator[SEP] identifier[postRunnable] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[ConfigurationRecord] operator[>] identifier[tabs] operator[=] identifier[Maps] operator[SEP] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[_confReg] operator[SEP] identifier[getKeys] operator[SEP] operator[SEP] operator[SEP] { identifier[ConfigurationRecord] identifier[record] operator[=] identifier[buildRecord] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[record] operator[==] Other[null] operator[SEP] { identifier[waiter] operator[SEP] identifier[requestFailed] operator[SEP] Keyword[new] identifier[ServiceException] operator[SEP] identifier[InvocationCodes] operator[SEP] identifier[E_INTERNAL_ERROR] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[tabs] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[record] operator[SEP] operator[SEP] } identifier[ConfigurationResult] identifier[result] operator[=] Keyword[new] identifier[ConfigurationResult] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[records] operator[=] identifier[tabs] operator[SEP] identifier[waiter] operator[SEP] identifier[requestCompleted] operator[SEP] identifier[result] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] identifier[waiter] operator[SEP] identifier[waitForResult] operator[SEP] operator[SEP] operator[SEP] }
public void tearDown() { try { TezJobExecHelper.killRunningJobs(); } catch (Throwable e) { LOGGER.warn("Failed to kill tez session: " + e.getMessage() + ". Turn on log level debug for stacktrace"); LOGGER.debug(e.getMessage(), e); } try { // Reset to default schema executeStatement("USE default"); } catch (Throwable e) { LOGGER.warn("Failed to reset to default schema: " + e.getMessage() + ". Turn on log level debug for stacktrace"); LOGGER.debug(e.getMessage(), e); } try { client.closeSession(sessionHandle); } catch (Throwable e) { LOGGER.warn( "Failed to close client session: " + e.getMessage() + ". Turn on log level debug for stacktrace"); LOGGER.debug(e.getMessage(), e); } try { hiveServer2.stop(); } catch (Throwable e) { LOGGER.warn("Failed to stop HiveServer2: " + e.getMessage() + ". Turn on log level debug for stacktrace"); LOGGER.debug(e.getMessage(), e); } hiveServer2 = null; client = null; sessionHandle = null; LOGGER.info("Tore down HiveServer instance"); }
class class_name[name] begin[{] method[tearDown, return_type[void], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=killRunningJobs, postfix_operators=[], prefix_operators=[], qualifier=TezJobExecHelper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to kill tez session: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Turn on log level debug for stacktrace"), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, 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=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, 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) TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="USE default")], member=executeStatement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to reset to default schema: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Turn on log level debug for stacktrace"), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, 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=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, 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) TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sessionHandle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to close client session: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Turn on log level debug for stacktrace"), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, 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=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, 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) TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=stop, postfix_operators=[], prefix_operators=[], qualifier=hiveServer2, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to stop HiveServer2: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Turn on log level debug for stacktrace"), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, 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=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, 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) assign[member[.hiveServer2], literal[null]] assign[member[.client], literal[null]] assign[member[.sessionHandle], literal[null]] call[LOGGER.info, parameter[literal["Tore down HiveServer instance"]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[tearDown] operator[SEP] operator[SEP] { Keyword[try] { identifier[TezJobExecHelper] operator[SEP] identifier[killRunningJobs] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[try] { identifier[executeStatement] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[try] { identifier[client] operator[SEP] identifier[closeSession] operator[SEP] identifier[sessionHandle] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[try] { identifier[hiveServer2] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } identifier[hiveServer2] operator[=] Other[null] operator[SEP] identifier[client] operator[=] Other[null] operator[SEP] identifier[sessionHandle] operator[=] Other[null] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] }
@Override public void addValueNode(IValueNode valueNode) { valueNodeMap.put(valueNode.getLanguage(), valueNode); valueNode.setParent(this); if (parent != null) { parent.fireValueNodeAdded(valueNode); } }
class class_name[name] begin[{] method[addValueNode, return_type[void], modifier[public], parameter[valueNode]] begin[{] call[valueNodeMap.put, parameter[call[valueNode.getLanguage, parameter[]], member[.valueNode]]] call[valueNode.setParent, parameter[THIS[]]] if[binary_operation[member[.parent], !=, literal[null]]] begin[{] call[parent.fireValueNodeAdded, parameter[member[.valueNode]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addValueNode] operator[SEP] identifier[IValueNode] identifier[valueNode] operator[SEP] { identifier[valueNodeMap] operator[SEP] identifier[put] operator[SEP] identifier[valueNode] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] , identifier[valueNode] operator[SEP] operator[SEP] identifier[valueNode] operator[SEP] identifier[setParent] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] { identifier[parent] operator[SEP] identifier[fireValueNodeAdded] operator[SEP] identifier[valueNode] operator[SEP] operator[SEP] } }
@Override public void close(VirtualConnection inVC, Exception e) { // This H2InboundLink.close method should only get called from the H2HttpInboundLinkWrap.close method. // for this reason, if we sync this method, then if a stream changes state while we are looking at it, we should // be able to do the close when that stream closing causes this close method to be called. // the device link close should always use the initial VC that this object was created with, so inVC will be ignored. synchronized (linkStatusSync) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "close(vc,e): :linkstatus: is: " + linkStatus + " :close: H2InboundLink hc: " + this.hashCode()); } if ((linkStatus == LINK_STATUS.CLOSING) || (linkStatus == LINK_STATUS.GOAWAY_SENDING) || (linkStatus == LINK_STATUS.WAIT_TO_SEND_GOAWAY)) { // another thread is in charge of closing, or another thread has already armed the future to close if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "close(vc,e): returning: close of muxLink is being done on a differnt thread" + " :close: H2InboundLink hc: " + this.hashCode()); } return; } if (e == null) { // Attempt to close down cleanly if all streams are closed. //Determine if all streams are in half closed or closed state //If not, do nothing and return //If so, look to see if the GoAway frame has been sent //If not, trigger a timer and wait to send the GOAWAY frame //If so, call close on the TCP-Channel/Device-Channel below us H2StreamProcessor stream; for (Integer i : streamTable.keySet()) { stream = streamTable.get(i); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "close(vc,e): looking at stream: " + stream.getId()); } if (stream.getId() != 0 && !stream.isHalfClosed() && !stream.isStreamClosed() && highestLocalStreamId > -1) { continue; } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "close(vc,e): stream not ready to close: " + stream.getId() + " :close: H2InboundLink hc: " + this.hashCode()); } return; } } } // All streams are either closed or in half closed, and a GOAWAY frame needs to be sent // Wait the timeout time and then send the GOAWAY frame with the last good stream linkStatus = LINK_STATUS.WAIT_TO_SEND_GOAWAY; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "close(vc,e): loading up the wait to close timeout" + " :close: H2InboundLink hc: " + this.hashCode()); } ScheduledExecutorService scheduler = CHFWBundle.getScheduledExecutorService(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "close : scheduler : " + scheduler + " config : " + config); } connTimeout = new H2ConnectionTimeout(e); if (e == null) { // close cleanly if no other traffic has been received for this H2 connection within the timeout // Save the future so we can cancel it later on closeFuture = scheduler.schedule(connTimeout, config.getH2ConnCloseTimeout(), TimeUnit.SECONDS); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "close(vc,e): close on link called with exception: " + e); } // do the close immediately on this thread connTimeout.run(); } } }
class class_name[name] begin[{] method[close, return_type[void], modifier[public], parameter[inVC, e]] begin[{] SYNCHRONIZED[member[.linkStatusSync]] BEGIN[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[literal["close(vc,e): :linkstatus: is: "], +, member[.linkStatus]], +, literal[" :close: H2InboundLink hc: "]], +, THIS[call[None.hashCode, parameter[]]]]]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[member[.linkStatus], ==, member[LINK_STATUS.CLOSING]], ||, binary_operation[member[.linkStatus], ==, member[LINK_STATUS.GOAWAY_SENDING]]], ||, binary_operation[member[.linkStatus], ==, member[LINK_STATUS.WAIT_TO_SEND_GOAWAY]]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[literal["close(vc,e): returning: close of muxLink is being done on a differnt thread"], +, literal[" :close: H2InboundLink hc: "]], +, THIS[call[None.hashCode, parameter[]]]]]] else begin[{] None end[}] return[None] else begin[{] None end[}] if[binary_operation[member[.e], ==, literal[null]]] begin[{] local_variable[type[H2StreamProcessor], stream] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=streamTable, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="close(vc,e): looking at stream: "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operandr=MethodInvocation(arguments=[], member=isHalfClosed, postfix_operators=[], prefix_operators=['!'], qualifier=stream, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=isStreamClosed, postfix_operators=[], prefix_operators=['!'], qualifier=stream, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=highestLocalStreamId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=>), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="close(vc,e): stream not ready to close: "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" :close: H2InboundLink hc: "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=hashCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=streamTable, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None) else begin[{] None end[}] assign[member[.linkStatus], member[LINK_STATUS.WAIT_TO_SEND_GOAWAY]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[literal["close(vc,e): loading up the wait to close timeout"], +, literal[" :close: H2InboundLink hc: "]], +, THIS[call[None.hashCode, parameter[]]]]]] else begin[{] None end[}] local_variable[type[ScheduledExecutorService], scheduler] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[literal["close : scheduler : "], +, member[.scheduler]], +, literal[" config : "]], +, member[.config]]]] else begin[{] None end[}] assign[member[.connTimeout], ClassCreator(arguments=[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=H2ConnectionTimeout, sub_type=None))] if[binary_operation[member[.e], ==, literal[null]]] begin[{] assign[member[.closeFuture], call[scheduler.schedule, parameter[member[.connTimeout], call[config.getH2ConnCloseTimeout, parameter[]], member[TimeUnit.SECONDS]]]] else begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[literal["close(vc,e): close on link called with exception: "], +, member[.e]]]] else begin[{] None end[}] call[connTimeout.run, parameter[]] end[}] END[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[close] operator[SEP] identifier[VirtualConnection] identifier[inVC] , identifier[Exception] identifier[e] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[linkStatusSync] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[linkStatus] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[linkStatus] operator[==] identifier[LINK_STATUS] operator[SEP] identifier[CLOSING] operator[SEP] operator[||] operator[SEP] identifier[linkStatus] operator[==] identifier[LINK_STATUS] operator[SEP] identifier[GOAWAY_SENDING] operator[SEP] operator[||] operator[SEP] identifier[linkStatus] operator[==] identifier[LINK_STATUS] operator[SEP] identifier[WAIT_TO_SEND_GOAWAY] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[e] operator[==] Other[null] operator[SEP] { identifier[H2StreamProcessor] identifier[stream] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[i] operator[:] identifier[streamTable] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[stream] operator[=] identifier[streamTable] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[stream] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[stream] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[!=] Other[0] operator[&&] operator[!] identifier[stream] operator[SEP] identifier[isHalfClosed] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[stream] operator[SEP] identifier[isStreamClosed] operator[SEP] operator[SEP] operator[&&] identifier[highestLocalStreamId] operator[>] operator[-] Other[1] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[stream] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } } } identifier[linkStatus] operator[=] identifier[LINK_STATUS] operator[SEP] identifier[WAIT_TO_SEND_GOAWAY] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ScheduledExecutorService] identifier[scheduler] operator[=] identifier[CHFWBundle] operator[SEP] identifier[getScheduledExecutorService] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[scheduler] operator[+] literal[String] operator[+] identifier[config] operator[SEP] operator[SEP] } identifier[connTimeout] operator[=] Keyword[new] identifier[H2ConnectionTimeout] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[e] operator[==] Other[null] operator[SEP] { identifier[closeFuture] operator[=] identifier[scheduler] operator[SEP] identifier[schedule] operator[SEP] identifier[connTimeout] , identifier[config] operator[SEP] identifier[getH2ConnCloseTimeout] operator[SEP] operator[SEP] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[e] operator[SEP] operator[SEP] } identifier[connTimeout] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } } }
void reload() { //begin-snippet-1 // The in the Activity which renders the ActionBar Entity entity = Entity.newInstance("http://getsocialize.com", "Socialize"); // Setup a listener to retain a reference MyActionBarListener listener = new MyActionBarListener(); // Use the listener when you show the action bar // The "this" argument refers to the current Activity ActionBarUtils.showActionBar(this, R.layout.actionbar, entity, null, listener); // Later (After the action bar has loaded!), you can reference the view to refresh ActionBarView view = listener.getActionBarView(); if (view != null) { Entity newEntity = new Entity(); // This would be your new entity view.setEntity(newEntity); view.refresh(); } //end-snippet-1 }
class class_name[name] begin[{] method[reload, return_type[void], modifier[default], parameter[]] begin[{] local_variable[type[Entity], entity] local_variable[type[MyActionBarListener], listener] call[ActionBarUtils.showActionBar, parameter[THIS[], member[R.layout.actionbar], member[.entity], literal[null], member[.listener]]] local_variable[type[ActionBarView], view] if[binary_operation[member[.view], !=, literal[null]]] begin[{] local_variable[type[Entity], newEntity] call[view.setEntity, parameter[member[.newEntity]]] call[view.refresh, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[reload] operator[SEP] operator[SEP] { identifier[Entity] identifier[entity] operator[=] identifier[Entity] operator[SEP] identifier[newInstance] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[MyActionBarListener] identifier[listener] operator[=] Keyword[new] identifier[MyActionBarListener] operator[SEP] operator[SEP] operator[SEP] identifier[ActionBarUtils] operator[SEP] identifier[showActionBar] operator[SEP] Keyword[this] , identifier[R] operator[SEP] identifier[layout] operator[SEP] identifier[actionbar] , identifier[entity] , Other[null] , identifier[listener] operator[SEP] operator[SEP] identifier[ActionBarView] identifier[view] operator[=] identifier[listener] operator[SEP] identifier[getActionBarView] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[view] operator[!=] Other[null] operator[SEP] { identifier[Entity] identifier[newEntity] operator[=] Keyword[new] identifier[Entity] operator[SEP] operator[SEP] operator[SEP] identifier[view] operator[SEP] identifier[setEntity] operator[SEP] identifier[newEntity] operator[SEP] operator[SEP] identifier[view] operator[SEP] identifier[refresh] operator[SEP] operator[SEP] operator[SEP] } }
private static void buildCellCommentFromalias(List<TieCommandAlias> tieCommandAliasList, Cell cell) { String value = CellUtility.getCellValueWithoutFormat(cell); if ((value!=null)&&(!value.isEmpty())) { for (TieCommandAlias alias : tieCommandAliasList) { Matcher matcher = alias.getPattern().matcher(value); if (matcher.find()) { CellUtility.createOrInsertComment(cell, alias.getCommand()); if (alias.isRemove()) { CellUtility.setCellValue(cell, ParserUtility.removeCharsFromString(value, matcher.start(), matcher.end())); } } } } }
class class_name[name] begin[{] method[buildCellCommentFromalias, return_type[void], modifier[private static], parameter[tieCommandAliasList, cell]] begin[{] local_variable[type[String], value] if[binary_operation[binary_operation[member[.value], !=, literal[null]], &&, call[value.isEmpty, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPattern, postfix_operators=[], prefix_operators=[], qualifier=alias, selectors=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cell, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getCommand, postfix_operators=[], prefix_operators=[], qualifier=alias, selectors=[], type_arguments=None)], member=createOrInsertComment, postfix_operators=[], prefix_operators=[], qualifier=CellUtility, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isRemove, postfix_operators=[], prefix_operators=[], qualifier=alias, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cell, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=start, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=end, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None)], member=removeCharsFromString, postfix_operators=[], prefix_operators=[], qualifier=ParserUtility, selectors=[], type_arguments=None)], member=setCellValue, postfix_operators=[], prefix_operators=[], qualifier=CellUtility, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=tieCommandAliasList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=alias)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TieCommandAlias, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[buildCellCommentFromalias] operator[SEP] identifier[List] operator[<] identifier[TieCommandAlias] operator[>] identifier[tieCommandAliasList] , identifier[Cell] identifier[cell] operator[SEP] { identifier[String] identifier[value] operator[=] identifier[CellUtility] operator[SEP] identifier[getCellValueWithoutFormat] operator[SEP] identifier[cell] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[value] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[TieCommandAlias] identifier[alias] operator[:] identifier[tieCommandAliasList] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[alias] operator[SEP] identifier[getPattern] operator[SEP] operator[SEP] operator[SEP] identifier[matcher] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[CellUtility] operator[SEP] identifier[createOrInsertComment] operator[SEP] identifier[cell] , identifier[alias] operator[SEP] identifier[getCommand] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[alias] operator[SEP] identifier[isRemove] operator[SEP] operator[SEP] operator[SEP] { identifier[CellUtility] operator[SEP] identifier[setCellValue] operator[SEP] identifier[cell] , identifier[ParserUtility] operator[SEP] identifier[removeCharsFromString] operator[SEP] identifier[value] , identifier[matcher] operator[SEP] identifier[start] operator[SEP] operator[SEP] , identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } }
public static void gray(Image srcImage, ImageOutputStream destImageStream) throws IORuntimeException { writeJpg(gray(srcImage), destImageStream); }
class class_name[name] begin[{] method[gray, return_type[void], modifier[public static], parameter[srcImage, destImageStream]] begin[{] call[.writeJpg, parameter[call[.gray, parameter[member[.srcImage]]], member[.destImageStream]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[gray] operator[SEP] identifier[Image] identifier[srcImage] , identifier[ImageOutputStream] identifier[destImageStream] operator[SEP] Keyword[throws] identifier[IORuntimeException] { identifier[writeJpg] operator[SEP] identifier[gray] operator[SEP] identifier[srcImage] operator[SEP] , identifier[destImageStream] operator[SEP] operator[SEP] }
private static CouchbaseResponse handleCommonResponseMessages(BinaryRequest request, FullBinaryMemcacheResponse msg, ResponseStatus status, boolean seqOnMutation) { CouchbaseResponse response = null; ByteBuf content = msg.content(); long cas = msg.getCAS(); short statusCode = msg.getStatus(); String bucket = request.bucket(); if (request instanceof GetRequest || request instanceof ReplicaGetRequest) { int flags = msg.getExtrasLength() > 0 ? msg.getExtras().getInt(0) : 0; response = new GetResponse(status, statusCode, cas, flags, bucket, content, request); } else if (request instanceof GetBucketConfigRequest) { response = new GetBucketConfigResponse(status, statusCode, bucket, content, ((GetBucketConfigRequest) request).hostname()); } else if (request instanceof InsertRequest) { MutationToken descr = extractToken(bucket, seqOnMutation, status.isSuccess(), msg.getExtras(), request.partition()); response = new InsertResponse(status, statusCode, cas, bucket, content, descr, request); } else if (request instanceof UpsertRequest) { MutationToken descr = extractToken(bucket, seqOnMutation, status.isSuccess(), msg.getExtras(), request.partition()); response = new UpsertResponse(status, statusCode, cas, bucket, content, descr, request); } else if (request instanceof ReplaceRequest) { MutationToken descr = extractToken(bucket, seqOnMutation, status.isSuccess(), msg.getExtras(), request.partition()); response = new ReplaceResponse(status, statusCode, cas, bucket, content, descr, request); } else if (request instanceof RemoveRequest) { MutationToken descr = extractToken(bucket, seqOnMutation, status.isSuccess(), msg.getExtras(), request.partition()); response = new RemoveResponse(status, statusCode, cas, bucket, content, descr, request); } return response; }
class class_name[name] begin[{] method[handleCommonResponseMessages, return_type[type[CouchbaseResponse]], modifier[private static], parameter[request, msg, status, seqOnMutation]] begin[{] local_variable[type[CouchbaseResponse], response] local_variable[type[ByteBuf], content] local_variable[type[long], cas] local_variable[type[short], statusCode] local_variable[type[String], bucket] if[binary_operation[binary_operation[member[.request], instanceof, type[GetRequest]], ||, binary_operation[member[.request], instanceof, type[ReplicaGetRequest]]]] begin[{] local_variable[type[int], flags] assign[member[.response], ClassCreator(arguments=[MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=statusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=request, 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=GetResponse, sub_type=None))] else begin[{] if[binary_operation[member[.request], instanceof, type[GetBucketConfigRequest]]] begin[{] assign[member[.response], ClassCreator(arguments=[MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=statusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=GetBucketConfigRequest, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GetBucketConfigResponse, sub_type=None))] else begin[{] if[binary_operation[member[.request], instanceof, type[InsertRequest]]] begin[{] local_variable[type[MutationToken], descr] assign[member[.response], ClassCreator(arguments=[MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=statusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=descr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=request, 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=InsertResponse, sub_type=None))] else begin[{] if[binary_operation[member[.request], instanceof, type[UpsertRequest]]] begin[{] local_variable[type[MutationToken], descr] assign[member[.response], ClassCreator(arguments=[MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=statusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=descr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=request, 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=UpsertResponse, sub_type=None))] else begin[{] if[binary_operation[member[.request], instanceof, type[ReplaceRequest]]] begin[{] local_variable[type[MutationToken], descr] assign[member[.response], ClassCreator(arguments=[MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=statusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=descr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=request, 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=ReplaceResponse, sub_type=None))] else begin[{] if[binary_operation[member[.request], instanceof, type[RemoveRequest]]] begin[{] local_variable[type[MutationToken], descr] assign[member[.response], ClassCreator(arguments=[MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=statusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=descr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=request, 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=RemoveResponse, sub_type=None))] else begin[{] None end[}] end[}] end[}] end[}] end[}] end[}] return[member[.response]] end[}] END[}]
Keyword[private] Keyword[static] identifier[CouchbaseResponse] identifier[handleCommonResponseMessages] operator[SEP] identifier[BinaryRequest] identifier[request] , identifier[FullBinaryMemcacheResponse] identifier[msg] , identifier[ResponseStatus] identifier[status] , Keyword[boolean] identifier[seqOnMutation] operator[SEP] { identifier[CouchbaseResponse] identifier[response] operator[=] Other[null] operator[SEP] identifier[ByteBuf] identifier[content] operator[=] identifier[msg] operator[SEP] identifier[content] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[cas] operator[=] identifier[msg] operator[SEP] identifier[getCAS] operator[SEP] operator[SEP] operator[SEP] Keyword[short] identifier[statusCode] operator[=] identifier[msg] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[bucket] operator[=] identifier[request] operator[SEP] identifier[bucket] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[request] Keyword[instanceof] identifier[GetRequest] operator[||] identifier[request] Keyword[instanceof] identifier[ReplicaGetRequest] operator[SEP] { Keyword[int] identifier[flags] operator[=] identifier[msg] operator[SEP] identifier[getExtrasLength] operator[SEP] operator[SEP] operator[>] Other[0] operator[?] identifier[msg] operator[SEP] identifier[getExtras] operator[SEP] operator[SEP] operator[SEP] identifier[getInt] operator[SEP] Other[0] operator[SEP] operator[:] Other[0] operator[SEP] identifier[response] operator[=] Keyword[new] identifier[GetResponse] operator[SEP] identifier[status] , identifier[statusCode] , identifier[cas] , identifier[flags] , identifier[bucket] , identifier[content] , identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] Keyword[instanceof] identifier[GetBucketConfigRequest] operator[SEP] { identifier[response] operator[=] Keyword[new] identifier[GetBucketConfigResponse] operator[SEP] identifier[status] , identifier[statusCode] , identifier[bucket] , identifier[content] , operator[SEP] operator[SEP] identifier[GetBucketConfigRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[hostname] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] Keyword[instanceof] identifier[InsertRequest] operator[SEP] { identifier[MutationToken] identifier[descr] operator[=] identifier[extractToken] operator[SEP] identifier[bucket] , identifier[seqOnMutation] , identifier[status] operator[SEP] identifier[isSuccess] operator[SEP] operator[SEP] , identifier[msg] operator[SEP] identifier[getExtras] operator[SEP] operator[SEP] , identifier[request] operator[SEP] identifier[partition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[=] Keyword[new] identifier[InsertResponse] operator[SEP] identifier[status] , identifier[statusCode] , identifier[cas] , identifier[bucket] , identifier[content] , identifier[descr] , identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] Keyword[instanceof] identifier[UpsertRequest] operator[SEP] { identifier[MutationToken] identifier[descr] operator[=] identifier[extractToken] operator[SEP] identifier[bucket] , identifier[seqOnMutation] , identifier[status] operator[SEP] identifier[isSuccess] operator[SEP] operator[SEP] , identifier[msg] operator[SEP] identifier[getExtras] operator[SEP] operator[SEP] , identifier[request] operator[SEP] identifier[partition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[=] Keyword[new] identifier[UpsertResponse] operator[SEP] identifier[status] , identifier[statusCode] , identifier[cas] , identifier[bucket] , identifier[content] , identifier[descr] , identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] Keyword[instanceof] identifier[ReplaceRequest] operator[SEP] { identifier[MutationToken] identifier[descr] operator[=] identifier[extractToken] operator[SEP] identifier[bucket] , identifier[seqOnMutation] , identifier[status] operator[SEP] identifier[isSuccess] operator[SEP] operator[SEP] , identifier[msg] operator[SEP] identifier[getExtras] operator[SEP] operator[SEP] , identifier[request] operator[SEP] identifier[partition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[=] Keyword[new] identifier[ReplaceResponse] operator[SEP] identifier[status] , identifier[statusCode] , identifier[cas] , identifier[bucket] , identifier[content] , identifier[descr] , identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] Keyword[instanceof] identifier[RemoveRequest] operator[SEP] { identifier[MutationToken] identifier[descr] operator[=] identifier[extractToken] operator[SEP] identifier[bucket] , identifier[seqOnMutation] , identifier[status] operator[SEP] identifier[isSuccess] operator[SEP] operator[SEP] , identifier[msg] operator[SEP] identifier[getExtras] operator[SEP] operator[SEP] , identifier[request] operator[SEP] identifier[partition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[=] Keyword[new] identifier[RemoveResponse] operator[SEP] identifier[status] , identifier[statusCode] , identifier[cas] , identifier[bucket] , identifier[content] , identifier[descr] , identifier[request] operator[SEP] operator[SEP] } Keyword[return] identifier[response] operator[SEP] }
public void start() { this.workerThread = new Thread(this); System.out.println("starting worker thread"); this.workerThread.start(); System.out.println("worker thread started"); }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[]] begin[{] assign[THIS[member[None.workerThread]], 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=None, dimensions=None, name=Thread, sub_type=None))] call[System.out.println, parameter[literal["starting worker thread"]]] THIS[member[None.workerThread]call[None.start, parameter[]]] call[System.out.println, parameter[literal["worker thread started"]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[workerThread] operator[=] Keyword[new] identifier[Thread] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[workerThread] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public void renamePath(final Path src, final Path dst, final Optional<String> group) { this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { Lock lock = ParallelRunner.this.locks.get(src.toString()); lock.lock(); try { if (ParallelRunner.this.fs.exists(src)) { HadoopUtils.renamePath(ParallelRunner.this.fs, src, dst); if (group.isPresent()) { HadoopUtils.setGroup(ParallelRunner.this.fs, dst, group.get()); } } return null; } catch (FileAlreadyExistsException e) { LOGGER.warn(String.format("Failed to rename %s to %s: dst already exists", src, dst), e); return null; } finally { lock.unlock(); } } }), "Rename " + src + " to " + dst)); }
class class_name[name] begin[{] method[renamePath, return_type[void], modifier[public], parameter[src, dst, group]] begin[{] THIS[member[None.futures]call[None.add, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=executor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=ParallelRunner, selectors=[MemberReference(member=locks, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=lock)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Lock, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=lock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None), TryStatement(block=[IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=ParallelRunner, selectors=[MemberReference(member=fs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exists, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=ParallelRunner, selectors=[MemberReference(member=fs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=renamePath, postfix_operators=[], prefix_operators=[], qualifier=HadoopUtils, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isPresent, postfix_operators=[], prefix_operators=[], qualifier=group, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=ParallelRunner, selectors=[MemberReference(member=fs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=group, selectors=[], type_arguments=None)], member=setGroup, postfix_operators=[], prefix_operators=[], qualifier=HadoopUtils, selectors=[], type_arguments=None), label=None)]))])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to rename %s to %s: dst already exists"), MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, 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=['FileAlreadyExistsException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], documentation=None, modifiers={'public'}, name=call, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None), throws=['Exception'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=None, name=Callable, sub_type=None))], member=submit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Rename "), operandr=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to "), operator=+), operandr=MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NamedFuture, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[renamePath] operator[SEP] Keyword[final] identifier[Path] identifier[src] , Keyword[final] identifier[Path] identifier[dst] , Keyword[final] identifier[Optional] operator[<] identifier[String] operator[>] identifier[group] operator[SEP] { Keyword[this] operator[SEP] identifier[futures] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[NamedFuture] operator[SEP] Keyword[this] operator[SEP] identifier[executor] operator[SEP] identifier[submit] operator[SEP] Keyword[new] identifier[Callable] operator[<] identifier[Void] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Void] identifier[call] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Lock] identifier[lock] operator[=] identifier[ParallelRunner] operator[SEP] Keyword[this] operator[SEP] identifier[locks] operator[SEP] identifier[get] operator[SEP] identifier[src] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[ParallelRunner] operator[SEP] Keyword[this] operator[SEP] identifier[fs] operator[SEP] identifier[exists] operator[SEP] identifier[src] operator[SEP] operator[SEP] { identifier[HadoopUtils] operator[SEP] identifier[renamePath] operator[SEP] identifier[ParallelRunner] operator[SEP] Keyword[this] operator[SEP] identifier[fs] , identifier[src] , identifier[dst] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[group] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { identifier[HadoopUtils] operator[SEP] identifier[setGroup] operator[SEP] identifier[ParallelRunner] operator[SEP] Keyword[this] operator[SEP] identifier[fs] , identifier[dst] , identifier[group] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileAlreadyExistsException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[src] , identifier[dst] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[finally] { identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } } } operator[SEP] , literal[String] operator[+] identifier[src] operator[+] literal[String] operator[+] identifier[dst] operator[SEP] operator[SEP] operator[SEP] }
public void setSubmissionTime(com.google.api.ads.admanager.axis.v201808.DateTime submissionTime) { this.submissionTime = submissionTime; }
class class_name[name] begin[{] method[setSubmissionTime, return_type[void], modifier[public], parameter[submissionTime]] begin[{] assign[THIS[member[None.submissionTime]], member[.submissionTime]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setSubmissionTime] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201808] operator[SEP] identifier[DateTime] identifier[submissionTime] operator[SEP] { Keyword[this] operator[SEP] identifier[submissionTime] operator[=] identifier[submissionTime] operator[SEP] }
public char pollChar() { if(hasNextChar()) { if(hasNextWord() && character+1 >= parsedLine.words().get(word).lineIndex()+ parsedLine.words().get(word).word().length()) word++; return parsedLine.line().charAt(character++); } return '\u0000'; }
class class_name[name] begin[{] method[pollChar, return_type[type[char]], modifier[public], parameter[]] begin[{] if[call[.hasNextChar, parameter[]]] begin[{] if[binary_operation[call[.hasNextWord, parameter[]], &&, binary_operation[binary_operation[member[.character], +, literal[1]], >=, binary_operation[call[parsedLine.words, parameter[]], +, call[parsedLine.words, parameter[]]]]]] begin[{] member[.word] else begin[{] None end[}] return[call[parsedLine.line, parameter[]]] else begin[{] None end[}] return[literal['']] end[}] END[}]
Keyword[public] Keyword[char] identifier[pollChar] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[hasNextChar] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[hasNextWord] operator[SEP] operator[SEP] operator[&&] identifier[character] operator[+] Other[1] operator[>=] identifier[parsedLine] operator[SEP] identifier[words] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[word] operator[SEP] operator[SEP] identifier[lineIndex] operator[SEP] operator[SEP] operator[+] identifier[parsedLine] operator[SEP] identifier[words] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[word] operator[SEP] operator[SEP] identifier[word] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[word] operator[++] operator[SEP] Keyword[return] identifier[parsedLine] operator[SEP] identifier[line] operator[SEP] operator[SEP] operator[SEP] identifier[charAt] operator[SEP] identifier[character] operator[++] operator[SEP] operator[SEP] } Keyword[return] literal[String] operator[SEP] }
public int read(User registrar) throws AffiliationException, InvalidArgumentException { if (registrar == null) { throw new InvalidArgumentException("Registrar should be a valid member"); } String readAffURL = ""; try { readAffURL = HFCA_AFFILIATION + "/" + name; logger.debug(format("affiliation url: %s, registrar: %s", readAffURL, registrar.getName())); JsonObject result = client.httpGet(readAffURL, registrar); logger.debug(format("affiliation url: %s, registrar: %s done.", readAffURL, registrar)); HFCAAffiliationResp resp = getResponse(result); this.childHFCAAffiliations = resp.getChildren(); this.identities = resp.getIdentities(); this.deleted = false; return resp.statusCode; } catch (HTTPException e) { String msg = format("[Code: %d] - Error while getting affiliation '%s' from url '%s': %s", e.getStatusCode(), this.name, readAffURL, e.getMessage()); AffiliationException affiliationException = new AffiliationException(msg, e); logger.error(msg); throw affiliationException; } catch (Exception e) { String msg = format("Error while getting affiliation %s url: %s %s ", this.name, readAffURL, e.getMessage()); AffiliationException affiliationException = new AffiliationException(msg, e); logger.error(msg); throw affiliationException; } }
class class_name[name] begin[{] method[read, return_type[type[int]], modifier[public], parameter[registrar]] begin[{] if[binary_operation[member[.registrar], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Registrar should be a valid member")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], readAffURL] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=readAffURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=HFCA_AFFILIATION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="affiliation url: %s, registrar: %s"), MemberReference(member=readAffURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=registrar, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=readAffURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=registrar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=httpGet, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="affiliation url: %s, registrar: %s done."), MemberReference(member=readAffURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=registrar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=resp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HFCAAffiliationResp, sub_type=None)), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=childHFCAAffiliations, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=identities, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[], member=getIdentities, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=deleted, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), ReturnStatement(expression=MemberReference(member=statusCode, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[]), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[Code: %d] - Error while getting affiliation '%s' from url '%s': %s"), MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=readAffURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=AffiliationException, sub_type=None)), name=affiliationException)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AffiliationException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=affiliationException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['HTTPException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while getting affiliation %s url: %s %s "), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=readAffURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=AffiliationException, sub_type=None)), name=affiliationException)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AffiliationException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=affiliationException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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[int] identifier[read] operator[SEP] identifier[User] identifier[registrar] operator[SEP] Keyword[throws] identifier[AffiliationException] , identifier[InvalidArgumentException] { Keyword[if] operator[SEP] identifier[registrar] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[readAffURL] operator[=] literal[String] operator[SEP] Keyword[try] { identifier[readAffURL] operator[=] identifier[HFCA_AFFILIATION] operator[+] literal[String] operator[+] identifier[name] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[readAffURL] , identifier[registrar] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[JsonObject] identifier[result] operator[=] identifier[client] operator[SEP] identifier[httpGet] operator[SEP] identifier[readAffURL] , identifier[registrar] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[readAffURL] , identifier[registrar] operator[SEP] operator[SEP] operator[SEP] identifier[HFCAAffiliationResp] identifier[resp] operator[=] identifier[getResponse] operator[SEP] identifier[result] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[childHFCAAffiliations] operator[=] identifier[resp] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[identities] operator[=] identifier[resp] operator[SEP] identifier[getIdentities] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[deleted] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[statusCode] operator[SEP] } Keyword[catch] operator[SEP] identifier[HTTPException] identifier[e] operator[SEP] { identifier[String] identifier[msg] operator[=] identifier[format] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[name] , identifier[readAffURL] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AffiliationException] identifier[affiliationException] operator[=] Keyword[new] identifier[AffiliationException] operator[SEP] identifier[msg] , identifier[e] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[throw] identifier[affiliationException] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[String] identifier[msg] operator[=] identifier[format] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[name] , identifier[readAffURL] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AffiliationException] identifier[affiliationException] operator[=] Keyword[new] identifier[AffiliationException] operator[SEP] identifier[msg] , identifier[e] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[throw] identifier[affiliationException] operator[SEP] } }
public static boolean isAutoScrollEdgeListItem( Context context, AccessibilityNodeInfoCompat node, int direction) { return isEdgeListItem(context, node, direction, FILTER_AUTO_SCROLL); }
class class_name[name] begin[{] method[isAutoScrollEdgeListItem, return_type[type[boolean]], modifier[public static], parameter[context, node, direction]] begin[{] return[call[.isEdgeListItem, parameter[member[.context], member[.node], member[.direction], member[.FILTER_AUTO_SCROLL]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isAutoScrollEdgeListItem] operator[SEP] identifier[Context] identifier[context] , identifier[AccessibilityNodeInfoCompat] identifier[node] , Keyword[int] identifier[direction] operator[SEP] { Keyword[return] identifier[isEdgeListItem] operator[SEP] identifier[context] , identifier[node] , identifier[direction] , identifier[FILTER_AUTO_SCROLL] operator[SEP] operator[SEP] }
public static CommerceOrderNote fetchByCommerceOrderId_Last( long commerceOrderId, OrderByComparator<CommerceOrderNote> orderByComparator) { return getPersistence() .fetchByCommerceOrderId_Last(commerceOrderId, orderByComparator); }
class class_name[name] begin[{] method[fetchByCommerceOrderId_Last, return_type[type[CommerceOrderNote]], modifier[public static], parameter[commerceOrderId, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommerceOrderNote] identifier[fetchByCommerceOrderId_Last] operator[SEP] Keyword[long] identifier[commerceOrderId] , identifier[OrderByComparator] operator[<] identifier[CommerceOrderNote] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByCommerceOrderId_Last] operator[SEP] identifier[commerceOrderId] , identifier[orderByComparator] operator[SEP] operator[SEP] }
@UiThread public void removeMarker(@NonNull MarkerView markerView) { if (mapView.isDestroyed() || !markers.contains(markerView)) { return; } mapView.removeView(markerView.getView()); markers.remove(markerView); }
class class_name[name] begin[{] method[removeMarker, return_type[void], modifier[public], parameter[markerView]] begin[{] if[binary_operation[call[mapView.isDestroyed, parameter[]], ||, call[markers.contains, parameter[member[.markerView]]]]] begin[{] return[None] else begin[{] None end[}] call[mapView.removeView, parameter[call[markerView.getView, parameter[]]]] call[markers.remove, parameter[member[.markerView]]] end[}] END[}]
annotation[@] identifier[UiThread] Keyword[public] Keyword[void] identifier[removeMarker] operator[SEP] annotation[@] identifier[NonNull] identifier[MarkerView] identifier[markerView] operator[SEP] { Keyword[if] operator[SEP] identifier[mapView] operator[SEP] identifier[isDestroyed] operator[SEP] operator[SEP] operator[||] operator[!] identifier[markers] operator[SEP] identifier[contains] operator[SEP] identifier[markerView] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[mapView] operator[SEP] identifier[removeView] operator[SEP] identifier[markerView] operator[SEP] identifier[getView] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[markers] operator[SEP] identifier[remove] operator[SEP] identifier[markerView] operator[SEP] operator[SEP] }
public boolean isAllInDefaultDataSource(final Collection<String> logicTableNames) { for (String each : logicTableNames) { if (findTableRule(each).isPresent() || isBroadcastTable(each)) { return false; } } return !logicTableNames.isEmpty(); }
class class_name[name] begin[{] method[isAllInDefaultDataSource, return_type[type[boolean]], modifier[public], parameter[logicTableNames]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=each, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findTableRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=isPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=each, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBroadcastTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=logicTableNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=each)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[logicTableNames.isEmpty, parameter[]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isAllInDefaultDataSource] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[String] operator[>] identifier[logicTableNames] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[each] operator[:] identifier[logicTableNames] operator[SEP] { Keyword[if] operator[SEP] identifier[findTableRule] operator[SEP] identifier[each] operator[SEP] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[||] identifier[isBroadcastTable] operator[SEP] identifier[each] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] operator[!] identifier[logicTableNames] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] }
@Override protected void disconnect() { // Stop thread super.disconnect(); // Stop multicast receiver if (multicastReceiver != null) { try { InetAddress address = InetAddress.getByName(udpAddress); multicastReceiver.leaveGroup(address); } catch (Exception ignored) { } try { multicastReceiver.close(); } catch (Exception ignored) { } multicastReceiver = null; String msg = "Multicast discovery service stopped on udp://" + udpAddress + ':' + udpPort; if (netIf == null) { logger.info(msg + '.'); } else { logger.info(msg + " (" + netIf.getDisplayName() + ")."); } } }
class class_name[name] begin[{] method[disconnect, return_type[void], modifier[protected], parameter[]] begin[{] SuperMethodInvocation(arguments=[], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) if[binary_operation[member[.multicastReceiver], !=, literal[null]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=udpAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByName, postfix_operators=[], prefix_operators=[], qualifier=InetAddress, selectors=[], type_arguments=None), name=address)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InetAddress, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=leaveGroup, postfix_operators=[], prefix_operators=[], qualifier=multicastReceiver, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['Exception']))], finally_block=None, label=None, resources=None) TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=multicastReceiver, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['Exception']))], finally_block=None, label=None, resources=None) assign[member[.multicastReceiver], literal[null]] local_variable[type[String], msg] if[binary_operation[member[.netIf], ==, literal[null]]] begin[{] call[logger.info, parameter[binary_operation[member[.msg], +, literal['.']]]] else begin[{] call[logger.info, parameter[binary_operation[binary_operation[binary_operation[member[.msg], +, literal[" ("]], +, call[netIf.getDisplayName, parameter[]]], +, literal[")."]]]] end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[disconnect] operator[SEP] operator[SEP] { Keyword[super] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[multicastReceiver] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[InetAddress] identifier[address] operator[=] identifier[InetAddress] operator[SEP] identifier[getByName] operator[SEP] identifier[udpAddress] operator[SEP] operator[SEP] identifier[multicastReceiver] operator[SEP] identifier[leaveGroup] operator[SEP] identifier[address] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ignored] operator[SEP] { } Keyword[try] { identifier[multicastReceiver] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ignored] operator[SEP] { } identifier[multicastReceiver] operator[=] Other[null] operator[SEP] identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[udpAddress] operator[+] literal[String] operator[+] identifier[udpPort] operator[SEP] Keyword[if] operator[SEP] identifier[netIf] operator[==] Other[null] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] identifier[msg] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[logger] operator[SEP] identifier[info] operator[SEP] identifier[msg] operator[+] literal[String] operator[+] identifier[netIf] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } } }
public void removeAppender(Appender appender) { boolean wasAttached = aai.isAttached(appender); if (wasAttached) { aai.removeAppender(appender); fireRemoveAppenderEvent(appender); } }
class class_name[name] begin[{] method[removeAppender, return_type[void], modifier[public], parameter[appender]] begin[{] local_variable[type[boolean], wasAttached] if[member[.wasAttached]] begin[{] call[aai.removeAppender, parameter[member[.appender]]] call[.fireRemoveAppenderEvent, parameter[member[.appender]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[removeAppender] operator[SEP] identifier[Appender] identifier[appender] operator[SEP] { Keyword[boolean] identifier[wasAttached] operator[=] identifier[aai] operator[SEP] identifier[isAttached] operator[SEP] identifier[appender] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wasAttached] operator[SEP] { identifier[aai] operator[SEP] identifier[removeAppender] operator[SEP] identifier[appender] operator[SEP] operator[SEP] identifier[fireRemoveAppenderEvent] operator[SEP] identifier[appender] operator[SEP] operator[SEP] } }
public void setForegroundType(final ForegroundType FOREGROUND_TYPE) { getModel().setForegroundType(FOREGROUND_TYPE); init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
class class_name[name] begin[{] method[setForegroundType, return_type[void], modifier[public], parameter[FOREGROUND_TYPE]] begin[{] call[.getModel, parameter[]] call[.init, parameter[call[.getInnerBounds, parameter[]], call[.getInnerBounds, parameter[]]]] call[.repaint, parameter[call[.getInnerBounds, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setForegroundType] operator[SEP] Keyword[final] identifier[ForegroundType] identifier[FOREGROUND_TYPE] operator[SEP] { identifier[getModel] operator[SEP] operator[SEP] operator[SEP] identifier[setForegroundType] operator[SEP] identifier[FOREGROUND_TYPE] operator[SEP] operator[SEP] identifier[init] operator[SEP] identifier[getInnerBounds] operator[SEP] operator[SEP] operator[SEP] identifier[width] , identifier[getInnerBounds] operator[SEP] operator[SEP] operator[SEP] identifier[height] operator[SEP] operator[SEP] identifier[repaint] operator[SEP] identifier[getInnerBounds] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static Map<String,String> extractDateToDayFromVerbatim(String verbatimEventDate, int yearsBeforeSuspect) { Map<String,String> result = extractDateFromVerbatim(verbatimEventDate, yearsBeforeSuspect); if (result.size()>0 && result.get("resultState").equals("range")) { String dateRange = result.get("result"); try { Interval parseDate = extractDateInterval(dateRange); logger.debug(parseDate); String resultDate = parseDate.getStart().toString("yyyy-MM-dd") + "/" + parseDate.getEnd().toString("yyyy-MM-dd"); result.put("result",resultDate); } catch (Exception e) { logger.debug(e.getMessage()); } } return result; }
class class_name[name] begin[{] method[extractDateToDayFromVerbatim, return_type[type[Map]], modifier[public static], parameter[verbatimEventDate, yearsBeforeSuspect]] begin[{] local_variable[type[Map], result] if[binary_operation[binary_operation[call[result.size, parameter[]], >, literal[0]], &&, call[result.get, parameter[literal["resultState"]]]]] begin[{] local_variable[type[String], dateRange] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dateRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractDateInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=parseDate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Interval, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=parseDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=parseDate, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yyyy-MM-dd")], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=parseDate, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yyyy-MM-dd")], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), name=resultDate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="result"), MemberReference(member=resultDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[extractDateToDayFromVerbatim] operator[SEP] identifier[String] identifier[verbatimEventDate] , Keyword[int] identifier[yearsBeforeSuspect] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[result] operator[=] identifier[extractDateFromVerbatim] operator[SEP] identifier[verbatimEventDate] , identifier[yearsBeforeSuspect] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] identifier[result] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[dateRange] operator[=] identifier[result] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[Interval] identifier[parseDate] operator[=] identifier[extractDateInterval] operator[SEP] identifier[dateRange] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[parseDate] operator[SEP] operator[SEP] identifier[String] identifier[resultDate] operator[=] identifier[parseDate] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[parseDate] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[resultDate] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public void endBlock() throws IOException { if (exception != null) throw exception; if (finished) throw new XZIOException("Stream finished or closed"); // NOTE: Once there is threading with multiple Blocks, it's possible // that this function will be more like a barrier that returns // before the last Block has been finished. if (blockEncoder != null) { try { blockEncoder.finish(); index.add(blockEncoder.getUnpaddedSize(), blockEncoder.getUncompressedSize()); blockEncoder = null; } catch (IOException e) { exception = e; throw e; } } }
class class_name[name] begin[{] method[endBlock, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.exception], !=, literal[null]]] begin[{] ThrowStatement(expression=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] if[member[.finished]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Stream finished or closed")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XZIOException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.blockEncoder], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=finish, postfix_operators=[], prefix_operators=[], qualifier=blockEncoder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getUnpaddedSize, postfix_operators=[], prefix_operators=[], qualifier=blockEncoder, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getUncompressedSize, postfix_operators=[], prefix_operators=[], qualifier=blockEncoder, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=blockEncoder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[endBlock] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[exception] operator[!=] Other[null] operator[SEP] Keyword[throw] identifier[exception] operator[SEP] Keyword[if] operator[SEP] identifier[finished] operator[SEP] Keyword[throw] Keyword[new] identifier[XZIOException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[blockEncoder] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[blockEncoder] operator[SEP] identifier[finish] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[SEP] identifier[add] operator[SEP] identifier[blockEncoder] operator[SEP] identifier[getUnpaddedSize] operator[SEP] operator[SEP] , identifier[blockEncoder] operator[SEP] identifier[getUncompressedSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[blockEncoder] operator[=] Other[null] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[exception] operator[=] identifier[e] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } } }
private <TEvent> void unimplemented(final long identifier, final TEvent event) { LOG.log(Level.SEVERE, "Unimplemented event: [{0}]: {1}", new Object[] {identifier, event}); throw new RuntimeException("Event not supported: " + event); }
class class_name[name] begin[{] method[unimplemented, return_type[void], modifier[private], parameter[identifier, event]] begin[{] call[LOG.log, parameter[member[Level.SEVERE], literal["Unimplemented event: [{0}]: {1}"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=identifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Event not supported: "), operandr=MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None) end[}] END[}]
Keyword[private] operator[<] identifier[TEvent] operator[>] Keyword[void] identifier[unimplemented] operator[SEP] Keyword[final] Keyword[long] identifier[identifier] , Keyword[final] identifier[TEvent] identifier[event] operator[SEP] { identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[identifier] , identifier[event] } operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[event] operator[SEP] operator[SEP] }
private static X509Certificate getReqSigCert(Message message) { List<WSHandlerResult> results = CastUtils.cast((List<?>) message.getExchange().getInMessage().get(WSHandlerConstants.RECV_RESULTS)); if (results == null) { return null; } /* * Scan the results for a matching actor. Use results only if the * receiving Actor and the sending Actor match. */ for (WSHandlerResult rResult : results) { List<WSSecurityEngineResult> wsSecEngineResults = rResult .getResults(); /* * Scan the results for the first Signature action. Use the * certificate of this Signature to set the certificate for the * encryption action :-). */ for (WSSecurityEngineResult wser : wsSecEngineResults) { Integer actInt = (Integer) wser .get(WSSecurityEngineResult.TAG_ACTION); if (actInt.intValue() == WSConstants.SIGN) { return (X509Certificate) wser .get(WSSecurityEngineResult.TAG_X509_CERTIFICATE); } } } return null; }
class class_name[name] begin[{] method[getReqSigCert, return_type[type[X509Certificate]], modifier[private static], parameter[message]] begin[{] local_variable[type[List], results] if[binary_operation[member[.results], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResults, postfix_operators=[], prefix_operators=[], qualifier=rResult, selectors=[], type_arguments=None), name=wsSecEngineResults)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=WSSecurityEngineResult, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=TAG_ACTION, postfix_operators=[], prefix_operators=[], qualifier=WSSecurityEngineResult, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=wser, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=actInt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=intValue, postfix_operators=[], prefix_operators=[], qualifier=actInt, selectors=[], type_arguments=None), operandr=MemberReference(member=SIGN, postfix_operators=[], prefix_operators=[], qualifier=WSConstants, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=TAG_X509_CERTIFICATE, postfix_operators=[], prefix_operators=[], qualifier=WSSecurityEngineResult, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=wser, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=X509Certificate, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=wsSecEngineResults, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=wser)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WSSecurityEngineResult, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rResult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WSHandlerResult, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[private] Keyword[static] identifier[X509Certificate] identifier[getReqSigCert] operator[SEP] identifier[Message] identifier[message] operator[SEP] { identifier[List] operator[<] identifier[WSHandlerResult] operator[>] identifier[results] operator[=] identifier[CastUtils] operator[SEP] identifier[cast] operator[SEP] operator[SEP] identifier[List] operator[<] operator[?] operator[>] operator[SEP] identifier[message] operator[SEP] identifier[getExchange] operator[SEP] operator[SEP] operator[SEP] identifier[getInMessage] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[WSHandlerConstants] operator[SEP] identifier[RECV_RESULTS] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[results] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[for] operator[SEP] identifier[WSHandlerResult] identifier[rResult] operator[:] identifier[results] operator[SEP] { identifier[List] operator[<] identifier[WSSecurityEngineResult] operator[>] identifier[wsSecEngineResults] operator[=] identifier[rResult] operator[SEP] identifier[getResults] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[WSSecurityEngineResult] identifier[wser] operator[:] identifier[wsSecEngineResults] operator[SEP] { identifier[Integer] identifier[actInt] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[wser] operator[SEP] identifier[get] operator[SEP] identifier[WSSecurityEngineResult] operator[SEP] identifier[TAG_ACTION] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[actInt] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[==] identifier[WSConstants] operator[SEP] identifier[SIGN] operator[SEP] { Keyword[return] operator[SEP] identifier[X509Certificate] operator[SEP] identifier[wser] operator[SEP] identifier[get] operator[SEP] identifier[WSSecurityEngineResult] operator[SEP] identifier[TAG_X509_CERTIFICATE] operator[SEP] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
@PublicEvolving public DataStreamSink<T> writeAsText(String path, WriteMode writeMode) { TextOutputFormat<T> tof = new TextOutputFormat<>(new Path(path)); tof.setWriteMode(writeMode); return writeUsingOutputFormat(tof); }
class class_name[name] begin[{] method[writeAsText, return_type[type[DataStreamSink]], modifier[public], parameter[path, writeMode]] begin[{] local_variable[type[TextOutputFormat], tof] call[tof.setWriteMode, parameter[member[.writeMode]]] return[call[.writeUsingOutputFormat, parameter[member[.tof]]]] end[}] END[}]
annotation[@] identifier[PublicEvolving] Keyword[public] identifier[DataStreamSink] operator[<] identifier[T] operator[>] identifier[writeAsText] operator[SEP] identifier[String] identifier[path] , identifier[WriteMode] identifier[writeMode] operator[SEP] { identifier[TextOutputFormat] operator[<] identifier[T] operator[>] identifier[tof] operator[=] Keyword[new] identifier[TextOutputFormat] operator[<] operator[>] operator[SEP] Keyword[new] identifier[Path] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] identifier[tof] operator[SEP] identifier[setWriteMode] operator[SEP] identifier[writeMode] operator[SEP] operator[SEP] Keyword[return] identifier[writeUsingOutputFormat] operator[SEP] identifier[tof] operator[SEP] operator[SEP] }
public void deactivateEndpoint(Object activationSpec, WSMessageEndpointFactory messageEndpointFactory) throws ResourceException { try { if (activationSpec instanceof ActivationSpec) { if (endpointActivationParams.remove(new ActivationParams(activationSpec, messageEndpointFactory))) endpointDeactivation((ActivationSpec) activationSpec, messageEndpointFactory); else if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "already deactivated"); } else { //TODO We need to handle the case when @Activation is used. throw new UnsupportedOperationException(); } } catch (Exception ex) { Tr.error(tc, "J2CA8803.deactivation.failed", bootstrapContextRef.getReference().getProperty(Constants.SERVICE_PID), ex); throw new ResourceException(ex); } }
class class_name[name] begin[{] method[deactivateEndpoint, return_type[void], modifier[public], parameter[activationSpec, messageEndpointFactory]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=activationSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ActivationSpec, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=activationSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=messageEndpointFactory, 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=ActivationParams, sub_type=None))], member=remove, postfix_operators=[], prefix_operators=[], qualifier=endpointActivationParams, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="already deactivated")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=activationSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ActivationSpec, sub_type=None)), MemberReference(member=messageEndpointFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endpointDeactivation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="J2CA8803.deactivation.failed"), MethodInvocation(arguments=[], member=getReference, postfix_operators=[], prefix_operators=[], qualifier=bootstrapContextRef, selectors=[MethodInvocation(arguments=[MemberReference(member=SERVICE_PID, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=getProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[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=ResourceException, 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[public] Keyword[void] identifier[deactivateEndpoint] operator[SEP] identifier[Object] identifier[activationSpec] , identifier[WSMessageEndpointFactory] identifier[messageEndpointFactory] operator[SEP] Keyword[throws] identifier[ResourceException] { Keyword[try] { Keyword[if] operator[SEP] identifier[activationSpec] Keyword[instanceof] identifier[ActivationSpec] operator[SEP] { Keyword[if] operator[SEP] identifier[endpointActivationParams] operator[SEP] identifier[remove] operator[SEP] Keyword[new] identifier[ActivationParams] operator[SEP] identifier[activationSpec] , identifier[messageEndpointFactory] operator[SEP] operator[SEP] operator[SEP] identifier[endpointDeactivation] operator[SEP] operator[SEP] identifier[ActivationSpec] operator[SEP] identifier[activationSpec] , identifier[messageEndpointFactory] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , identifier[bootstrapContextRef] operator[SEP] identifier[getReference] operator[SEP] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] identifier[Constants] operator[SEP] identifier[SERVICE_PID] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ResourceException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") public static <K, V> ImmutableBiMap<K, V> of() { return (ImmutableBiMap<K, V>) EmptyImmutableBiMap.INSTANCE; }
class class_name[name] begin[{] method[of, return_type[type[ImmutableBiMap]], modifier[public static], parameter[]] begin[{] return[Cast(expression=MemberReference(member=INSTANCE, postfix_operators=[], prefix_operators=[], qualifier=EmptyImmutableBiMap, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=ImmutableBiMap, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[ImmutableBiMap] operator[<] identifier[K] , identifier[V] operator[>] identifier[of] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[ImmutableBiMap] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[EmptyImmutableBiMap] operator[SEP] identifier[INSTANCE] operator[SEP] }
protected Collection<BioPAXElement> generate(Conversion conv, Direction direction, Set<Entity> taboo) { if (direction == null) throw new IllegalArgumentException("Direction cannot be null"); if (!(direction == Direction.BOTHSIDERS || direction == Direction.ONESIDERS)) { Set<BioPAXElement> simples = new HashSet<BioPAXElement>(); for (Entity part : direction == Direction.ANY ? conv.getParticipant() : direction == Direction.LEFT ? conv.getLeft() : conv.getRight()) { if (part instanceof PhysicalEntity && !taboo.contains(part)) { simples.addAll(linker.getLinkedElements((PhysicalEntity) part)); } } return pe2ER.getValueFromBeans(simples); } else { Set<BioPAXElement> leftSimples = new HashSet<BioPAXElement>(); Set<BioPAXElement> rightSimples = new HashSet<BioPAXElement>(); for (PhysicalEntity pe : conv.getLeft()) { if (!taboo.contains(pe)) leftSimples.addAll(linker.getLinkedElements(pe)); } for (PhysicalEntity pe : conv.getRight()) { if (!taboo.contains(pe)) rightSimples.addAll(linker.getLinkedElements(pe)); } Set leftERs = pe2ER.getValueFromBeans(leftSimples); Set rightERs = pe2ER.getValueFromBeans(rightSimples); if (direction == Direction.ONESIDERS) { // get all but intersection Set temp = new HashSet(leftERs); leftERs.removeAll(rightERs); rightERs.removeAll(temp); leftERs.addAll(rightERs); } else // BOTHSIDERS { // get intersection leftERs.retainAll(rightERs); } return leftERs; } }
class class_name[name] begin[{] method[generate, return_type[type[Collection]], modifier[protected], parameter[conv, direction, taboo]] begin[{] if[binary_operation[member[.direction], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Direction cannot be null")], 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[}] if[binary_operation[binary_operation[member[.direction], ==, member[Direction.BOTHSIDERS]], ||, binary_operation[member[.direction], ==, member[Direction.ONESIDERS]]]] begin[{] local_variable[type[Set], simples] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=part, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=PhysicalEntity, sub_type=None), operator=instanceof), operandr=MethodInvocation(arguments=[MemberReference(member=part, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=taboo, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=part, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PhysicalEntity, sub_type=None))], member=getLinkedElements, postfix_operators=[], prefix_operators=[], qualifier=linker, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=simples, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=direction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ANY, postfix_operators=[], prefix_operators=[], qualifier=Direction, selectors=[]), operator===), if_false=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=direction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LEFT, postfix_operators=[], prefix_operators=[], qualifier=Direction, selectors=[]), operator===), if_false=MethodInvocation(arguments=[], member=getRight, postfix_operators=[], prefix_operators=[], qualifier=conv, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getLeft, postfix_operators=[], prefix_operators=[], qualifier=conv, selectors=[], type_arguments=None)), if_true=MethodInvocation(arguments=[], member=getParticipant, postfix_operators=[], prefix_operators=[], qualifier=conv, selectors=[], type_arguments=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=part)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entity, sub_type=None))), label=None) return[call[pe2ER.getValueFromBeans, parameter[member[.simples]]]] else begin[{] local_variable[type[Set], leftSimples] local_variable[type[Set], rightSimples] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=pe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=taboo, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLinkedElements, postfix_operators=[], prefix_operators=[], qualifier=linker, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=leftSimples, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getLeft, postfix_operators=[], prefix_operators=[], qualifier=conv, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pe)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PhysicalEntity, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=pe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=taboo, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLinkedElements, postfix_operators=[], prefix_operators=[], qualifier=linker, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=rightSimples, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getRight, postfix_operators=[], prefix_operators=[], qualifier=conv, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pe)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PhysicalEntity, sub_type=None))), label=None) local_variable[type[Set], leftERs] local_variable[type[Set], rightERs] if[binary_operation[member[.direction], ==, member[Direction.ONESIDERS]]] begin[{] local_variable[type[Set], temp] call[leftERs.removeAll, parameter[member[.rightERs]]] call[rightERs.removeAll, parameter[member[.temp]]] call[leftERs.addAll, parameter[member[.rightERs]]] else begin[{] call[leftERs.retainAll, parameter[member[.rightERs]]] end[}] return[member[.leftERs]] end[}] end[}] END[}]
Keyword[protected] identifier[Collection] operator[<] identifier[BioPAXElement] operator[>] identifier[generate] operator[SEP] identifier[Conversion] identifier[conv] , identifier[Direction] identifier[direction] , identifier[Set] operator[<] identifier[Entity] operator[>] identifier[taboo] operator[SEP] { Keyword[if] operator[SEP] identifier[direction] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[direction] operator[==] identifier[Direction] operator[SEP] identifier[BOTHSIDERS] operator[||] identifier[direction] operator[==] identifier[Direction] operator[SEP] identifier[ONESIDERS] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[BioPAXElement] operator[>] identifier[simples] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[BioPAXElement] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entity] identifier[part] operator[:] identifier[direction] operator[==] identifier[Direction] operator[SEP] identifier[ANY] operator[?] identifier[conv] operator[SEP] identifier[getParticipant] operator[SEP] operator[SEP] operator[:] identifier[direction] operator[==] identifier[Direction] operator[SEP] identifier[LEFT] operator[?] identifier[conv] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[:] identifier[conv] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[part] Keyword[instanceof] identifier[PhysicalEntity] operator[&&] operator[!] identifier[taboo] operator[SEP] identifier[contains] operator[SEP] identifier[part] operator[SEP] operator[SEP] { identifier[simples] operator[SEP] identifier[addAll] operator[SEP] identifier[linker] operator[SEP] identifier[getLinkedElements] operator[SEP] operator[SEP] identifier[PhysicalEntity] operator[SEP] identifier[part] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[pe2ER] operator[SEP] identifier[getValueFromBeans] operator[SEP] identifier[simples] operator[SEP] operator[SEP] } Keyword[else] { identifier[Set] operator[<] identifier[BioPAXElement] operator[>] identifier[leftSimples] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[BioPAXElement] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[BioPAXElement] operator[>] identifier[rightSimples] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[BioPAXElement] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PhysicalEntity] identifier[pe] operator[:] identifier[conv] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[taboo] operator[SEP] identifier[contains] operator[SEP] identifier[pe] operator[SEP] operator[SEP] identifier[leftSimples] operator[SEP] identifier[addAll] operator[SEP] identifier[linker] operator[SEP] identifier[getLinkedElements] operator[SEP] identifier[pe] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[PhysicalEntity] identifier[pe] operator[:] identifier[conv] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[taboo] operator[SEP] identifier[contains] operator[SEP] identifier[pe] operator[SEP] operator[SEP] identifier[rightSimples] operator[SEP] identifier[addAll] operator[SEP] identifier[linker] operator[SEP] identifier[getLinkedElements] operator[SEP] identifier[pe] operator[SEP] operator[SEP] operator[SEP] } identifier[Set] identifier[leftERs] operator[=] identifier[pe2ER] operator[SEP] identifier[getValueFromBeans] operator[SEP] identifier[leftSimples] operator[SEP] operator[SEP] identifier[Set] identifier[rightERs] operator[=] identifier[pe2ER] operator[SEP] identifier[getValueFromBeans] operator[SEP] identifier[rightSimples] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[direction] operator[==] identifier[Direction] operator[SEP] identifier[ONESIDERS] operator[SEP] { identifier[Set] identifier[temp] operator[=] Keyword[new] identifier[HashSet] operator[SEP] identifier[leftERs] operator[SEP] operator[SEP] identifier[leftERs] operator[SEP] identifier[removeAll] operator[SEP] identifier[rightERs] operator[SEP] operator[SEP] identifier[rightERs] operator[SEP] identifier[removeAll] operator[SEP] identifier[temp] operator[SEP] operator[SEP] identifier[leftERs] operator[SEP] identifier[addAll] operator[SEP] identifier[rightERs] operator[SEP] operator[SEP] } Keyword[else] { identifier[leftERs] operator[SEP] identifier[retainAll] operator[SEP] identifier[rightERs] operator[SEP] operator[SEP] } Keyword[return] identifier[leftERs] operator[SEP] } }
public static MutableLongTuple reversed(MutableLongTuple t) { Objects.requireNonNull(t, "The input tuple is null"); return new AbstractMutableLongTuple() { @Override public int getSize() { return t.getSize(); } @Override public long get(int index) { return t.get(t.getSize() - 1 - index); } @Override public void set(int index, long value) { t.set(t.getSize() - 1 - index, value); } }; }
class class_name[name] begin[{] method[reversed, return_type[type[MutableLongTuple]], modifier[public static], parameter[t]] begin[{] call[Objects.requireNonNull, parameter[member[.t], literal["The input tuple is null"]]] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getSize, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=getSize, parameters=[], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSize, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=get, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=get, parameters=[FormalParameter(annotations=[], modifiers=set(), name=index, type=BasicType(dimensions=[], name=int), varargs=False)], return_type=BasicType(dimensions=[], name=long), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSize, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=set, parameters=[FormalParameter(annotations=[], modifiers=set(), name=index, type=BasicType(dimensions=[], name=int), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=value, type=BasicType(dimensions=[], name=long), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractMutableLongTuple, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[MutableLongTuple] identifier[reversed] operator[SEP] identifier[MutableLongTuple] identifier[t] operator[SEP] { identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[t] , literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[AbstractMutableLongTuple] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[getSize] operator[SEP] operator[SEP] { Keyword[return] identifier[t] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[long] identifier[get] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[return] identifier[t] operator[SEP] identifier[get] operator[SEP] identifier[t] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[-] Other[1] operator[-] identifier[index] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[set] operator[SEP] Keyword[int] identifier[index] , Keyword[long] identifier[value] operator[SEP] { identifier[t] operator[SEP] identifier[set] operator[SEP] identifier[t] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[-] Other[1] operator[-] identifier[index] , identifier[value] operator[SEP] operator[SEP] } } operator[SEP] }
public static FastaSequence convertProteinSequencetoFasta(ProteinSequence sequence){ StringBuffer buf = new StringBuffer(); for (AminoAcidCompound compound : sequence) { String c = compound.getShortName(); if (! SequenceUtil.NON_AA.matcher(c).find()) { buf.append(c); } else { buf.append("X"); } } return new FastaSequence(sequence.getAccession().getID(),buf.toString()); }
class class_name[name] begin[{] method[convertProteinSequencetoFasta, return_type[type[FastaSequence]], modifier[public static], parameter[sequence]] begin[{] local_variable[type[StringBuffer], buf] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getShortName, postfix_operators=[], prefix_operators=[], qualifier=compound, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=['!'], qualifier=SequenceUtil.NON_AA, selectors=[MethodInvocation(arguments=[], member=find, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="X")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=sequence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=compound)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AminoAcidCompound, sub_type=None))), label=None) return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getAccession, postfix_operators=[], prefix_operators=[], qualifier=sequence, selectors=[MethodInvocation(arguments=[], member=getID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FastaSequence, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[FastaSequence] identifier[convertProteinSequencetoFasta] operator[SEP] identifier[ProteinSequence] identifier[sequence] operator[SEP] { identifier[StringBuffer] identifier[buf] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AminoAcidCompound] identifier[compound] operator[:] identifier[sequence] operator[SEP] { identifier[String] identifier[c] operator[=] identifier[compound] operator[SEP] identifier[getShortName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[SequenceUtil] operator[SEP] identifier[NON_AA] operator[SEP] identifier[matcher] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[else] { identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[FastaSequence] operator[SEP] identifier[sequence] operator[SEP] identifier[getAccession] operator[SEP] operator[SEP] operator[SEP] identifier[getID] operator[SEP] operator[SEP] , identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private static String getForkMetricsName(TaskMetrics taskMetrics, State state, int index) { return taskMetrics.getName() + "." + getForkMetricsId(state, index); }
class class_name[name] begin[{] method[getForkMetricsName, return_type[type[String]], modifier[private static], parameter[taskMetrics, state, index]] begin[{] return[binary_operation[binary_operation[call[taskMetrics.getName, parameter[]], +, literal["."]], +, call[.getForkMetricsId, parameter[member[.state], member[.index]]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[getForkMetricsName] operator[SEP] identifier[TaskMetrics] identifier[taskMetrics] , identifier[State] identifier[state] , Keyword[int] identifier[index] operator[SEP] { Keyword[return] identifier[taskMetrics] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getForkMetricsId] operator[SEP] identifier[state] , identifier[index] operator[SEP] operator[SEP] }
public void setBuilder(Release languageVersion) throws CoreException { addBuilder(getProject(), ICoreConstants.BUILDER_ID, LANGUAGE_VERSION_ARGUMENT_KEY, languageVersion.toString()); }
class class_name[name] begin[{] method[setBuilder, return_type[void], modifier[public], parameter[languageVersion]] begin[{] call[.addBuilder, parameter[call[.getProject, parameter[]], member[ICoreConstants.BUILDER_ID], member[.LANGUAGE_VERSION_ARGUMENT_KEY], call[languageVersion.toString, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setBuilder] operator[SEP] identifier[Release] identifier[languageVersion] operator[SEP] Keyword[throws] identifier[CoreException] { identifier[addBuilder] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] , identifier[ICoreConstants] operator[SEP] identifier[BUILDER_ID] , identifier[LANGUAGE_VERSION_ARGUMENT_KEY] , identifier[languageVersion] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static Cookie[] parseCookieHeader( String header ) { if ((header == null) || (header.length() < 1)) { return (new Cookie[0]); } ArrayList<Cookie> cookies = new ArrayList<Cookie>(); while (header.length() > 0) { int semicolon = header.indexOf(';'); if (semicolon < 0) { semicolon = header.length(); } if (semicolon == 0) { break; } String token = header.substring(0, semicolon); if (semicolon < header.length()) { header = header.substring(semicolon + 1); } else { header = ""; } try { int equals = token.indexOf('='); if (equals > 0) { String name = token.substring(0, equals).trim(); String value = token.substring(equals + 1).trim(); cookies.add(new Cookie(name, value)); } } catch (Throwable e) { // do nothing ?! } } return cookies.toArray(new Cookie[cookies.size()]); }
class class_name[name] begin[{] method[parseCookieHeader, return_type[type[Cookie]], modifier[public static], parameter[header]] begin[{] if[binary_operation[binary_operation[member[.header], ==, literal[null]], ||, binary_operation[call[header.length, parameter[]], <, literal[1]]]] begin[{] return[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Cookie, sub_type=None))] else begin[{] None end[}] local_variable[type[ArrayList], cookies] while[binary_operation[call[header.length, parameter[]], >, literal[0]]] begin[{] local_variable[type[int], semicolon] if[binary_operation[member[.semicolon], <, literal[0]]] begin[{] assign[member[.semicolon], call[header.length, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.semicolon], ==, literal[0]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[String], token] if[binary_operation[member[.semicolon], <, call[header.length, parameter[]]]] begin[{] assign[member[.header], call[header.substring, parameter[binary_operation[member[.semicolon], +, literal[1]]]]] else begin[{] assign[member[.header], literal[""]] end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='=')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None), name=equals)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=equals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=equals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=equals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, 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=Cookie, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=cookies, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] return[call[cookies.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=cookies, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Cookie, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Cookie] operator[SEP] operator[SEP] identifier[parseCookieHeader] operator[SEP] identifier[String] identifier[header] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[header] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[header] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] Other[1] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] Keyword[new] identifier[Cookie] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } identifier[ArrayList] operator[<] identifier[Cookie] operator[>] identifier[cookies] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Cookie] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[header] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[semicolon] operator[=] identifier[header] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[semicolon] operator[<] Other[0] operator[SEP] { identifier[semicolon] operator[=] identifier[header] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[semicolon] operator[==] Other[0] operator[SEP] { Keyword[break] operator[SEP] } identifier[String] identifier[token] operator[=] identifier[header] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[semicolon] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[semicolon] operator[<] identifier[header] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[header] operator[=] identifier[header] operator[SEP] identifier[substring] operator[SEP] identifier[semicolon] operator[+] Other[1] operator[SEP] operator[SEP] } Keyword[else] { identifier[header] operator[=] literal[String] operator[SEP] } Keyword[try] { Keyword[int] identifier[equals] operator[=] identifier[token] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[equals] operator[>] Other[0] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[token] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[equals] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] identifier[token] operator[SEP] identifier[substring] operator[SEP] identifier[equals] operator[+] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[cookies] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Cookie] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { } } Keyword[return] identifier[cookies] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Cookie] operator[SEP] identifier[cookies] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void close() { synchronized (this) { LOG.log(Level.FINER, "Close launcher: job {0} with status {1}", new Object[] {this.theJob, this.status}); if (this.status.isRunning()) { this.status = LauncherStatus.FORCE_CLOSED; } if (null != this.theJob) { this.theJob.close(); } this.notify(); } LOG.log(Level.FINEST, "Close launcher: shutdown REEF"); this.reef.close(); LOG.log(Level.FINEST, "Close launcher: done"); }
class class_name[name] begin[{] method[close, return_type[void], modifier[public], parameter[]] begin[{] SYNCHRONIZED[THIS[]] BEGIN[{] call[LOG.log, parameter[member[Level.FINER], literal["Close launcher: job {0} with status {1}"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=theJob, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=status, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] if[THIS[member[None.status]call[None.isRunning, parameter[]]]] begin[{] assign[THIS[member[None.status]], member[LauncherStatus.FORCE_CLOSED]] else begin[{] None end[}] if[binary_operation[literal[null], !=, THIS[member[None.theJob]]]] begin[{] THIS[member[None.theJob]call[None.close, parameter[]]] else begin[{] None end[}] THIS[call[None.notify, parameter[]]] END[}] call[LOG.log, parameter[member[Level.FINEST], literal["Close launcher: shutdown REEF"]]] THIS[member[None.reef]call[None.close, parameter[]]] call[LOG.log, parameter[member[Level.FINEST], literal["Close launcher: done"]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[theJob] , Keyword[this] operator[SEP] identifier[status] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[status] operator[SEP] identifier[isRunning] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[status] operator[=] identifier[LauncherStatus] operator[SEP] identifier[FORCE_CLOSED] operator[SEP] } Keyword[if] operator[SEP] Other[null] operator[!=] Keyword[this] operator[SEP] identifier[theJob] operator[SEP] { Keyword[this] operator[SEP] identifier[theJob] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[reef] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] operator[SEP] operator[SEP] }
public String getCanonicalForm(Dimension nativeSize, ImageApiProfile profile, Quality defaultQuality) throws ResolvingException { Dimension scaleReference = nativeSize; Rectangle2D canonicalRegion = RegionRequest.fromString(region.getCanonicalForm(nativeSize)).getRegion(); if (canonicalRegion != null) { scaleReference = new Dimension((int) canonicalRegion.getWidth(), (int) canonicalRegion.getHeight()); } return String.format( "%s%s/%s/%s/%s.%s", identifier != null ? urlEncode(identifier) + "/" : "", region.getCanonicalForm(nativeSize), size.getCanonicalForm(scaleReference, profile), rotation.toString(), quality.equals(defaultQuality) ? "default" : quality.toString(), format.toString()); }
class class_name[name] begin[{] method[getCanonicalForm, return_type[type[String]], modifier[public], parameter[nativeSize, profile, defaultQuality]] begin[{] local_variable[type[Dimension], scaleReference] local_variable[type[Rectangle2D], canonicalRegion] if[binary_operation[member[.canonicalRegion], !=, literal[null]]] begin[{] assign[member[.scaleReference], ClassCreator(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=canonicalRegion, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), Cast(expression=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=canonicalRegion, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dimension, sub_type=None))] else begin[{] None end[}] return[call[String.format, parameter[literal["%s%s/%s/%s/%s.%s"], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=identifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=identifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=urlEncode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+)), call[region.getCanonicalForm, parameter[member[.nativeSize]]], call[size.getCanonicalForm, parameter[member[.scaleReference], member[.profile]]], call[rotation.toString, parameter[]], TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=defaultQuality, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=quality, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=quality, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="default")), call[format.toString, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getCanonicalForm] operator[SEP] identifier[Dimension] identifier[nativeSize] , identifier[ImageApiProfile] identifier[profile] , identifier[Quality] identifier[defaultQuality] operator[SEP] Keyword[throws] identifier[ResolvingException] { identifier[Dimension] identifier[scaleReference] operator[=] identifier[nativeSize] operator[SEP] identifier[Rectangle2D] identifier[canonicalRegion] operator[=] identifier[RegionRequest] operator[SEP] identifier[fromString] operator[SEP] identifier[region] operator[SEP] identifier[getCanonicalForm] operator[SEP] identifier[nativeSize] operator[SEP] operator[SEP] operator[SEP] identifier[getRegion] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[canonicalRegion] operator[!=] Other[null] operator[SEP] { identifier[scaleReference] operator[=] Keyword[new] identifier[Dimension] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[canonicalRegion] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] , operator[SEP] Keyword[int] operator[SEP] identifier[canonicalRegion] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[identifier] operator[!=] Other[null] operator[?] identifier[urlEncode] operator[SEP] identifier[identifier] operator[SEP] operator[+] literal[String] operator[:] literal[String] , identifier[region] operator[SEP] identifier[getCanonicalForm] operator[SEP] identifier[nativeSize] operator[SEP] , identifier[size] operator[SEP] identifier[getCanonicalForm] operator[SEP] identifier[scaleReference] , identifier[profile] operator[SEP] , identifier[rotation] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[quality] operator[SEP] identifier[equals] operator[SEP] identifier[defaultQuality] operator[SEP] operator[?] literal[String] operator[:] identifier[quality] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[format] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static com.google.appengine.api.datastore.Key raw( Key<?> typed ) { if ( typed == null ) { return null; } else { return typed.getRaw(); } }
class class_name[name] begin[{] method[raw, return_type[type[com]], modifier[public static], parameter[typed]] begin[{] if[binary_operation[member[.typed], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] return[call[typed.getRaw, parameter[]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[appengine] operator[SEP] identifier[api] operator[SEP] identifier[datastore] operator[SEP] identifier[Key] identifier[raw] operator[SEP] identifier[Key] operator[<] operator[?] operator[>] identifier[typed] operator[SEP] { Keyword[if] operator[SEP] identifier[typed] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[return] identifier[typed] operator[SEP] identifier[getRaw] operator[SEP] operator[SEP] operator[SEP] } }
void end() { switch (state) { case OPTION: currentOption = context.optionWithShortName(currentValue.substring(1)); case LONG_OPTION: if (state == ArgumentsInspectorState.LONG_OPTION) { currentOption = context.optionWithLongName(currentValue.substring(2)); } if (currentOption != null && !currentOption.isMultiValue()) { remainingOptions.remove(currentOption); } if (currentOption == null || currentOption.isFlag()) { state = ArgumentsInspectorState.ARGUMENT; } else { state = ArgumentsInspectorState.OPTION_VALUE; } break; default: state = ArgumentsInspectorState.READY; } currentValue = null; }
class class_name[name] begin[{] method[end, return_type[void], modifier[default], parameter[]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['OPTION'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentOption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=currentValue, selectors=[], type_arguments=None)], member=optionWithShortName, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)), label=None)]), SwitchStatementCase(case=['LONG_OPTION'], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LONG_OPTION, postfix_operators=[], prefix_operators=[], qualifier=ArgumentsInspectorState, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentOption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=currentValue, selectors=[], type_arguments=None)], member=optionWithLongName, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=currentOption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isMultiValue, postfix_operators=[], prefix_operators=['!'], qualifier=currentOption, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentOption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=remainingOptions, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=currentOption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=isFlag, postfix_operators=[], prefix_operators=[], qualifier=currentOption, selectors=[], type_arguments=None), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=OPTION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=ArgumentsInspectorState, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ARGUMENT, postfix_operators=[], prefix_operators=[], qualifier=ArgumentsInspectorState, selectors=[])), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=READY, postfix_operators=[], prefix_operators=[], qualifier=ArgumentsInspectorState, selectors=[])), label=None)])], expression=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) assign[member[.currentValue], literal[null]] end[}] END[}]
Keyword[void] identifier[end] operator[SEP] operator[SEP] { Keyword[switch] operator[SEP] identifier[state] operator[SEP] { Keyword[case] identifier[OPTION] operator[:] identifier[currentOption] operator[=] identifier[context] operator[SEP] identifier[optionWithShortName] operator[SEP] identifier[currentValue] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[LONG_OPTION] operator[:] Keyword[if] operator[SEP] identifier[state] operator[==] identifier[ArgumentsInspectorState] operator[SEP] identifier[LONG_OPTION] operator[SEP] { identifier[currentOption] operator[=] identifier[context] operator[SEP] identifier[optionWithLongName] operator[SEP] identifier[currentValue] operator[SEP] identifier[substring] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[currentOption] operator[!=] Other[null] operator[&&] operator[!] identifier[currentOption] operator[SEP] identifier[isMultiValue] operator[SEP] operator[SEP] operator[SEP] { identifier[remainingOptions] operator[SEP] identifier[remove] operator[SEP] identifier[currentOption] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[currentOption] operator[==] Other[null] operator[||] identifier[currentOption] operator[SEP] identifier[isFlag] operator[SEP] operator[SEP] operator[SEP] { identifier[state] operator[=] identifier[ArgumentsInspectorState] operator[SEP] identifier[ARGUMENT] operator[SEP] } Keyword[else] { identifier[state] operator[=] identifier[ArgumentsInspectorState] operator[SEP] identifier[OPTION_VALUE] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[state] operator[=] identifier[ArgumentsInspectorState] operator[SEP] identifier[READY] operator[SEP] } identifier[currentValue] operator[=] Other[null] operator[SEP] }
@Override public void setReadOnly(WSRdbManagedConnectionImpl managedConn, boolean readOnly, boolean externalCall) throws SQLException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "setReadOnly", managedConn, readOnly, externalCall); if (!externalCall) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "setReadOnly ignored for internal call"); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "Method setReadOnly() is ignored by WebSphere. Sybase does not honor the setReadOnly method."); } }
class class_name[name] begin[{] method[setReadOnly, return_type[void], modifier[public], parameter[managedConn, readOnly, externalCall]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[THIS[], member[.tc], literal["setReadOnly"], member[.managedConn], member[.readOnly], member[.externalCall]]] else begin[{] None end[}] if[member[.externalCall]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[THIS[], member[.tc], literal["setReadOnly ignored for internal call"]]] else begin[{] None end[}] else begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[THIS[], member[.tc], literal["Method setReadOnly() is ignored by WebSphere. Sybase does not honor the setReadOnly method."]]] else begin[{] None end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setReadOnly] operator[SEP] identifier[WSRdbManagedConnectionImpl] identifier[managedConn] , Keyword[boolean] identifier[readOnly] , Keyword[boolean] identifier[externalCall] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[managedConn] , identifier[readOnly] , identifier[externalCall] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[externalCall] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] } }
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "ellipsoidalCSRef") public JAXBElement<EllipsoidalCSRefType> createEllipsoidalCSRef(EllipsoidalCSRefType value) { return new JAXBElement<EllipsoidalCSRefType>(_EllipsoidalCSRef_QNAME, EllipsoidalCSRefType.class, null, value); }
class class_name[name] begin[{] method[createEllipsoidalCSRef, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_EllipsoidalCSRef_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EllipsoidalCSRefType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=EllipsoidalCSRefType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[EllipsoidalCSRefType] operator[>] identifier[createEllipsoidalCSRef] operator[SEP] identifier[EllipsoidalCSRefType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[EllipsoidalCSRefType] operator[>] operator[SEP] identifier[_EllipsoidalCSRef_QNAME] , identifier[EllipsoidalCSRefType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public Record getRecord(String strFileName) { Record record = super.getRecord(strFileName); if (record == null) { // Special check for sessions - see if the record is owned by a sub-"table session" for (int iIndex = 0; iIndex < this.getSessionObjectCount(); iIndex++) { BaseSession sessionObject = this.getSessionObjectAt(iIndex); if (sessionObject instanceof TableSession) if (sessionObject.getMainRecord() != null) if (sessionObject.getMainRecord().getTableNames(false).equals(strFileName)) return sessionObject.getMainRecord(); } } return record; // Look thru the parent window now }
class class_name[name] begin[{] method[getRecord, return_type[type[Record]], modifier[public], parameter[strFileName]] begin[{] local_variable[type[Record], record] if[binary_operation[member[.record], ==, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=iIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSessionObjectAt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=sessionObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BaseSession, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sessionObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=TableSession, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMainRecord, postfix_operators=[], prefix_operators=[], qualifier=sessionObject, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=IfStatement(condition=MethodInvocation(arguments=[], member=getMainRecord, postfix_operators=[], prefix_operators=[], qualifier=sessionObject, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getTableNames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=strFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[], member=getMainRecord, postfix_operators=[], prefix_operators=[], qualifier=sessionObject, selectors=[], type_arguments=None), label=None))))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=iIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getSessionObjectCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=iIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=iIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] return[member[.record]] end[}] END[}]
Keyword[public] identifier[Record] identifier[getRecord] operator[SEP] identifier[String] identifier[strFileName] operator[SEP] { identifier[Record] identifier[record] operator[=] Keyword[super] operator[SEP] identifier[getRecord] operator[SEP] identifier[strFileName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[record] operator[==] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[iIndex] operator[=] Other[0] operator[SEP] identifier[iIndex] operator[<] Keyword[this] operator[SEP] identifier[getSessionObjectCount] operator[SEP] operator[SEP] operator[SEP] identifier[iIndex] operator[++] operator[SEP] { identifier[BaseSession] identifier[sessionObject] operator[=] Keyword[this] operator[SEP] identifier[getSessionObjectAt] operator[SEP] identifier[iIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sessionObject] Keyword[instanceof] identifier[TableSession] operator[SEP] Keyword[if] operator[SEP] identifier[sessionObject] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[sessionObject] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getTableNames] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[strFileName] operator[SEP] operator[SEP] Keyword[return] identifier[sessionObject] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[record] operator[SEP] }
@XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "maxInclusive") public JAXBElement<Facet> createMaxInclusive(Facet value) { return new JAXBElement<Facet>(_MaxInclusive_QNAME, Facet.class, null, value); }
class class_name[name] begin[{] method[createMaxInclusive, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_MaxInclusive_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Facet, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Facet, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[Facet] operator[>] identifier[createMaxInclusive] operator[SEP] identifier[Facet] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[Facet] operator[>] operator[SEP] identifier[_MaxInclusive_QNAME] , identifier[Facet] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = PROV_NS, name = "person") public JAXBElement<Person> createPerson(Person value) { return new JAXBElement<Person>(_Person_QNAME, Person.class, null, value); }
class class_name[name] begin[{] method[createPerson, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Person_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Person, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Person, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] identifier[PROV_NS] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[Person] operator[>] identifier[createPerson] operator[SEP] identifier[Person] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[Person] operator[>] operator[SEP] identifier[_Person_QNAME] , identifier[Person] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public static String expand(String tmpl, String tn, int p, long gn, Date dt) { return expand(tmpl, tn, p, gn, dt, null); }
class class_name[name] begin[{] method[expand, return_type[type[String]], modifier[public static], parameter[tmpl, tn, p, gn, dt]] begin[{] return[call[.expand, parameter[member[.tmpl], member[.tn], member[.p], member[.gn], member[.dt], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[expand] operator[SEP] identifier[String] identifier[tmpl] , identifier[String] identifier[tn] , Keyword[int] identifier[p] , Keyword[long] identifier[gn] , identifier[Date] identifier[dt] operator[SEP] { Keyword[return] identifier[expand] operator[SEP] identifier[tmpl] , identifier[tn] , identifier[p] , identifier[gn] , identifier[dt] , Other[null] operator[SEP] operator[SEP] }
public void stopStep(final String uuid) { final Optional<StepResult> found = storage.getStep(uuid); if (!found.isPresent()) { LOGGER.error("Could not stop step: step with uuid {} not found", uuid); return; } final StepResult step = found.get(); notifier.beforeStepStop(step); step.setStage(Stage.FINISHED); step.setStop(System.currentTimeMillis()); storage.remove(uuid); threadContext.stop(); notifier.afterStepStop(step); }
class class_name[name] begin[{] method[stopStep, return_type[void], modifier[public], parameter[uuid]] begin[{] local_variable[type[Optional], found] if[call[found.isPresent, parameter[]]] begin[{] call[LOGGER.error, parameter[literal["Could not stop step: step with uuid {} not found"], member[.uuid]]] return[None] else begin[{] None end[}] local_variable[type[StepResult], step] call[notifier.beforeStepStop, parameter[member[.step]]] call[step.setStage, parameter[member[Stage.FINISHED]]] call[step.setStop, parameter[call[System.currentTimeMillis, parameter[]]]] call[storage.remove, parameter[member[.uuid]]] call[threadContext.stop, parameter[]] call[notifier.afterStepStop, parameter[member[.step]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[stopStep] operator[SEP] Keyword[final] identifier[String] identifier[uuid] operator[SEP] { Keyword[final] identifier[Optional] operator[<] identifier[StepResult] operator[>] identifier[found] operator[=] identifier[storage] operator[SEP] identifier[getStep] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[found] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[uuid] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[final] identifier[StepResult] identifier[step] operator[=] identifier[found] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[notifier] operator[SEP] identifier[beforeStepStop] operator[SEP] identifier[step] operator[SEP] operator[SEP] identifier[step] operator[SEP] identifier[setStage] operator[SEP] identifier[Stage] operator[SEP] identifier[FINISHED] operator[SEP] operator[SEP] identifier[step] operator[SEP] identifier[setStop] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[storage] operator[SEP] identifier[remove] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] identifier[threadContext] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] identifier[notifier] operator[SEP] identifier[afterStepStop] operator[SEP] identifier[step] operator[SEP] operator[SEP] }
int update(Config config, Connection conn, String sql, Object... paras) throws SQLException { PreparedStatement pst = conn.prepareStatement(sql); config.dialect.fillStatement(pst, paras); int result = pst.executeUpdate(); DbKit.close(pst); return result; }
class class_name[name] begin[{] method[update, return_type[type[int]], modifier[default], parameter[config, conn, sql, paras]] begin[{] local_variable[type[PreparedStatement], pst] call[config.dialect.fillStatement, parameter[member[.pst], member[.paras]]] local_variable[type[int], result] call[DbKit.close, parameter[member[.pst]]] return[member[.result]] end[}] END[}]
Keyword[int] identifier[update] operator[SEP] identifier[Config] identifier[config] , identifier[Connection] identifier[conn] , identifier[String] identifier[sql] , identifier[Object] operator[...] identifier[paras] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[PreparedStatement] identifier[pst] operator[=] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[sql] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[dialect] operator[SEP] identifier[fillStatement] operator[SEP] identifier[pst] , identifier[paras] operator[SEP] operator[SEP] Keyword[int] identifier[result] operator[=] identifier[pst] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP] identifier[DbKit] operator[SEP] identifier[close] operator[SEP] identifier[pst] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
@SuppressWarnings("null") @Override public byte[] toByteArray() { byte[][] summariesBytes = null; int summariesBytesLength = 0; if (count_ > 0) { summariesBytes = new byte[count_][]; int i = 0; for (int j = 0; j < summaries_.length; j++) { if (summaries_[j] != null) { summariesBytes[i] = summaries_[j].toByteArray(); summariesBytesLength += summariesBytes[i].length; i++; } } } int sizeBytes = Byte.BYTES // preamble longs + Byte.BYTES // serial version + Byte.BYTES // family + Byte.BYTES // sketch type + Byte.BYTES // flags + Byte.BYTES // log2(nomEntries) + Byte.BYTES // log2(currentCapacity) + Byte.BYTES; // log2(resizeFactor) if (isInSamplingMode()) { sizeBytes += Float.BYTES; // samplingProbability } final boolean isThetaIncluded = isInSamplingMode() ? theta_ < samplingProbability_ : theta_ < Long.MAX_VALUE; if (isThetaIncluded) { sizeBytes += Long.BYTES; } if (count_ > 0) { sizeBytes += Integer.BYTES; // count } sizeBytes += (Long.BYTES * count_) + summariesBytesLength; final byte[] bytes = new byte[sizeBytes]; int offset = 0; bytes[offset++] = PREAMBLE_LONGS; bytes[offset++] = serialVersionUID; bytes[offset++] = (byte) Family.TUPLE.getID(); bytes[offset++] = (byte) SerializerDeserializer.SketchType.QuickSelectSketch.ordinal(); final boolean isBigEndian = ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN); bytes[offset++] = (byte) ( (isBigEndian ? 1 << Flags.IS_BIG_ENDIAN.ordinal() : 0) | (isInSamplingMode() ? 1 << Flags.IS_IN_SAMPLING_MODE.ordinal() : 0) | (isEmpty_ ? 1 << Flags.IS_EMPTY.ordinal() : 0) | (count_ > 0 ? 1 << Flags.HAS_ENTRIES.ordinal() : 0) | (isThetaIncluded ? 1 << Flags.IS_THETA_INCLUDED.ordinal() : 0) ); bytes[offset++] = (byte) Integer.numberOfTrailingZeros(nomEntries_); bytes[offset++] = (byte) lgCurrentCapacity_; bytes[offset++] = (byte) lgResizeFactor_; if (samplingProbability_ < 1f) { ByteArrayUtil.putFloatLE(bytes, offset, samplingProbability_); offset += Float.BYTES; } if (isThetaIncluded) { ByteArrayUtil.putLongLE(bytes, offset, theta_); offset += Long.BYTES; } if (count_ > 0) { ByteArrayUtil.putIntLE(bytes, offset, count_); offset += Integer.BYTES; } if (count_ > 0) { int i = 0; for (int j = 0; j < keys_.length; j++) { if (summaries_[j] != null) { ByteArrayUtil.putLongLE(bytes, offset, keys_[j]); offset += Long.BYTES; System.arraycopy(summariesBytes[i], 0, bytes, offset, summariesBytes[i].length); offset += summariesBytes[i].length; i++; } } } return bytes; }
class class_name[name] begin[{] method[toByteArray, return_type[type[byte]], modifier[public], parameter[]] begin[{] local_variable[type[byte], summariesBytes] local_variable[type[int], summariesBytesLength] if[binary_operation[member[.count_], >, literal[0]]] begin[{] assign[member[.summariesBytes], ArrayCreator(dimensions=[MemberReference(member=count_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), None], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=summaries_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, 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=summariesBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=summaries_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=toByteArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=summariesBytesLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=summariesBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=summaries_, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] local_variable[type[int], sizeBytes] if[call[.isInSamplingMode, parameter[]]] begin[{] assign[member[.sizeBytes], member[Float.BYTES]] else begin[{] None end[}] local_variable[type[boolean], isThetaIncluded] if[member[.isThetaIncluded]] begin[{] assign[member[.sizeBytes], member[Long.BYTES]] else begin[{] None end[}] if[binary_operation[member[.count_], >, literal[0]]] begin[{] assign[member[.sizeBytes], member[Integer.BYTES]] else begin[{] None end[}] assign[member[.sizeBytes], binary_operation[binary_operation[member[Long.BYTES], *, member[.count_]], +, member[.summariesBytesLength]]] local_variable[type[byte], bytes] local_variable[type[int], offset] assign[member[.bytes], member[.PREAMBLE_LONGS]] assign[member[.bytes], member[.serialVersionUID]] assign[member[.bytes], Cast(expression=MethodInvocation(arguments=[], member=getID, postfix_operators=[], prefix_operators=[], qualifier=Family.TUPLE, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=byte))] assign[member[.bytes], Cast(expression=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=SerializerDeserializer.SketchType.QuickSelectSketch, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=byte))] local_variable[type[boolean], isBigEndian] assign[member[.bytes], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=TernaryExpression(condition=MemberReference(member=isBigEndian, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=Flags.IS_BIG_ENDIAN, selectors=[], type_arguments=None), operator=<<)), operandr=TernaryExpression(condition=MethodInvocation(arguments=[], member=isInSamplingMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=Flags.IS_IN_SAMPLING_MODE, selectors=[], type_arguments=None), operator=<<)), operator=|), operandr=TernaryExpression(condition=MemberReference(member=isEmpty_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=Flags.IS_EMPTY, selectors=[], type_arguments=None), operator=<<)), operator=|), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=count_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=Flags.HAS_ENTRIES, selectors=[], type_arguments=None), operator=<<)), operator=|), operandr=TernaryExpression(condition=MemberReference(member=isThetaIncluded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=Flags.IS_THETA_INCLUDED, selectors=[], type_arguments=None), operator=<<)), operator=|), type=BasicType(dimensions=[], name=byte))] assign[member[.bytes], Cast(expression=MethodInvocation(arguments=[MemberReference(member=nomEntries_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=numberOfTrailingZeros, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=byte))] assign[member[.bytes], Cast(expression=MemberReference(member=lgCurrentCapacity_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))] assign[member[.bytes], Cast(expression=MemberReference(member=lgResizeFactor_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))] if[binary_operation[member[.samplingProbability_], <, literal[1f]]] begin[{] call[ByteArrayUtil.putFloatLE, parameter[member[.bytes], member[.offset], member[.samplingProbability_]]] assign[member[.offset], member[Float.BYTES]] else begin[{] None end[}] if[member[.isThetaIncluded]] begin[{] call[ByteArrayUtil.putLongLE, parameter[member[.bytes], member[.offset], member[.theta_]]] assign[member[.offset], member[Long.BYTES]] else begin[{] None end[}] if[binary_operation[member[.count_], >, literal[0]]] begin[{] call[ByteArrayUtil.putIntLE, parameter[member[.bytes], member[.offset], member[.count_]]] assign[member[.offset], member[Integer.BYTES]] else begin[{] None end[}] if[binary_operation[member[.count_], >, literal[0]]] begin[{] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=summaries_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, 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=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keys_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=putLongLE, postfix_operators=[], prefix_operators=[], qualifier=ByteArrayUtil, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=BYTES, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=summariesBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=summariesBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=summariesBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=keys_, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] return[member[.bytes]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[summariesBytes] operator[=] Other[null] operator[SEP] Keyword[int] identifier[summariesBytesLength] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[count_] operator[>] Other[0] operator[SEP] { identifier[summariesBytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[count_] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[summaries_] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[summaries_] operator[SEP] identifier[j] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[summariesBytes] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[summaries_] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] identifier[summariesBytesLength] operator[+=] identifier[summariesBytes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] } } } Keyword[int] identifier[sizeBytes] operator[=] identifier[Byte] operator[SEP] identifier[BYTES] operator[+] identifier[Byte] operator[SEP] identifier[BYTES] operator[+] identifier[Byte] operator[SEP] identifier[BYTES] operator[+] identifier[Byte] operator[SEP] identifier[BYTES] operator[+] identifier[Byte] operator[SEP] identifier[BYTES] operator[+] identifier[Byte] operator[SEP] identifier[BYTES] operator[+] identifier[Byte] operator[SEP] identifier[BYTES] operator[+] identifier[Byte] operator[SEP] identifier[BYTES] operator[SEP] Keyword[if] operator[SEP] identifier[isInSamplingMode] operator[SEP] operator[SEP] operator[SEP] { identifier[sizeBytes] operator[+=] identifier[Float] operator[SEP] identifier[BYTES] operator[SEP] } Keyword[final] Keyword[boolean] identifier[isThetaIncluded] operator[=] identifier[isInSamplingMode] operator[SEP] operator[SEP] operator[?] identifier[theta_] operator[<] identifier[samplingProbability_] operator[:] identifier[theta_] operator[<] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[if] operator[SEP] identifier[isThetaIncluded] operator[SEP] { identifier[sizeBytes] operator[+=] identifier[Long] operator[SEP] identifier[BYTES] operator[SEP] } Keyword[if] operator[SEP] identifier[count_] operator[>] Other[0] operator[SEP] { identifier[sizeBytes] operator[+=] identifier[Integer] operator[SEP] identifier[BYTES] operator[SEP] } identifier[sizeBytes] operator[+=] operator[SEP] identifier[Long] operator[SEP] identifier[BYTES] operator[*] identifier[count_] operator[SEP] operator[+] identifier[summariesBytesLength] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[sizeBytes] operator[SEP] operator[SEP] Keyword[int] identifier[offset] operator[=] Other[0] operator[SEP] identifier[bytes] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] identifier[PREAMBLE_LONGS] operator[SEP] identifier[bytes] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] identifier[serialVersionUID] operator[SEP] identifier[bytes] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[Family] operator[SEP] identifier[TUPLE] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[SerializerDeserializer] operator[SEP] identifier[SketchType] operator[SEP] identifier[QuickSelectSketch] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[isBigEndian] operator[=] identifier[ByteOrder] operator[SEP] identifier[nativeOrder] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[ByteOrder] operator[SEP] identifier[BIG_ENDIAN] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[isBigEndian] operator[?] Other[1] operator[<<] identifier[Flags] operator[SEP] identifier[IS_BIG_ENDIAN] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[:] Other[0] operator[SEP] operator[|] operator[SEP] identifier[isInSamplingMode] operator[SEP] operator[SEP] operator[?] Other[1] operator[<<] identifier[Flags] operator[SEP] identifier[IS_IN_SAMPLING_MODE] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[:] Other[0] operator[SEP] operator[|] operator[SEP] identifier[isEmpty_] operator[?] Other[1] operator[<<] identifier[Flags] operator[SEP] identifier[IS_EMPTY] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[:] Other[0] operator[SEP] operator[|] operator[SEP] identifier[count_] operator[>] Other[0] operator[?] Other[1] operator[<<] identifier[Flags] operator[SEP] identifier[HAS_ENTRIES] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[:] Other[0] operator[SEP] operator[|] operator[SEP] identifier[isThetaIncluded] operator[?] Other[1] operator[<<] identifier[Flags] operator[SEP] identifier[IS_THETA_INCLUDED] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[:] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[Integer] operator[SEP] identifier[numberOfTrailingZeros] operator[SEP] identifier[nomEntries_] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[lgCurrentCapacity_] operator[SEP] identifier[bytes] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[lgResizeFactor_] operator[SEP] Keyword[if] operator[SEP] identifier[samplingProbability_] operator[<] literal[Float] operator[SEP] { identifier[ByteArrayUtil] operator[SEP] identifier[putFloatLE] operator[SEP] identifier[bytes] , identifier[offset] , identifier[samplingProbability_] operator[SEP] operator[SEP] identifier[offset] operator[+=] identifier[Float] operator[SEP] identifier[BYTES] operator[SEP] } Keyword[if] operator[SEP] identifier[isThetaIncluded] operator[SEP] { identifier[ByteArrayUtil] operator[SEP] identifier[putLongLE] operator[SEP] identifier[bytes] , identifier[offset] , identifier[theta_] operator[SEP] operator[SEP] identifier[offset] operator[+=] identifier[Long] operator[SEP] identifier[BYTES] operator[SEP] } Keyword[if] operator[SEP] identifier[count_] operator[>] Other[0] operator[SEP] { identifier[ByteArrayUtil] operator[SEP] identifier[putIntLE] operator[SEP] identifier[bytes] , identifier[offset] , identifier[count_] operator[SEP] operator[SEP] identifier[offset] operator[+=] identifier[Integer] operator[SEP] identifier[BYTES] operator[SEP] } Keyword[if] operator[SEP] identifier[count_] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[keys_] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[summaries_] operator[SEP] identifier[j] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[ByteArrayUtil] operator[SEP] identifier[putLongLE] operator[SEP] identifier[bytes] , identifier[offset] , identifier[keys_] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] identifier[offset] operator[+=] identifier[Long] operator[SEP] identifier[BYTES] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[summariesBytes] operator[SEP] identifier[i] operator[SEP] , Other[0] , identifier[bytes] , identifier[offset] , identifier[summariesBytes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[offset] operator[+=] identifier[summariesBytes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] } } } Keyword[return] identifier[bytes] operator[SEP] }
public Object getControlValue() { Object objValue = null; if (m_iCurrentState == ON) objValue = Boolean.TRUE; else if (m_iCurrentState == OFF) objValue = Boolean.FALSE; return objValue; }
class class_name[name] begin[{] method[getControlValue, return_type[type[Object]], modifier[public], parameter[]] begin[{] local_variable[type[Object], objValue] if[binary_operation[member[.m_iCurrentState], ==, member[.ON]]] begin[{] assign[member[.objValue], member[Boolean.TRUE]] else begin[{] if[binary_operation[member[.m_iCurrentState], ==, member[.OFF]]] begin[{] assign[member[.objValue], member[Boolean.FALSE]] else begin[{] None end[}] end[}] return[member[.objValue]] end[}] END[}]
Keyword[public] identifier[Object] identifier[getControlValue] operator[SEP] operator[SEP] { identifier[Object] identifier[objValue] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[m_iCurrentState] operator[==] identifier[ON] operator[SEP] identifier[objValue] operator[=] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[m_iCurrentState] operator[==] identifier[OFF] operator[SEP] identifier[objValue] operator[=] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] Keyword[return] identifier[objValue] operator[SEP] }
@SuppressWarnings({"WeakerAccess", "unused"}) public void setDocumentPreserveAspectRatio(PreserveAspectRatio preserveAspectRatio) { if (this.rootElement == null) throw new IllegalArgumentException("SVG document is empty"); this.rootElement.preserveAspectRatio = preserveAspectRatio; }
class class_name[name] begin[{] method[setDocumentPreserveAspectRatio, return_type[void], modifier[public], parameter[preserveAspectRatio]] begin[{] if[binary_operation[THIS[member[None.rootElement]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SVG document is empty")], 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[}] assign[THIS[member[None.rootElement]member[None.preserveAspectRatio]], member[.preserveAspectRatio]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] Keyword[public] Keyword[void] identifier[setDocumentPreserveAspectRatio] operator[SEP] identifier[PreserveAspectRatio] identifier[preserveAspectRatio] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[rootElement] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[rootElement] operator[SEP] identifier[preserveAspectRatio] operator[=] identifier[preserveAspectRatio] operator[SEP] }
private Object get(Commit<GetQuery> commit) { try { return value != null ? value.operation().value() : null; } finally { commit.close(); } }
class class_name[name] begin[{] method[get, return_type[type[Object]], modifier[private], parameter[commit]] begin[{] TryStatement(block=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=operation, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[MethodInvocation(arguments=[], member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=commit, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[private] identifier[Object] identifier[get] operator[SEP] identifier[Commit] operator[<] identifier[GetQuery] operator[>] identifier[commit] operator[SEP] { Keyword[try] { Keyword[return] identifier[value] operator[!=] Other[null] operator[?] identifier[value] operator[SEP] identifier[operation] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] } Keyword[finally] { identifier[commit] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
public static void main(String[] args) { try { SimonJolokiaDemo main = new SimonJolokiaDemo(); main.initServer(); main.initData(); main.runAndWait(); } catch (Exception e) { e.printStackTrace(); } }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] TryStatement(block=[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=SimonJolokiaDemo, sub_type=None)), name=main)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SimonJolokiaDemo, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=initServer, postfix_operators=[], prefix_operators=[], qualifier=main, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=initData, postfix_operators=[], prefix_operators=[], qualifier=main, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=runAndWait, postfix_operators=[], prefix_operators=[], qualifier=main, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=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[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[try] { identifier[SimonJolokiaDemo] identifier[main] operator[=] Keyword[new] identifier[SimonJolokiaDemo] operator[SEP] operator[SEP] operator[SEP] identifier[main] operator[SEP] identifier[initServer] operator[SEP] operator[SEP] operator[SEP] identifier[main] operator[SEP] identifier[initData] operator[SEP] operator[SEP] operator[SEP] identifier[main] operator[SEP] identifier[runAndWait] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } }
private static int inlineTagFound(DocImpl holder, String inlinetext, int start) { DocEnv docenv = holder.env; int linkstart = inlinetext.indexOf("{@", start); if (start == inlinetext.length() || linkstart == -1) { return -1; } else if (inlinetext.indexOf('}', linkstart) == -1) { //Missing '}'. docenv.warning(holder, "tag.Improper_Use_Of_Link_Tag", inlinetext.substring(linkstart, inlinetext.length())); return -1; } else { return linkstart; } }
class class_name[name] begin[{] method[inlineTagFound, return_type[type[int]], modifier[private static], parameter[holder, inlinetext, start]] begin[{] local_variable[type[DocEnv], docenv] local_variable[type[int], linkstart] if[binary_operation[binary_operation[member[.start], ==, call[inlinetext.length, parameter[]]], ||, binary_operation[member[.linkstart], ==, literal[1]]]] begin[{] return[literal[1]] else begin[{] if[binary_operation[call[inlinetext.indexOf, parameter[literal['}'], member[.linkstart]]], ==, literal[1]]] begin[{] call[docenv.warning, parameter[member[.holder], literal["tag.Improper_Use_Of_Link_Tag"], call[inlinetext.substring, parameter[member[.linkstart], call[inlinetext.length, parameter[]]]]]] return[literal[1]] else begin[{] return[member[.linkstart]] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[int] identifier[inlineTagFound] operator[SEP] identifier[DocImpl] identifier[holder] , identifier[String] identifier[inlinetext] , Keyword[int] identifier[start] operator[SEP] { identifier[DocEnv] identifier[docenv] operator[=] identifier[holder] operator[SEP] identifier[env] operator[SEP] Keyword[int] identifier[linkstart] operator[=] identifier[inlinetext] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[start] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[start] operator[==] identifier[inlinetext] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[||] identifier[linkstart] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[inlinetext] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[linkstart] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] { identifier[docenv] operator[SEP] identifier[warning] operator[SEP] identifier[holder] , literal[String] , identifier[inlinetext] operator[SEP] identifier[substring] operator[SEP] identifier[linkstart] , identifier[inlinetext] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] } Keyword[else] { Keyword[return] identifier[linkstart] operator[SEP] } }
public Branch withEnvironmentVariables(java.util.Map<String, String> environmentVariables) { setEnvironmentVariables(environmentVariables); return this; }
class class_name[name] begin[{] method[withEnvironmentVariables, return_type[type[Branch]], modifier[public], parameter[environmentVariables]] begin[{] call[.setEnvironmentVariables, parameter[member[.environmentVariables]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Branch] identifier[withEnvironmentVariables] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[environmentVariables] operator[SEP] { identifier[setEnvironmentVariables] operator[SEP] identifier[environmentVariables] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private void logProgress(String fileOffset, boolean prefixNewLine) throws IOException { long now = System.currentTimeMillis(); LogEntry entry = new LogEntry(now, componentID, fileOffset); String line = entry.toString(); if(prefixNewLine) { lockFileStream.writeBytes(System.lineSeparator() + line); } else { lockFileStream.writeBytes(line); } lockFileStream.hflush(); lastEntry = entry; // update this only after writing to hdfs }
class class_name[name] begin[{] method[logProgress, return_type[void], modifier[private], parameter[fileOffset, prefixNewLine]] begin[{] local_variable[type[long], now] local_variable[type[LogEntry], entry] local_variable[type[String], line] if[member[.prefixNewLine]] begin[{] call[lockFileStream.writeBytes, parameter[binary_operation[call[System.lineSeparator, parameter[]], +, member[.line]]]] else begin[{] call[lockFileStream.writeBytes, parameter[member[.line]]] end[}] call[lockFileStream.hflush, parameter[]] assign[member[.lastEntry], member[.entry]] end[}] END[}]
Keyword[private] Keyword[void] identifier[logProgress] operator[SEP] identifier[String] identifier[fileOffset] , Keyword[boolean] identifier[prefixNewLine] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[long] identifier[now] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[LogEntry] identifier[entry] operator[=] Keyword[new] identifier[LogEntry] operator[SEP] identifier[now] , identifier[componentID] , identifier[fileOffset] operator[SEP] operator[SEP] identifier[String] identifier[line] operator[=] identifier[entry] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prefixNewLine] operator[SEP] { identifier[lockFileStream] operator[SEP] identifier[writeBytes] operator[SEP] identifier[System] operator[SEP] identifier[lineSeparator] operator[SEP] operator[SEP] operator[+] identifier[line] operator[SEP] operator[SEP] } Keyword[else] { identifier[lockFileStream] operator[SEP] identifier[writeBytes] operator[SEP] identifier[line] operator[SEP] operator[SEP] } identifier[lockFileStream] operator[SEP] identifier[hflush] operator[SEP] operator[SEP] operator[SEP] identifier[lastEntry] operator[=] identifier[entry] operator[SEP] }
public static String strMapToStr(Map<String, String> map) { StringBuilder sb = new StringBuilder(); if (map == null || map.isEmpty()) return sb.toString(); for (Entry<String, String> entry : map.entrySet()) { sb.append("< " + entry.getKey() + ", " + entry.getValue() + "> "); } return sb.toString(); }
class class_name[name] begin[{] method[strMapToStr, return_type[type[String]], modifier[public static], parameter[map]] begin[{] local_variable[type[StringBuilder], sb] if[binary_operation[binary_operation[member[.map], ==, literal[null]], ||, call[map.isEmpty, parameter[]]]] begin[{] return[call[sb.toString, parameter[]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="< "), operandr=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", "), operator=+), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> "), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[strMapToStr] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[map] operator[==] Other[null] operator[||] identifier[map] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public boolean hasUncountable() { return UtilEjml.isUncountable(A) || UtilEjml.isUncountable(C) || UtilEjml.isUncountable(D) || UtilEjml.isUncountable(E) || UtilEjml.isUncountable(F); }
class class_name[name] begin[{] method[hasUncountable, return_type[type[boolean]], modifier[public], parameter[]] begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[call[UtilEjml.isUncountable, parameter[member[.A]]], ||, call[UtilEjml.isUncountable, parameter[member[.C]]]], ||, call[UtilEjml.isUncountable, parameter[member[.D]]]], ||, call[UtilEjml.isUncountable, parameter[member[.E]]]], ||, call[UtilEjml.isUncountable, parameter[member[.F]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[hasUncountable] operator[SEP] operator[SEP] { Keyword[return] identifier[UtilEjml] operator[SEP] identifier[isUncountable] operator[SEP] identifier[A] operator[SEP] operator[||] identifier[UtilEjml] operator[SEP] identifier[isUncountable] operator[SEP] identifier[C] operator[SEP] operator[||] identifier[UtilEjml] operator[SEP] identifier[isUncountable] operator[SEP] identifier[D] operator[SEP] operator[||] identifier[UtilEjml] operator[SEP] identifier[isUncountable] operator[SEP] identifier[E] operator[SEP] operator[||] identifier[UtilEjml] operator[SEP] identifier[isUncountable] operator[SEP] identifier[F] operator[SEP] operator[SEP] }
public CustomSerializer getCustomSerializer() { if (this.customSerializer != null) { return customSerializer; } if (this.requestClass != null) { this.customSerializer = CustomSerializerManager.getCustomSerializer(this.requestClass); } if (this.customSerializer == null) { this.customSerializer = CustomSerializerManager.getCustomSerializer(this.getCmdCode()); } return this.customSerializer; }
class class_name[name] begin[{] method[getCustomSerializer, return_type[type[CustomSerializer]], modifier[public], parameter[]] begin[{] if[binary_operation[THIS[member[None.customSerializer]], !=, literal[null]]] begin[{] return[member[.customSerializer]] else begin[{] None end[}] if[binary_operation[THIS[member[None.requestClass]], !=, literal[null]]] begin[{] assign[THIS[member[None.customSerializer]], call[CustomSerializerManager.getCustomSerializer, parameter[THIS[member[None.requestClass]]]]] else begin[{] None end[}] if[binary_operation[THIS[member[None.customSerializer]], ==, literal[null]]] begin[{] assign[THIS[member[None.customSerializer]], call[CustomSerializerManager.getCustomSerializer, parameter[THIS[call[None.getCmdCode, parameter[]]]]]] else begin[{] None end[}] return[THIS[member[None.customSerializer]]] end[}] END[}]
Keyword[public] identifier[CustomSerializer] identifier[getCustomSerializer] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[customSerializer] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[customSerializer] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[requestClass] operator[!=] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[customSerializer] operator[=] identifier[CustomSerializerManager] operator[SEP] identifier[getCustomSerializer] operator[SEP] Keyword[this] operator[SEP] identifier[requestClass] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[customSerializer] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[customSerializer] operator[=] identifier[CustomSerializerManager] operator[SEP] identifier[getCustomSerializer] operator[SEP] Keyword[this] operator[SEP] identifier[getCmdCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[customSerializer] operator[SEP] }
@SuppressWarnings("unchecked") public static List<Statement> getStatements(MethodNode method) { Statement code = method.getCode(); if (!(code instanceof BlockStatement)) { // null or single statement BlockStatement block = new BlockStatement(); if (code != null) block.addStatement(code); method.setCode(block); } return ((BlockStatement)method.getCode()).getStatements(); }
class class_name[name] begin[{] method[getStatements, return_type[type[List]], modifier[public static], parameter[method]] begin[{] local_variable[type[Statement], code] if[binary_operation[member[.code], instanceof, type[BlockStatement]]] begin[{] local_variable[type[BlockStatement], block] if[binary_operation[member[.code], !=, literal[null]]] begin[{] call[block.addStatement, parameter[member[.code]]] else begin[{] None end[}] call[method.setCode, parameter[member[.block]]] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[], member=getCode, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=BlockStatement, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Statement] operator[>] identifier[getStatements] operator[SEP] identifier[MethodNode] identifier[method] operator[SEP] { identifier[Statement] identifier[code] operator[=] identifier[method] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[code] Keyword[instanceof] identifier[BlockStatement] operator[SEP] operator[SEP] { identifier[BlockStatement] identifier[block] operator[=] Keyword[new] identifier[BlockStatement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[code] operator[!=] Other[null] operator[SEP] identifier[block] operator[SEP] identifier[addStatement] operator[SEP] identifier[code] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[setCode] operator[SEP] identifier[block] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] operator[SEP] identifier[BlockStatement] operator[SEP] identifier[method] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getStatements] operator[SEP] operator[SEP] operator[SEP] }
public static boolean getBool(Properties props, String key, boolean defaultValue) { String value = props.getProperty(key); if (value != null) { return Boolean.parseBoolean(value); } else { return defaultValue; } }
class class_name[name] begin[{] method[getBool, return_type[type[boolean]], modifier[public static], parameter[props, key, defaultValue]] begin[{] local_variable[type[String], value] if[binary_operation[member[.value], !=, literal[null]]] begin[{] return[call[Boolean.parseBoolean, parameter[member[.value]]]] else begin[{] return[member[.defaultValue]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[getBool] operator[SEP] identifier[Properties] identifier[props] , identifier[String] identifier[key] , Keyword[boolean] identifier[defaultValue] operator[SEP] { identifier[String] identifier[value] operator[=] identifier[props] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[defaultValue] operator[SEP] } }
final static void init() { StopWatch stopWatch = new StopWatch(); stopWatch.start("Audit4jInit"); if (configContext == null) { configContext = new ConcurrentConfigurationContext(); } if (lifeCycle.getStatus().equals(RunStatus.READY) || lifeCycle.getStatus().equals(RunStatus.STOPPED)) { Audit4jBanner banner = new Audit4jBanner(); banner.printBanner(); Log.info("Initializing Audit4j..."); // Check system environment; checkEnvironment(); // Load configurations to Memory Log.info("Loading Configurations..."); if (conf == null) { loadConfig(); } Log.info("Validating Configurations..."); if (conf == null) { terminate(); throw new InitializationException(INIT_FAILED); } try { ValidationManager.validateConfigurations(conf); } catch (ValidationException e1) { terminate(); throw new InitializationException(INIT_FAILED, e1); } // Execute commands. CommandProcessor.getInstance().process(conf.getCommands()); // Load Registry configurations. loadRegistry(); if (conf.getProperties() == null) { conf.setProperties(new HashMap<String, String>()); } else { for (Map.Entry<String, String> entry : conf.getProperties().entrySet()) { if (System.getProperties().containsKey(entry.getValue())) { conf.getProperties().put(entry.getKey(), System.getProperty(entry.getValue())); } } } configContext.getProperties().putAll(conf.getProperties()); // Initialize handlers. initHandlers(); // Initialize layouts. initLayout(); // Initialize annotation transformer. if (conf.getAnnotationTransformer() == null) { annotationTransformer = getDefaultAnnotationTransformer(); } else { annotationTransformer = conf.getAnnotationTransformer(); } // Initialize IO streams. initStreams(); if (!conf.getFilters().isEmpty()) { Log.info("Registoring Filters..."); } for (AuditEventFilter filter : conf.getFilters()) { configContext.addFilter(filter); Log.info(filter.getClass().getName() + " Registored..."); } configContext.setMetaData(conf.getMetaData()); // Execute Scheduler tasks. Log.info("Executing Schedulers..."); Schedulers.taskRegistry().scheduleAll(); // Initialize monitoring support if available in the configurations. if (conf.getJmx() != null) { MBeanAgent agent = new MBeanAgent(); agent.setJmxConfig(conf.getJmx()); agent.init(); agent.registerMbeans(); } lifeCycle.setStatus(RunStatus.RUNNING); lifeCycle.setStartUpTime(new Date().getTime()); stopWatch.stop(); Long initializationTime = stopWatch.getLastTaskTimeMillis(); Log.info("Audit4j initialized. Total time: ", initializationTime, "ms"); } }
class class_name[name] begin[{] method[init, return_type[void], modifier[final static], parameter[]] begin[{] local_variable[type[StopWatch], stopWatch] call[stopWatch.start, parameter[literal["Audit4jInit"]]] if[binary_operation[member[.configContext], ==, literal[null]]] begin[{] assign[member[.configContext], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConcurrentConfigurationContext, sub_type=None))] else begin[{] None end[}] if[binary_operation[call[lifeCycle.getStatus, parameter[]], ||, call[lifeCycle.getStatus, parameter[]]]] begin[{] local_variable[type[Audit4jBanner], banner] call[banner.printBanner, parameter[]] call[Log.info, parameter[literal["Initializing Audit4j..."]]] call[.checkEnvironment, parameter[]] call[Log.info, parameter[literal["Loading Configurations..."]]] if[binary_operation[member[.conf], ==, literal[null]]] begin[{] call[.loadConfig, parameter[]] else begin[{] None end[}] call[Log.info, parameter[literal["Validating Configurations..."]]] if[binary_operation[member[.conf], ==, literal[null]]] begin[{] call[.terminate, parameter[]] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INIT_FAILED, 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=InitializationException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validateConfigurations, postfix_operators=[], prefix_operators=[], qualifier=ValidationManager, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=terminate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INIT_FAILED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e1, 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=InitializationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['ValidationException']))], finally_block=None, label=None, resources=None) call[CommandProcessor.getInstance, parameter[]] call[.loadRegistry, parameter[]] if[binary_operation[call[conf.getProperties, parameter[]], ==, literal[null]]] begin[{] call[conf.setProperties, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=containsKey, 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=MethodInvocation(arguments=[], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[MethodInvocation(arguments=[], member=entrySet, 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=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) end[}] call[configContext.getProperties, parameter[]] call[.initHandlers, parameter[]] call[.initLayout, parameter[]] if[binary_operation[call[conf.getAnnotationTransformer, parameter[]], ==, literal[null]]] begin[{] assign[member[.annotationTransformer], call[.getDefaultAnnotationTransformer, parameter[]]] else begin[{] assign[member[.annotationTransformer], call[conf.getAnnotationTransformer, parameter[]]] end[}] call[.initStreams, parameter[]] if[call[conf.getFilters, parameter[]]] begin[{] call[Log.info, parameter[literal["Registoring Filters..."]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addFilter, postfix_operators=[], prefix_operators=[], qualifier=configContext, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Registored..."), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getFilters, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=filter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AuditEventFilter, sub_type=None))), label=None) call[configContext.setMetaData, parameter[call[conf.getMetaData, parameter[]]]] call[Log.info, parameter[literal["Executing Schedulers..."]]] call[Schedulers.taskRegistry, parameter[]] if[binary_operation[call[conf.getJmx, parameter[]], !=, literal[null]]] begin[{] local_variable[type[MBeanAgent], agent] call[agent.setJmxConfig, parameter[call[conf.getJmx, parameter[]]]] call[agent.init, parameter[]] call[agent.registerMbeans, parameter[]] else begin[{] None end[}] call[lifeCycle.setStatus, parameter[member[RunStatus.RUNNING]]] call[lifeCycle.setStartUpTime, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]] call[stopWatch.stop, parameter[]] local_variable[type[Long], initializationTime] call[Log.info, parameter[literal["Audit4j initialized. Total time: "], member[.initializationTime], literal["ms"]]] else begin[{] None end[}] end[}] END[}]
Keyword[final] Keyword[static] Keyword[void] identifier[init] operator[SEP] operator[SEP] { identifier[StopWatch] identifier[stopWatch] operator[=] Keyword[new] identifier[StopWatch] operator[SEP] operator[SEP] operator[SEP] identifier[stopWatch] operator[SEP] identifier[start] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[configContext] operator[==] Other[null] operator[SEP] { identifier[configContext] operator[=] Keyword[new] identifier[ConcurrentConfigurationContext] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[lifeCycle] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[RunStatus] operator[SEP] identifier[READY] operator[SEP] operator[||] identifier[lifeCycle] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[RunStatus] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] { identifier[Audit4jBanner] identifier[banner] operator[=] Keyword[new] identifier[Audit4jBanner] operator[SEP] operator[SEP] operator[SEP] identifier[banner] operator[SEP] identifier[printBanner] operator[SEP] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[checkEnvironment] operator[SEP] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conf] operator[==] Other[null] operator[SEP] { identifier[loadConfig] operator[SEP] operator[SEP] operator[SEP] } identifier[Log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conf] operator[==] Other[null] operator[SEP] { identifier[terminate] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InitializationException] operator[SEP] identifier[INIT_FAILED] operator[SEP] operator[SEP] } Keyword[try] { identifier[ValidationManager] operator[SEP] identifier[validateConfigurations] operator[SEP] identifier[conf] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ValidationException] identifier[e1] operator[SEP] { identifier[terminate] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InitializationException] operator[SEP] identifier[INIT_FAILED] , identifier[e1] operator[SEP] operator[SEP] } identifier[CommandProcessor] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[process] operator[SEP] identifier[conf] operator[SEP] identifier[getCommands] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[loadRegistry] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conf] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[conf] operator[SEP] identifier[setProperties] operator[SEP] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[conf] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[System] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[conf] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } identifier[configContext] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[putAll] operator[SEP] identifier[conf] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[initHandlers] operator[SEP] operator[SEP] operator[SEP] identifier[initLayout] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conf] operator[SEP] identifier[getAnnotationTransformer] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[annotationTransformer] operator[=] identifier[getDefaultAnnotationTransformer] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[annotationTransformer] operator[=] identifier[conf] operator[SEP] identifier[getAnnotationTransformer] operator[SEP] operator[SEP] operator[SEP] } identifier[initStreams] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[conf] operator[SEP] identifier[getFilters] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[AuditEventFilter] identifier[filter] operator[:] identifier[conf] operator[SEP] identifier[getFilters] operator[SEP] operator[SEP] operator[SEP] { identifier[configContext] operator[SEP] identifier[addFilter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[info] operator[SEP] identifier[filter] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[configContext] operator[SEP] identifier[setMetaData] operator[SEP] identifier[conf] operator[SEP] identifier[getMetaData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Schedulers] operator[SEP] identifier[taskRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[scheduleAll] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conf] operator[SEP] identifier[getJmx] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[MBeanAgent] identifier[agent] operator[=] Keyword[new] identifier[MBeanAgent] operator[SEP] operator[SEP] operator[SEP] identifier[agent] operator[SEP] identifier[setJmxConfig] operator[SEP] identifier[conf] operator[SEP] identifier[getJmx] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[agent] operator[SEP] identifier[init] operator[SEP] operator[SEP] operator[SEP] identifier[agent] operator[SEP] identifier[registerMbeans] operator[SEP] operator[SEP] operator[SEP] } identifier[lifeCycle] operator[SEP] identifier[setStatus] operator[SEP] identifier[RunStatus] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[lifeCycle] operator[SEP] identifier[setStartUpTime] operator[SEP] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stopWatch] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] identifier[Long] identifier[initializationTime] operator[=] identifier[stopWatch] operator[SEP] identifier[getLastTaskTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[initializationTime] , literal[String] operator[SEP] operator[SEP] } }
public static JCExpression chainDots(JavacNode node, String elem1, String elem2, String... elems) { return chainDots(node, -1, elem1, elem2, elems); }
class class_name[name] begin[{] method[chainDots, return_type[type[JCExpression]], modifier[public static], parameter[node, elem1, elem2, elems]] begin[{] return[call[.chainDots, parameter[member[.node], literal[1], member[.elem1], member[.elem2], member[.elems]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[JCExpression] identifier[chainDots] operator[SEP] identifier[JavacNode] identifier[node] , identifier[String] identifier[elem1] , identifier[String] identifier[elem2] , identifier[String] operator[...] identifier[elems] operator[SEP] { Keyword[return] identifier[chainDots] operator[SEP] identifier[node] , operator[-] Other[1] , identifier[elem1] , identifier[elem2] , identifier[elems] operator[SEP] operator[SEP] }
public static <T> Generator<PVector2D<T>> createSmall() { return new PVector2DGenerator<>(PrimitiveGenerators.doubles( GeneratorConstants.BOUND_SMALL_DOUBLE_LOWER, GeneratorConstants.BOUND_SMALL_DOUBLE_UPPER )); }
class class_name[name] begin[{] method[createSmall, return_type[type[Generator]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=BOUND_SMALL_DOUBLE_LOWER, postfix_operators=[], prefix_operators=[], qualifier=GeneratorConstants, selectors=[]), MemberReference(member=BOUND_SMALL_DOUBLE_UPPER, postfix_operators=[], prefix_operators=[], qualifier=GeneratorConstants, selectors=[])], member=doubles, postfix_operators=[], prefix_operators=[], qualifier=PrimitiveGenerators, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=PVector2DGenerator, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Generator] operator[<] identifier[PVector2D] operator[<] identifier[T] operator[>] operator[>] identifier[createSmall] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[PVector2DGenerator] operator[<] operator[>] operator[SEP] identifier[PrimitiveGenerators] operator[SEP] identifier[doubles] operator[SEP] identifier[GeneratorConstants] operator[SEP] identifier[BOUND_SMALL_DOUBLE_LOWER] , identifier[GeneratorConstants] operator[SEP] identifier[BOUND_SMALL_DOUBLE_UPPER] operator[SEP] operator[SEP] operator[SEP] }
public String encodeBuffer(byte aBuffer[]) { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer); try { encodeBuffer(inStream, outStream); } catch (Exception IOException) { // This should never happen. throw new Error("CharacterEncoder.encodeBuffer internal error"); } return (outStream.toString()); }
class class_name[name] begin[{] method[encodeBuffer, return_type[type[String]], modifier[public], parameter[aBuffer]] begin[{] local_variable[type[ByteArrayOutputStream], outStream] local_variable[type[ByteArrayInputStream], inStream] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=inStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=outStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encodeBuffer, 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="CharacterEncoder.encodeBuffer internal error")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Error, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=IOException, types=['Exception']))], finally_block=None, label=None, resources=None) return[call[outStream.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[encodeBuffer] operator[SEP] Keyword[byte] identifier[aBuffer] operator[SEP] operator[SEP] operator[SEP] { identifier[ByteArrayOutputStream] identifier[outStream] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[ByteArrayInputStream] identifier[inStream] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[aBuffer] operator[SEP] operator[SEP] Keyword[try] { identifier[encodeBuffer] operator[SEP] identifier[inStream] , identifier[outStream] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[IOException] operator[SEP] { Keyword[throw] Keyword[new] identifier[Error] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[outStream] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public UnmonitorInstancesResult unmonitorInstances(UnmonitorInstancesRequest request) { request = beforeClientExecution(request); return executeUnmonitorInstances(request); }
class class_name[name] begin[{] method[unmonitorInstances, return_type[type[UnmonitorInstancesResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeUnmonitorInstances, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[UnmonitorInstancesResult] identifier[unmonitorInstances] operator[SEP] identifier[UnmonitorInstancesRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUnmonitorInstances] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public <T> void waitAbortable(Future<T> task) throws IOException, InterruptedException { while (!task.isDone() && !task.isCancelled()) { Char c = readIfAvailable(); if (c != null && (c.asInteger() == Char.ABR || c.asInteger() == Char.ESC)) { task.cancel(true); throw new IOException("Aborted with '" + c.asString() + "'"); } sleep(79L); } }
class class_name[name] begin[{] method[waitAbortable, return_type[void], modifier[public], parameter[task]] begin[{] while[binary_operation[call[task.isDone, parameter[]], &&, call[task.isCancelled, parameter[]]]] begin[{] local_variable[type[Char], c] if[binary_operation[binary_operation[member[.c], !=, literal[null]], &&, binary_operation[binary_operation[call[c.asInteger, parameter[]], ==, member[Char.ABR]], ||, binary_operation[call[c.asInteger, parameter[]], ==, member[Char.ESC]]]]] begin[{] call[task.cancel, parameter[literal[true]]] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Aborted with '"), operandr=MethodInvocation(arguments=[], member=asString, postfix_operators=[], prefix_operators=[], qualifier=c, 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=IOException, sub_type=None)), label=None) else begin[{] None end[}] call[.sleep, parameter[literal[79L]]] end[}] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] Keyword[void] identifier[waitAbortable] operator[SEP] identifier[Future] operator[<] identifier[T] operator[>] identifier[task] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] { Keyword[while] operator[SEP] operator[!] identifier[task] operator[SEP] identifier[isDone] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[task] operator[SEP] identifier[isCancelled] operator[SEP] operator[SEP] operator[SEP] { identifier[Char] identifier[c] operator[=] identifier[readIfAvailable] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[!=] Other[null] operator[&&] operator[SEP] identifier[c] operator[SEP] identifier[asInteger] operator[SEP] operator[SEP] operator[==] identifier[Char] operator[SEP] identifier[ABR] operator[||] identifier[c] operator[SEP] identifier[asInteger] operator[SEP] operator[SEP] operator[==] identifier[Char] operator[SEP] identifier[ESC] operator[SEP] operator[SEP] { identifier[task] operator[SEP] identifier[cancel] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[c] operator[SEP] identifier[asString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[sleep] operator[SEP] Other[79L] operator[SEP] operator[SEP] } }
public Request searchForFacetValuesOffline(final @NonNull String facetName, final @NonNull String text, @Nullable Query query, @NonNull final CompletionHandler completionHandler) { if (!mirrored) { throw new IllegalStateException("Offline requests are only available when the index is mirrored"); } final Query queryCopy = query != null ? new Query(query) : null; return getClient().new AsyncTaskRequest(completionHandler, getClient().localSearchExecutorService) { @NonNull @Override protected JSONObject run() throws AlgoliaException { return _searchForFacetValuesOffline(facetName, text, queryCopy); } }.start(); }
class class_name[name] begin[{] method[searchForFacetValuesOffline, return_type[type[Request]], modifier[public], parameter[facetName, text, query, completionHandler]] begin[{] if[member[.mirrored]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Offline requests are only available when the index is mirrored")], 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) else begin[{] None end[}] local_variable[type[Query], queryCopy] return[call[.getClient, parameter[]]] end[}] END[}]
Keyword[public] identifier[Request] identifier[searchForFacetValuesOffline] operator[SEP] Keyword[final] annotation[@] identifier[NonNull] identifier[String] identifier[facetName] , Keyword[final] annotation[@] identifier[NonNull] identifier[String] identifier[text] , annotation[@] identifier[Nullable] identifier[Query] identifier[query] , annotation[@] identifier[NonNull] Keyword[final] identifier[CompletionHandler] identifier[completionHandler] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[mirrored] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[Query] identifier[queryCopy] operator[=] identifier[query] operator[!=] Other[null] operator[?] Keyword[new] identifier[Query] operator[SEP] identifier[query] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[return] identifier[getClient] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[AsyncTaskRequest] operator[SEP] identifier[completionHandler] , identifier[getClient] operator[SEP] operator[SEP] operator[SEP] identifier[localSearchExecutorService] operator[SEP] { annotation[@] identifier[NonNull] annotation[@] identifier[Override] Keyword[protected] identifier[JSONObject] identifier[run] operator[SEP] operator[SEP] Keyword[throws] identifier[AlgoliaException] { Keyword[return] identifier[_searchForFacetValuesOffline] operator[SEP] identifier[facetName] , identifier[text] , identifier[queryCopy] operator[SEP] operator[SEP] } } operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] }
private void runSubmissions(boolean block) throws InterruptedException { if (block) { Runnable r = m_submissionQueue.take(); do { r.run(); } while ((r = m_submissionQueue.poll()) != null); } else { Runnable r = null; while ((r = m_submissionQueue.poll()) != null) { r.run(); } } }
class class_name[name] begin[{] method[runSubmissions, return_type[void], modifier[private], parameter[block]] begin[{] if[member[.block]] begin[{] local_variable[type[Runnable], r] do[binary_operation[assign[member[.r], call[m_submissionQueue.poll, parameter[]]], !=, literal[null]]] begin[{] call[r.run, parameter[]] end[}] else begin[{] local_variable[type[Runnable], r] while[binary_operation[assign[member[.r], call[m_submissionQueue.poll, parameter[]]], !=, literal[null]]] begin[{] call[r.run, parameter[]] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[runSubmissions] operator[SEP] Keyword[boolean] identifier[block] operator[SEP] Keyword[throws] identifier[InterruptedException] { Keyword[if] operator[SEP] identifier[block] operator[SEP] { identifier[Runnable] identifier[r] operator[=] identifier[m_submissionQueue] operator[SEP] identifier[take] operator[SEP] operator[SEP] operator[SEP] Keyword[do] { identifier[r] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] operator[SEP] identifier[r] operator[=] identifier[m_submissionQueue] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[Runnable] identifier[r] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[r] operator[=] identifier[m_submissionQueue] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[r] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } } }
public void floodFill(int xx, int yy, IntPredicate target, int replacement) { floodFill(xx, yy, 0, 0, width, height, target, replacement); }
class class_name[name] begin[{] method[floodFill, return_type[void], modifier[public], parameter[xx, yy, target, replacement]] begin[{] call[.floodFill, parameter[member[.xx], member[.yy], literal[0], literal[0], member[.width], member[.height], member[.target], member[.replacement]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[floodFill] operator[SEP] Keyword[int] identifier[xx] , Keyword[int] identifier[yy] , identifier[IntPredicate] identifier[target] , Keyword[int] identifier[replacement] operator[SEP] { identifier[floodFill] operator[SEP] identifier[xx] , identifier[yy] , Other[0] , Other[0] , identifier[width] , identifier[height] , identifier[target] , identifier[replacement] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public Set<EnvironmentType> getAllEnvironmentTypes(String identifier) throws GreenPepperServerException { log.debug("Retreiving all Environment Types"); Vector<Object> envTypesParams = (Vector<Object>)execute(XmlRpcMethodName.getAllEnvironmentTypes, new Vector(), identifier); return XmlRpcDataMarshaller.toEnvironmentTypeList(envTypesParams); }
class class_name[name] begin[{] method[getAllEnvironmentTypes, return_type[type[Set]], modifier[public], parameter[identifier]] begin[{] call[log.debug, parameter[literal["Retreiving all Environment Types"]]] local_variable[type[Vector], envTypesParams] return[call[XmlRpcDataMarshaller.toEnvironmentTypeList, parameter[member[.envTypesParams]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Set] operator[<] identifier[EnvironmentType] operator[>] identifier[getAllEnvironmentTypes] operator[SEP] identifier[String] identifier[identifier] operator[SEP] Keyword[throws] identifier[GreenPepperServerException] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Vector] operator[<] identifier[Object] operator[>] identifier[envTypesParams] operator[=] operator[SEP] identifier[Vector] operator[<] identifier[Object] operator[>] operator[SEP] identifier[execute] operator[SEP] identifier[XmlRpcMethodName] operator[SEP] identifier[getAllEnvironmentTypes] , Keyword[new] identifier[Vector] operator[SEP] operator[SEP] , identifier[identifier] operator[SEP] operator[SEP] Keyword[return] identifier[XmlRpcDataMarshaller] operator[SEP] identifier[toEnvironmentTypeList] operator[SEP] identifier[envTypesParams] operator[SEP] operator[SEP] }
public <T> Future<T> actAsync(final FileCallable<T> callable) throws IOException, InterruptedException { try { DelegatingCallable<T,IOException> wrapper = new FileCallableWrapper<>(callable); for (FileCallableWrapperFactory factory : ExtensionList.lookup(FileCallableWrapperFactory.class)) { wrapper = factory.wrap(wrapper); } return (channel!=null ? channel : localChannel) .callAsync(wrapper); } catch (IOException e) { // wrap it into a new IOException so that we get the caller's stack trace as well. throw new IOException("remote file operation failed",e); } }
class class_name[name] begin[{] method[actAsync, return_type[type[Future]], modifier[public], parameter[callable]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=callable, 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=FileCallableWrapper, sub_type=None)), name=wrapper)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IOException, sub_type=None))], dimensions=[], name=DelegatingCallable, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=wrapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=wrapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileCallableWrapperFactory, sub_type=None))], member=lookup, postfix_operators=[], prefix_operators=[], qualifier=ExtensionList, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=factory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileCallableWrapperFactory, sub_type=None))), label=None), ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=localChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="remote file operation failed"), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[Future] operator[<] identifier[T] operator[>] identifier[actAsync] operator[SEP] Keyword[final] identifier[FileCallable] operator[<] identifier[T] operator[>] identifier[callable] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] { Keyword[try] { identifier[DelegatingCallable] operator[<] identifier[T] , identifier[IOException] operator[>] identifier[wrapper] operator[=] Keyword[new] identifier[FileCallableWrapper] operator[<] operator[>] operator[SEP] identifier[callable] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FileCallableWrapperFactory] identifier[factory] operator[:] identifier[ExtensionList] operator[SEP] identifier[lookup] operator[SEP] identifier[FileCallableWrapperFactory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[wrapper] operator[=] identifier[factory] operator[SEP] identifier[wrap] operator[SEP] identifier[wrapper] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[channel] operator[!=] Other[null] operator[?] identifier[channel] operator[:] identifier[localChannel] operator[SEP] operator[SEP] identifier[callAsync] operator[SEP] identifier[wrapper] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public final double sampleMin() { long count = _acquireCount.get() - _releaseCount.get(); long min = _min.getAndSet(count); return min; }
class class_name[name] begin[{] method[sampleMin, return_type[type[double]], modifier[final public], parameter[]] begin[{] local_variable[type[long], count] local_variable[type[long], min] return[member[.min]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[double] identifier[sampleMin] operator[SEP] operator[SEP] { Keyword[long] identifier[count] operator[=] identifier[_acquireCount] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[-] identifier[_releaseCount] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[min] operator[=] identifier[_min] operator[SEP] identifier[getAndSet] operator[SEP] identifier[count] operator[SEP] operator[SEP] Keyword[return] identifier[min] operator[SEP] }
public final Profile updateProfile(Profile profile) { UpdateProfileRequest request = UpdateProfileRequest.newBuilder().setProfile(profile).build(); return updateProfile(request); }
class class_name[name] begin[{] method[updateProfile, return_type[type[Profile]], modifier[final public], parameter[profile]] begin[{] local_variable[type[UpdateProfileRequest], request] return[call[.updateProfile, parameter[member[.request]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[Profile] identifier[updateProfile] operator[SEP] identifier[Profile] identifier[profile] operator[SEP] { identifier[UpdateProfileRequest] identifier[request] operator[=] identifier[UpdateProfileRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setProfile] operator[SEP] identifier[profile] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[updateProfile] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static CommerceOrderNote findByPrimaryKey(long commerceOrderNoteId) throws com.liferay.commerce.exception.NoSuchOrderNoteException { return getPersistence().findByPrimaryKey(commerceOrderNoteId); }
class class_name[name] begin[{] method[findByPrimaryKey, return_type[type[CommerceOrderNote]], modifier[public static], parameter[commerceOrderNoteId]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommerceOrderNote] identifier[findByPrimaryKey] operator[SEP] Keyword[long] identifier[commerceOrderNoteId] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchOrderNoteException] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByPrimaryKey] operator[SEP] identifier[commerceOrderNoteId] operator[SEP] operator[SEP] }
public FragmentBundlerCompat<F> putSparseParcelableArray(String key, SparseArray<? extends Parcelable> value) { bundler.putSparseParcelableArray(key, value); return this; }
class class_name[name] begin[{] method[putSparseParcelableArray, return_type[type[FragmentBundlerCompat]], modifier[public], parameter[key, value]] begin[{] call[bundler.putSparseParcelableArray, parameter[member[.key], member[.value]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[FragmentBundlerCompat] operator[<] identifier[F] operator[>] identifier[putSparseParcelableArray] operator[SEP] identifier[String] identifier[key] , identifier[SparseArray] operator[<] operator[?] Keyword[extends] identifier[Parcelable] operator[>] identifier[value] operator[SEP] { identifier[bundler] operator[SEP] identifier[putSparseParcelableArray] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private void applyOverrideSystemDefault(Map<String, Object> parameterValues) { for (Parameter<?> parameter : allParameters) { Object overrideValue = parameterOverride.getOverrideSystemDefault(parameter); if (overrideValue != null) { parameterValues.put(parameter.getName(), overrideValue); } } }
class class_name[name] begin[{] method[applyOverrideSystemDefault, return_type[void], modifier[private], parameter[parameterValues]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=parameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOverrideSystemDefault, postfix_operators=[], prefix_operators=[], qualifier=parameterOverride, selectors=[], type_arguments=None), name=overrideValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=overrideValue, 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=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), MemberReference(member=overrideValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=parameterValues, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=allParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=parameter)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Parameter, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[applyOverrideSystemDefault] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parameterValues] operator[SEP] { Keyword[for] operator[SEP] identifier[Parameter] operator[<] operator[?] operator[>] identifier[parameter] operator[:] identifier[allParameters] operator[SEP] { identifier[Object] identifier[overrideValue] operator[=] identifier[parameterOverride] operator[SEP] identifier[getOverrideSystemDefault] operator[SEP] identifier[parameter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[overrideValue] operator[!=] Other[null] operator[SEP] { identifier[parameterValues] operator[SEP] identifier[put] operator[SEP] identifier[parameter] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[overrideValue] operator[SEP] operator[SEP] } } }
public TypeSpec.Builder buildDaoFactoryInterfaceInternal(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema) throws Exception { String schemaName = buildDaoFactoryName(schema); classBuilder = TypeSpec.interfaceBuilder(schemaName).addModifiers(Modifier.PUBLIC).addSuperinterface(BindDaoFactory.class); classBuilder.addJavadoc("<p>\n"); classBuilder.addJavadoc("Represents dao factory interface for $L.\n", schema.getName()); classBuilder.addJavadoc("This class expose database interface through Dao attribute.\n", schema.getName()); classBuilder.addJavadoc("</p>\n\n"); JavadocUtility.generateJavadocGeneratedBy(classBuilder); classBuilder.addJavadoc("@see $T\n", TypeUtility.typeName(schema.getElement())); for (SQLiteDaoDefinition dao : schema.getCollection()) { TypeName daoName = BindDaoBuilder.daoInterfaceTypeName(dao); TypeName daoImplName = BindDaoBuilder.daoTypeName(dao); classBuilder.addJavadoc("@see $T\n", daoName); classBuilder.addJavadoc("@see $T\n", daoImplName); String entity = BindDataSourceSubProcessor.generateEntityName(dao, dao.getEntity()); classBuilder.addJavadoc("@see $T\n", TypeUtility.typeName(entity)); } for (SQLiteDaoDefinition dao : schema.getCollection()) { TypeName daoImplName = BindDaoBuilder.daoTypeName(dao); // dao with external connections { MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("get" + dao.getName()) .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT).addJavadoc("Retrieve dao $L.\n\n@return dao implementation\n", dao.getName()) .returns(daoImplName); classBuilder.addMethod(methodBuilder.build()); } } SchemaUtility.generateTransaction(classBuilder, schema, true); return classBuilder; }
class class_name[name] begin[{] method[buildDaoFactoryInterfaceInternal, return_type[type[TypeSpec]], modifier[public], parameter[elementUtils, filer, schema]] begin[{] local_variable[type[String], schemaName] assign[member[.classBuilder], call[TypeSpec.interfaceBuilder, parameter[member[.schemaName]]]] call[classBuilder.addJavadoc, parameter[literal["<p>\n"]]] call[classBuilder.addJavadoc, parameter[literal["Represents dao factory interface for $L.\n"], call[schema.getName, parameter[]]]] call[classBuilder.addJavadoc, parameter[literal["This class expose database interface through Dao attribute.\n"], call[schema.getName, parameter[]]]] call[classBuilder.addJavadoc, parameter[literal["</p>\n\n"]]] call[JavadocUtility.generateJavadocGeneratedBy, parameter[member[.classBuilder]]] call[classBuilder.addJavadoc, parameter[literal["@see $T\n"], call[TypeUtility.typeName, parameter[call[schema.getElement, parameter[]]]]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=daoInterfaceTypeName, postfix_operators=[], prefix_operators=[], qualifier=BindDaoBuilder, selectors=[], type_arguments=None), name=daoName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeName, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=daoTypeName, postfix_operators=[], prefix_operators=[], qualifier=BindDaoBuilder, selectors=[], type_arguments=None), name=daoImplName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeName, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="@see $T\n"), MemberReference(member=daoName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addJavadoc, postfix_operators=[], prefix_operators=[], qualifier=classBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="@see $T\n"), MemberReference(member=daoImplName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addJavadoc, postfix_operators=[], prefix_operators=[], qualifier=classBuilder, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=dao, selectors=[], type_arguments=None)], member=generateEntityName, postfix_operators=[], prefix_operators=[], qualifier=BindDataSourceSubProcessor, selectors=[], type_arguments=None), name=entity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="@see $T\n"), MethodInvocation(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=typeName, postfix_operators=[], prefix_operators=[], qualifier=TypeUtility, selectors=[], type_arguments=None)], member=addJavadoc, postfix_operators=[], prefix_operators=[], qualifier=classBuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCollection, postfix_operators=[], prefix_operators=[], qualifier=schema, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dao)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SQLiteDaoDefinition, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=daoTypeName, postfix_operators=[], prefix_operators=[], qualifier=BindDaoBuilder, selectors=[], type_arguments=None), name=daoImplName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeName, sub_type=None)), BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="get"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=dao, selectors=[], type_arguments=None), operator=+)], member=methodBuilder, postfix_operators=[], prefix_operators=[], qualifier=MethodSpec, selectors=[MethodInvocation(arguments=[MemberReference(member=PUBLIC, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[]), MemberReference(member=ABSTRACT, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[])], member=addModifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Retrieve dao $L.\n\n@return dao implementation\n"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=dao, selectors=[], type_arguments=None)], member=addJavadoc, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=daoImplName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=returns, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=methodBuilder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodSpec, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None))), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=methodBuilder, selectors=[], type_arguments=None)], member=addMethod, postfix_operators=[], prefix_operators=[], qualifier=classBuilder, selectors=[], type_arguments=None), label=None)])]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCollection, postfix_operators=[], prefix_operators=[], qualifier=schema, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dao)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SQLiteDaoDefinition, sub_type=None))), label=None) call[SchemaUtility.generateTransaction, parameter[member[.classBuilder], member[.schema], literal[true]]] return[member[.classBuilder]] end[}] END[}]
Keyword[public] identifier[TypeSpec] operator[SEP] identifier[Builder] identifier[buildDaoFactoryInterfaceInternal] operator[SEP] identifier[Elements] identifier[elementUtils] , identifier[Filer] identifier[filer] , identifier[SQLiteDatabaseSchema] identifier[schema] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[schemaName] operator[=] identifier[buildDaoFactoryName] operator[SEP] identifier[schema] operator[SEP] operator[SEP] identifier[classBuilder] operator[=] identifier[TypeSpec] operator[SEP] identifier[interfaceBuilder] operator[SEP] identifier[schemaName] operator[SEP] operator[SEP] identifier[addModifiers] operator[SEP] identifier[Modifier] operator[SEP] identifier[PUBLIC] operator[SEP] operator[SEP] identifier[addSuperinterface] operator[SEP] identifier[BindDaoFactory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[classBuilder] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[classBuilder] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] , identifier[schema] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[classBuilder] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] , identifier[schema] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[classBuilder] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[JavadocUtility] operator[SEP] identifier[generateJavadocGeneratedBy] operator[SEP] identifier[classBuilder] operator[SEP] operator[SEP] identifier[classBuilder] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] , identifier[TypeUtility] operator[SEP] identifier[typeName] operator[SEP] identifier[schema] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SQLiteDaoDefinition] identifier[dao] operator[:] identifier[schema] operator[SEP] identifier[getCollection] operator[SEP] operator[SEP] operator[SEP] { identifier[TypeName] identifier[daoName] operator[=] identifier[BindDaoBuilder] operator[SEP] identifier[daoInterfaceTypeName] operator[SEP] identifier[dao] operator[SEP] operator[SEP] identifier[TypeName] identifier[daoImplName] operator[=] identifier[BindDaoBuilder] operator[SEP] identifier[daoTypeName] operator[SEP] identifier[dao] operator[SEP] operator[SEP] identifier[classBuilder] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] , identifier[daoName] operator[SEP] operator[SEP] identifier[classBuilder] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] , identifier[daoImplName] operator[SEP] operator[SEP] identifier[String] identifier[entity] operator[=] identifier[BindDataSourceSubProcessor] operator[SEP] identifier[generateEntityName] operator[SEP] identifier[dao] , identifier[dao] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[classBuilder] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] , identifier[TypeUtility] operator[SEP] identifier[typeName] operator[SEP] identifier[entity] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[SQLiteDaoDefinition] identifier[dao] operator[:] identifier[schema] operator[SEP] identifier[getCollection] operator[SEP] operator[SEP] operator[SEP] { identifier[TypeName] identifier[daoImplName] operator[=] identifier[BindDaoBuilder] operator[SEP] identifier[daoTypeName] operator[SEP] identifier[dao] operator[SEP] operator[SEP] { identifier[MethodSpec] operator[SEP] identifier[Builder] identifier[methodBuilder] operator[=] identifier[MethodSpec] operator[SEP] identifier[methodBuilder] operator[SEP] literal[String] operator[+] identifier[dao] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addModifiers] operator[SEP] identifier[Modifier] operator[SEP] identifier[PUBLIC] , identifier[Modifier] operator[SEP] identifier[ABSTRACT] operator[SEP] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] , identifier[dao] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[returns] operator[SEP] identifier[daoImplName] operator[SEP] operator[SEP] identifier[classBuilder] operator[SEP] identifier[addMethod] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[SchemaUtility] operator[SEP] identifier[generateTransaction] operator[SEP] identifier[classBuilder] , identifier[schema] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[classBuilder] operator[SEP] }
List<JCTree> classOrInterfaceBody(Name className, boolean isInterface) { accept(LBRACE); if (token.pos <= endPosTable.errorEndPos) { // error recovery skip(false, true, false, false); if (token.kind == LBRACE) nextToken(); } ListBuffer<JCTree> defs = new ListBuffer<JCTree>(); while (token.kind != RBRACE && token.kind != EOF) { defs.appendList(classOrInterfaceBodyDeclaration(className, isInterface)); if (token.pos <= endPosTable.errorEndPos) { // error recovery skip(false, true, true, false); } } accept(RBRACE); return defs.toList(); }
class class_name[name] begin[{] method[classOrInterfaceBody, return_type[type[List]], modifier[default], parameter[className, isInterface]] begin[{] call[.accept, parameter[member[.LBRACE]]] if[binary_operation[member[token.pos], <=, member[endPosTable.errorEndPos]]] begin[{] call[.skip, parameter[literal[false], literal[true], literal[false], literal[false]]] if[binary_operation[member[token.kind], ==, member[.LBRACE]]] begin[{] call[.nextToken, parameter[]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[ListBuffer], defs] while[binary_operation[binary_operation[member[token.kind], !=, member[.RBRACE]], &&, binary_operation[member[token.kind], !=, member[.EOF]]]] begin[{] call[defs.appendList, parameter[call[.classOrInterfaceBodyDeclaration, parameter[member[.className], member[.isInterface]]]]] if[binary_operation[member[token.pos], <=, member[endPosTable.errorEndPos]]] begin[{] call[.skip, parameter[literal[false], literal[true], literal[true], literal[false]]] else begin[{] None end[}] end[}] call[.accept, parameter[member[.RBRACE]]] return[call[defs.toList, parameter[]]] end[}] END[}]
identifier[List] operator[<] identifier[JCTree] operator[>] identifier[classOrInterfaceBody] operator[SEP] identifier[Name] identifier[className] , Keyword[boolean] identifier[isInterface] operator[SEP] { identifier[accept] operator[SEP] identifier[LBRACE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[pos] operator[<=] identifier[endPosTable] operator[SEP] identifier[errorEndPos] operator[SEP] { identifier[skip] operator[SEP] literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[kind] operator[==] identifier[LBRACE] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] } identifier[ListBuffer] operator[<] identifier[JCTree] operator[>] identifier[defs] operator[=] Keyword[new] identifier[ListBuffer] operator[<] identifier[JCTree] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[token] operator[SEP] identifier[kind] operator[!=] identifier[RBRACE] operator[&&] identifier[token] operator[SEP] identifier[kind] operator[!=] identifier[EOF] operator[SEP] { identifier[defs] operator[SEP] identifier[appendList] operator[SEP] identifier[classOrInterfaceBodyDeclaration] operator[SEP] identifier[className] , identifier[isInterface] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[pos] operator[<=] identifier[endPosTable] operator[SEP] identifier[errorEndPos] operator[SEP] { identifier[skip] operator[SEP] literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] } } identifier[accept] operator[SEP] identifier[RBRACE] operator[SEP] operator[SEP] Keyword[return] identifier[defs] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] }
private int checkCompatibility(Class<?>[] parameterTypes, Executable executable) { if (executable.getParameterCount() != parameterTypes.length) { return -1; } Class<?>[] executableParameterTypes = executable.getParameterTypes(); int result = 0; for (int i = 0; i < parameterTypes.length; ++i) { if (parameterTypes[i] == null) { if (executableParameterTypes[i].isPrimitive()) { return -1; } result = 1; } else { Class<?> wrapped = Primitives.wrap(executableParameterTypes[i]); if (wrapped != parameterTypes[i]) { if (!wrapped.isAssignableFrom(parameterTypes[i])) { return -1; } result = 1; } } } return result; }
class class_name[name] begin[{] method[checkCompatibility, return_type[type[int]], modifier[private], parameter[parameterTypes, executable]] begin[{] if[binary_operation[call[executable.getParameterCount, parameter[]], !=, member[parameterTypes.length]]] begin[{] return[literal[1]] else begin[{] None end[}] local_variable[type[Class], executableParameterTypes] local_variable[type[int], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=executableParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=Primitives, selectors=[], type_arguments=None), name=wrapped)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=wrapped, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=parameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=parameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=isAssignableFrom, postfix_operators=[], prefix_operators=['!'], qualifier=wrapped, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=executableParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=isPrimitive, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), 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=parameterTypes, 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[.result]] end[}] END[}]
Keyword[private] Keyword[int] identifier[checkCompatibility] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[parameterTypes] , identifier[Executable] identifier[executable] operator[SEP] { Keyword[if] operator[SEP] identifier[executable] operator[SEP] identifier[getParameterCount] operator[SEP] operator[SEP] operator[!=] identifier[parameterTypes] operator[SEP] identifier[length] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[executableParameterTypes] operator[=] identifier[executable] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[result] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[parameterTypes] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[if] operator[SEP] identifier[parameterTypes] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[executableParameterTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } identifier[result] operator[=] Other[1] operator[SEP] } Keyword[else] { identifier[Class] operator[<] operator[?] operator[>] identifier[wrapped] operator[=] identifier[Primitives] operator[SEP] identifier[wrap] operator[SEP] identifier[executableParameterTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wrapped] operator[!=] identifier[parameterTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[wrapped] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[parameterTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } identifier[result] operator[=] Other[1] operator[SEP] } } } Keyword[return] identifier[result] operator[SEP] }