code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static CPInstance fetchByUuid_C_Last(String uuid, long companyId, OrderByComparator<CPInstance> orderByComparator) { return getPersistence() .fetchByUuid_C_Last(uuid, companyId, orderByComparator); }
class class_name[name] begin[{] method[fetchByUuid_C_Last, return_type[type[CPInstance]], modifier[public static], parameter[uuid, companyId, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CPInstance] identifier[fetchByUuid_C_Last] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[companyId] , identifier[OrderByComparator] operator[<] identifier[CPInstance] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByUuid_C_Last] operator[SEP] identifier[uuid] , identifier[companyId] , identifier[orderByComparator] operator[SEP] operator[SEP] }
@Override public void close() throws IOException { super.close(); if (this.shxWriter != null) { this.shxWriter.close(); } if (this.dbfWriter != null) { this.dbfWriter.close(); this.attrContainers = null; } }
class class_name[name] begin[{] method[close, return_type[void], modifier[public], parameter[]] begin[{] SuperMethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) if[binary_operation[THIS[member[None.shxWriter]], !=, literal[null]]] begin[{] THIS[member[None.shxWriter]call[None.close, parameter[]]] else begin[{] None end[}] if[binary_operation[THIS[member[None.dbfWriter]], !=, literal[null]]] begin[{] THIS[member[None.dbfWriter]call[None.close, parameter[]]] assign[THIS[member[None.attrContainers]], literal[null]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[super] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[shxWriter] operator[!=] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[shxWriter] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[dbfWriter] operator[!=] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[dbfWriter] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[attrContainers] operator[=] Other[null] operator[SEP] } }
public void registerPlugin(final DajlabExtension plugin) { if (plugin != null) { if (plugin instanceof DajlabControllerExtensionInterface) { controllers.add((DajlabControllerExtensionInterface<DajlabModelInterface>) plugin); } if (plugin instanceof TabExtensionInterface) { tabPlugins.add((TabExtensionInterface) plugin); } if (plugin instanceof MenuExtensionInterface) { menuPlugins.add((MenuExtensionInterface) plugin); } } }
class class_name[name] begin[{] method[registerPlugin, return_type[void], modifier[public], parameter[plugin]] begin[{] if[binary_operation[member[.plugin], !=, literal[null]]] begin[{] if[binary_operation[member[.plugin], instanceof, type[DajlabControllerExtensionInterface]]] begin[{] call[controllers.add, parameter[Cast(expression=MemberReference(member=plugin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DajlabModelInterface, sub_type=None))], dimensions=[], name=DajlabControllerExtensionInterface, sub_type=None))]] else begin[{] None end[}] if[binary_operation[member[.plugin], instanceof, type[TabExtensionInterface]]] begin[{] call[tabPlugins.add, parameter[Cast(expression=MemberReference(member=plugin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TabExtensionInterface, sub_type=None))]] else begin[{] None end[}] if[binary_operation[member[.plugin], instanceof, type[MenuExtensionInterface]]] begin[{] call[menuPlugins.add, parameter[Cast(expression=MemberReference(member=plugin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MenuExtensionInterface, sub_type=None))]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerPlugin] operator[SEP] Keyword[final] identifier[DajlabExtension] identifier[plugin] operator[SEP] { Keyword[if] operator[SEP] identifier[plugin] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[plugin] Keyword[instanceof] identifier[DajlabControllerExtensionInterface] operator[SEP] { identifier[controllers] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[DajlabControllerExtensionInterface] operator[<] identifier[DajlabModelInterface] operator[>] operator[SEP] identifier[plugin] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[plugin] Keyword[instanceof] identifier[TabExtensionInterface] operator[SEP] { identifier[tabPlugins] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[TabExtensionInterface] operator[SEP] identifier[plugin] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[plugin] Keyword[instanceof] identifier[MenuExtensionInterface] operator[SEP] { identifier[menuPlugins] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[MenuExtensionInterface] operator[SEP] identifier[plugin] operator[SEP] operator[SEP] } } }
private void loadLemmatizerDicts(final Properties props) { final String resourcesDirectory = props.getProperty("resourcesDirectory"); final Resources resources = new Resources(); final URL binLemmatizerURL = resources.getBinaryDict(this.lang, resourcesDirectory); if (binLemmatizerURL == null) { final String resourcesLocation = resourcesDirectory == null ? "src/main/resources" : resourcesDirectory; System.err .println("WARNING: No lemmatizer dictionary available for language " + this.lang + " in " + resourcesLocation + "!"); } else { try { this.dictLemmatizer = new MorfologikLemmatizer(binLemmatizerURL); } catch (final IOException e) { e.printStackTrace(); } } }
class class_name[name] begin[{] method[loadLemmatizerDicts, return_type[void], modifier[private], parameter[props]] begin[{] local_variable[type[String], resourcesDirectory] local_variable[type[Resources], resources] local_variable[type[URL], binLemmatizerURL] if[binary_operation[member[.binLemmatizerURL], ==, literal[null]]] begin[{] local_variable[type[String], resourcesLocation] call[System.err.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["WARNING: No lemmatizer dictionary available for language "], +, THIS[member[None.lang]]], +, literal[" in "]], +, member[.resourcesLocation]], +, literal["!"]]]] else begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dictLemmatizer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=ClassCreator(arguments=[MemberReference(member=binLemmatizerURL, 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=MorfologikLemmatizer, sub_type=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=['IOException']))], finally_block=None, label=None, resources=None) end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[loadLemmatizerDicts] operator[SEP] Keyword[final] identifier[Properties] identifier[props] operator[SEP] { Keyword[final] identifier[String] identifier[resourcesDirectory] operator[=] identifier[props] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Resources] identifier[resources] operator[=] Keyword[new] identifier[Resources] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[URL] identifier[binLemmatizerURL] operator[=] identifier[resources] operator[SEP] identifier[getBinaryDict] operator[SEP] Keyword[this] operator[SEP] identifier[lang] , identifier[resourcesDirectory] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[binLemmatizerURL] operator[==] Other[null] operator[SEP] { Keyword[final] identifier[String] identifier[resourcesLocation] operator[=] identifier[resourcesDirectory] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[resourcesDirectory] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[lang] operator[+] literal[String] operator[+] identifier[resourcesLocation] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[try] { Keyword[this] operator[SEP] identifier[dictLemmatizer] operator[=] Keyword[new] identifier[MorfologikLemmatizer] operator[SEP] identifier[binLemmatizerURL] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } } }
public static void reverse(final char[] a, int fromIndex, int toIndex) { checkFromToIndex(fromIndex, toIndex, len(a)); if (N.isNullOrEmpty(a) || a.length == 1) { return; } char tmp = 0; for (int i = fromIndex, j = toIndex - 1; i < j; i++, j--) { tmp = a[i]; a[i] = a[j]; a[j] = tmp; } }
class class_name[name] begin[{] method[reverse, return_type[void], modifier[public static], parameter[a, fromIndex, toIndex]] begin[{] call[.checkFromToIndex, parameter[member[.fromIndex], member[.toIndex], call[.len, parameter[member[.a]]]]] if[binary_operation[call[N.isNullOrEmpty, parameter[member[.a]]], ||, binary_operation[member[a.length], ==, literal[1]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[char], tmp] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=fromIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i), VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=toIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[reverse] operator[SEP] Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[a] , Keyword[int] identifier[fromIndex] , Keyword[int] identifier[toIndex] operator[SEP] { identifier[checkFromToIndex] operator[SEP] identifier[fromIndex] , identifier[toIndex] , identifier[len] operator[SEP] identifier[a] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[N] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[a] operator[SEP] operator[||] identifier[a] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] { Keyword[return] operator[SEP] } Keyword[char] identifier[tmp] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[fromIndex] , identifier[j] operator[=] identifier[toIndex] operator[-] Other[1] operator[SEP] identifier[i] operator[<] identifier[j] operator[SEP] identifier[i] operator[++] , identifier[j] operator[--] operator[SEP] { identifier[tmp] operator[=] identifier[a] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[a] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[a] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[tmp] operator[SEP] } }
public void marshall(OutputDetail outputDetail, ProtocolMarshaller protocolMarshaller) { if (outputDetail == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(outputDetail.getDurationInMs(), DURATIONINMS_BINDING); protocolMarshaller.marshall(outputDetail.getVideoDetails(), VIDEODETAILS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[outputDetail, protocolMarshaller]] begin[{] if[binary_operation[member[.outputDetail], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDurationInMs, postfix_operators=[], prefix_operators=[], qualifier=outputDetail, selectors=[], type_arguments=None), MemberReference(member=DURATIONINMS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getVideoDetails, postfix_operators=[], prefix_operators=[], qualifier=outputDetail, selectors=[], type_arguments=None), MemberReference(member=VIDEODETAILS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[OutputDetail] identifier[outputDetail] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[outputDetail] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[outputDetail] operator[SEP] identifier[getDurationInMs] operator[SEP] operator[SEP] , identifier[DURATIONINMS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[outputDetail] operator[SEP] identifier[getVideoDetails] operator[SEP] operator[SEP] , identifier[VIDEODETAILS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void setOut(PrintStream out) { this.out = out; if (!(System.out instanceof ThreadLocalPrintStream)) { throw new IllegalStateException("System.out should be set by nailgun."); } ThreadLocalPrintStream tls = (ThreadLocalPrintStream) System.out; tls.init(out); }
class class_name[name] begin[{] method[setOut, return_type[void], modifier[public], parameter[out]] begin[{] assign[THIS[member[None.out]], member[.out]] if[binary_operation[member[System.out], instanceof, type[ThreadLocalPrintStream]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="System.out should be set by nailgun.")], 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[ThreadLocalPrintStream], tls] call[tls.init, parameter[member[.out]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setOut] operator[SEP] identifier[PrintStream] identifier[out] operator[SEP] { Keyword[this] operator[SEP] identifier[out] operator[=] identifier[out] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[System] operator[SEP] identifier[out] Keyword[instanceof] identifier[ThreadLocalPrintStream] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[ThreadLocalPrintStream] identifier[tls] operator[=] operator[SEP] identifier[ThreadLocalPrintStream] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[tls] operator[SEP] identifier[init] operator[SEP] identifier[out] operator[SEP] operator[SEP] }
public void setControlValue(Object objValue) { String strValue = ZERO; if (objValue instanceof Integer) strValue = objValue.toString(); this.setName(strValue); }
class class_name[name] begin[{] method[setControlValue, return_type[void], modifier[public], parameter[objValue]] begin[{] local_variable[type[String], strValue] if[binary_operation[member[.objValue], instanceof, type[Integer]]] begin[{] assign[member[.strValue], call[objValue.toString, parameter[]]] else begin[{] None end[}] THIS[call[None.setName, parameter[member[.strValue]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setControlValue] operator[SEP] identifier[Object] identifier[objValue] operator[SEP] { identifier[String] identifier[strValue] operator[=] identifier[ZERO] operator[SEP] Keyword[if] operator[SEP] identifier[objValue] Keyword[instanceof] identifier[Integer] operator[SEP] identifier[strValue] operator[=] identifier[objValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setName] operator[SEP] identifier[strValue] operator[SEP] operator[SEP] }
public static Context time(String appid, Class<?> clazz, String... names) { String className = getClassName(clazz); Timer systemTimer = getTimer(SYSTEM_METRICS_NAME, className, names); Timer appTimer = appid == null || appid.isEmpty() ? null : getTimer(appid, className, names); return new Context(systemTimer, appTimer); }
class class_name[name] begin[{] method[time, return_type[type[Context]], modifier[public static], parameter[appid, clazz, names]] begin[{] local_variable[type[String], className] local_variable[type[Timer], systemTimer] local_variable[type[Timer], appTimer] return[ClassCreator(arguments=[MemberReference(member=systemTimer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=appTimer, 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=Context, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Context] identifier[time] operator[SEP] identifier[String] identifier[appid] , identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[String] operator[...] identifier[names] operator[SEP] { identifier[String] identifier[className] operator[=] identifier[getClassName] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] identifier[Timer] identifier[systemTimer] operator[=] identifier[getTimer] operator[SEP] identifier[SYSTEM_METRICS_NAME] , identifier[className] , identifier[names] operator[SEP] operator[SEP] identifier[Timer] identifier[appTimer] operator[=] identifier[appid] operator[==] Other[null] operator[||] identifier[appid] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[?] Other[null] operator[:] identifier[getTimer] operator[SEP] identifier[appid] , identifier[className] , identifier[names] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Context] operator[SEP] identifier[systemTimer] , identifier[appTimer] operator[SEP] operator[SEP] }
public final void deleteContext(ContextName name) { DeleteContextRequest request = DeleteContextRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteContext(request); }
class class_name[name] begin[{] method[deleteContext, return_type[void], modifier[final public], parameter[name]] begin[{] local_variable[type[DeleteContextRequest], request] call[.deleteContext, parameter[member[.request]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[deleteContext] operator[SEP] identifier[ContextName] identifier[name] operator[SEP] { identifier[DeleteContextRequest] identifier[request] operator[=] identifier[DeleteContextRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[name] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[deleteContext] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
@Override public void addSourceTargetSet(UnicodeSet inputFilter, UnicodeSet sourceSet, UnicodeSet targetSet) { SourceTargetUtility cache; synchronized (SOURCE_CACHE) { //String id = getID(); cache = SOURCE_CACHE.get(norm2); if (cache == null) { cache = new SourceTargetUtility(new NormalizingTransform(norm2), norm2); SOURCE_CACHE.put(norm2, cache); } } cache.addSourceTargetSet(this, inputFilter, sourceSet, targetSet); }
class class_name[name] begin[{] method[addSourceTargetSet, return_type[void], modifier[public], parameter[inputFilter, sourceSet, targetSet]] begin[{] local_variable[type[SourceTargetUtility], cache] SYNCHRONIZED[member[.SOURCE_CACHE]] BEGIN[{] assign[member[.cache], call[SOURCE_CACHE.get, parameter[member[.norm2]]]] if[binary_operation[member[.cache], ==, literal[null]]] begin[{] assign[member[.cache], ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=norm2, 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=NormalizingTransform, sub_type=None)), MemberReference(member=norm2, 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=SourceTargetUtility, sub_type=None))] call[SOURCE_CACHE.put, parameter[member[.norm2], member[.cache]]] else begin[{] None end[}] END[}] call[cache.addSourceTargetSet, parameter[THIS[], member[.inputFilter], member[.sourceSet], member[.targetSet]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addSourceTargetSet] operator[SEP] identifier[UnicodeSet] identifier[inputFilter] , identifier[UnicodeSet] identifier[sourceSet] , identifier[UnicodeSet] identifier[targetSet] operator[SEP] { identifier[SourceTargetUtility] identifier[cache] operator[SEP] Keyword[synchronized] operator[SEP] identifier[SOURCE_CACHE] operator[SEP] { identifier[cache] operator[=] identifier[SOURCE_CACHE] operator[SEP] identifier[get] operator[SEP] identifier[norm2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cache] operator[==] Other[null] operator[SEP] { identifier[cache] operator[=] Keyword[new] identifier[SourceTargetUtility] operator[SEP] Keyword[new] identifier[NormalizingTransform] operator[SEP] identifier[norm2] operator[SEP] , identifier[norm2] operator[SEP] operator[SEP] identifier[SOURCE_CACHE] operator[SEP] identifier[put] operator[SEP] identifier[norm2] , identifier[cache] operator[SEP] operator[SEP] } } identifier[cache] operator[SEP] identifier[addSourceTargetSet] operator[SEP] Keyword[this] , identifier[inputFilter] , identifier[sourceSet] , identifier[targetSet] operator[SEP] operator[SEP] }
public void startSwipe(ViewHolder viewHolder) { if (!mCallback.hasSwipeFlag(mRecyclerView, viewHolder)) { Log.e(TAG, "Start swipe has been called but swiping is not enabled"); return; } if (viewHolder.itemView.getParent() != mRecyclerView) { Log.e(TAG, "Start swipe has been called with a view holder which is not a child of " + "the RecyclerView controlled by this ItemTouchHelper."); return; } obtainVelocityTracker(); mDx = mDy = 0f; select(viewHolder, ACTION_STATE_SWIPE); }
class class_name[name] begin[{] method[startSwipe, return_type[void], modifier[public], parameter[viewHolder]] begin[{] if[call[mCallback.hasSwipeFlag, parameter[member[.mRecyclerView], member[.viewHolder]]]] begin[{] call[Log.e, parameter[member[.TAG], literal["Start swipe has been called but swiping is not enabled"]]] return[None] else begin[{] None end[}] if[binary_operation[call[viewHolder.itemView.getParent, parameter[]], !=, member[.mRecyclerView]]] begin[{] call[Log.e, parameter[member[.TAG], binary_operation[literal["Start swipe has been called with a view holder which is not a child of "], +, literal["the RecyclerView controlled by this ItemTouchHelper."]]]] return[None] else begin[{] None end[}] call[.obtainVelocityTracker, parameter[]] assign[member[.mDx], assign[member[.mDy], literal[0f]]] call[.select, parameter[member[.viewHolder], member[.ACTION_STATE_SWIPE]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[startSwipe] operator[SEP] identifier[ViewHolder] identifier[viewHolder] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[mCallback] operator[SEP] identifier[hasSwipeFlag] operator[SEP] identifier[mRecyclerView] , identifier[viewHolder] operator[SEP] operator[SEP] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[viewHolder] operator[SEP] identifier[itemView] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[!=] identifier[mRecyclerView] operator[SEP] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[obtainVelocityTracker] operator[SEP] operator[SEP] operator[SEP] identifier[mDx] operator[=] identifier[mDy] operator[=] literal[Float] operator[SEP] identifier[select] operator[SEP] identifier[viewHolder] , identifier[ACTION_STATE_SWIPE] operator[SEP] operator[SEP] }
public void setLogTypesToEnable(java.util.Collection<String> logTypesToEnable) { if (logTypesToEnable == null) { this.logTypesToEnable = null; return; } this.logTypesToEnable = new java.util.ArrayList<String>(logTypesToEnable); }
class class_name[name] begin[{] method[setLogTypesToEnable, return_type[void], modifier[public], parameter[logTypesToEnable]] begin[{] if[binary_operation[member[.logTypesToEnable], ==, literal[null]]] begin[{] assign[THIS[member[None.logTypesToEnable]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.logTypesToEnable]], ClassCreator(arguments=[MemberReference(member=logTypesToEnable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setLogTypesToEnable] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[logTypesToEnable] operator[SEP] { Keyword[if] operator[SEP] identifier[logTypesToEnable] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[logTypesToEnable] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[logTypesToEnable] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[logTypesToEnable] operator[SEP] operator[SEP] }
private static double regularizedIncompleteGammaSeries(double a, double x) { if (a < 0.0 || x < 0.0 || x >= a + 1) { throw new IllegalArgumentException(String.format("Invalid a = %f, x = %f", a, x)); } int i = 0; double igf = 0.0; boolean check = true; double acopy = a; double sum = 1.0 / a; double incr = sum; double loggamma = lgamma(a); while (check) { ++i; ++a; incr *= x / a; sum += incr; if (Math.abs(incr) < Math.abs(sum) * INCOMPLETE_GAMMA_EPSILON) { igf = sum * Math.exp(-x + acopy * Math.log(x) - loggamma); check = false; } if (i >= INCOMPLETE_GAMMA_MAX_ITERATIONS) { check = false; igf = sum * Math.exp(-x + acopy * Math.log(x) - loggamma); logger.error("Gamma.regularizedIncompleteGammaSeries: Maximum number of iterations wes exceeded"); } } return igf; }
class class_name[name] begin[{] method[regularizedIncompleteGammaSeries, return_type[type[double]], modifier[private static], parameter[a, x]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.a], <, literal[0.0]], ||, binary_operation[member[.x], <, literal[0.0]]], ||, binary_operation[member[.x], >=, binary_operation[member[.a], +, literal[1]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid a = %f, x = %f"), MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], i] local_variable[type[double], igf] local_variable[type[boolean], check] local_variable[type[double], acopy] local_variable[type[double], sum] local_variable[type[double], incr] local_variable[type[double], loggamma] while[member[.check]] begin[{] member[.i] member[.a] assign[member[.incr], binary_operation[member[.x], /, member[.a]]] assign[member[.sum], member[.incr]] if[binary_operation[call[Math.abs, parameter[member[.incr]]], <, binary_operation[call[Math.abs, parameter[member[.sum]]], *, member[.INCOMPLETE_GAMMA_EPSILON]]]] begin[{] assign[member[.igf], binary_operation[member[.sum], *, call[Math.exp, parameter[binary_operation[binary_operation[member[.x], +, binary_operation[member[.acopy], *, call[Math.log, parameter[member[.x]]]]], -, member[.loggamma]]]]]] assign[member[.check], literal[false]] else begin[{] None end[}] if[binary_operation[member[.i], >=, member[.INCOMPLETE_GAMMA_MAX_ITERATIONS]]] begin[{] assign[member[.check], literal[false]] assign[member[.igf], binary_operation[member[.sum], *, call[Math.exp, parameter[binary_operation[binary_operation[member[.x], +, binary_operation[member[.acopy], *, call[Math.log, parameter[member[.x]]]]], -, member[.loggamma]]]]]] call[logger.error, parameter[literal["Gamma.regularizedIncompleteGammaSeries: Maximum number of iterations wes exceeded"]]] else begin[{] None end[}] end[}] return[member[.igf]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[double] identifier[regularizedIncompleteGammaSeries] operator[SEP] Keyword[double] identifier[a] , Keyword[double] identifier[x] operator[SEP] { Keyword[if] operator[SEP] identifier[a] operator[<] literal[Float] operator[||] identifier[x] operator[<] literal[Float] operator[||] identifier[x] operator[>=] identifier[a] operator[+] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[a] , identifier[x] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[double] identifier[igf] operator[=] literal[Float] operator[SEP] Keyword[boolean] identifier[check] operator[=] literal[boolean] operator[SEP] Keyword[double] identifier[acopy] operator[=] identifier[a] operator[SEP] Keyword[double] identifier[sum] operator[=] literal[Float] operator[/] identifier[a] operator[SEP] Keyword[double] identifier[incr] operator[=] identifier[sum] operator[SEP] Keyword[double] identifier[loggamma] operator[=] identifier[lgamma] operator[SEP] identifier[a] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[check] operator[SEP] { operator[++] identifier[i] operator[SEP] operator[++] identifier[a] operator[SEP] identifier[incr] operator[*=] identifier[x] operator[/] identifier[a] operator[SEP] identifier[sum] operator[+=] identifier[incr] operator[SEP] Keyword[if] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[incr] operator[SEP] operator[<] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[sum] operator[SEP] operator[*] identifier[INCOMPLETE_GAMMA_EPSILON] operator[SEP] { identifier[igf] operator[=] identifier[sum] operator[*] identifier[Math] operator[SEP] identifier[exp] operator[SEP] operator[-] identifier[x] operator[+] identifier[acopy] operator[*] identifier[Math] operator[SEP] identifier[log] operator[SEP] identifier[x] operator[SEP] operator[-] identifier[loggamma] operator[SEP] operator[SEP] identifier[check] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[i] operator[>=] identifier[INCOMPLETE_GAMMA_MAX_ITERATIONS] operator[SEP] { identifier[check] operator[=] literal[boolean] operator[SEP] identifier[igf] operator[=] identifier[sum] operator[*] identifier[Math] operator[SEP] identifier[exp] operator[SEP] operator[-] identifier[x] operator[+] identifier[acopy] operator[*] identifier[Math] operator[SEP] identifier[log] operator[SEP] identifier[x] operator[SEP] operator[-] identifier[loggamma] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[igf] operator[SEP] }
private void sendHubHeartbeats() { RackHeartbeat rack = _rack; UpdateRackHeartbeat updateRack = rack.getUpdate(); UpdatePodSystem updatePod = getUpdatePodSystem(); long now = CurrentTime.currentTime(); if (! isJoinComplete()) { updatePod = null; } // send hub update to all servers in the rack for (ServerHeartbeat rackServer : _rack.getServers()) { if (rackServer == null || rackServer == _serverSelf) { continue; } ServerTarget target = createTargetServer(rackServer); target.hubHeartbeat(getServerSelf().getUpdate(), updateRack, updatePod, now); } }
class class_name[name] begin[{] method[sendHubHeartbeats, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[RackHeartbeat], rack] local_variable[type[UpdateRackHeartbeat], updateRack] local_variable[type[UpdatePodSystem], updatePod] local_variable[type[long], now] if[call[.isJoinComplete, parameter[]]] begin[{] assign[member[.updatePod], literal[null]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rackServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=rackServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_serverSelf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=rackServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createTargetServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=target)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServerTarget, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getServerSelf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getUpdate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=updateRack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=updatePod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hubHeartbeat, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getServers, postfix_operators=[], prefix_operators=[], qualifier=_rack, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rackServer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServerHeartbeat, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[sendHubHeartbeats] operator[SEP] operator[SEP] { identifier[RackHeartbeat] identifier[rack] operator[=] identifier[_rack] operator[SEP] identifier[UpdateRackHeartbeat] identifier[updateRack] operator[=] identifier[rack] operator[SEP] identifier[getUpdate] operator[SEP] operator[SEP] operator[SEP] identifier[UpdatePodSystem] identifier[updatePod] operator[=] identifier[getUpdatePodSystem] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[now] operator[=] identifier[CurrentTime] operator[SEP] identifier[currentTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isJoinComplete] operator[SEP] operator[SEP] operator[SEP] { identifier[updatePod] operator[=] Other[null] operator[SEP] } Keyword[for] operator[SEP] identifier[ServerHeartbeat] identifier[rackServer] operator[:] identifier[_rack] operator[SEP] identifier[getServers] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[rackServer] operator[==] Other[null] operator[||] identifier[rackServer] operator[==] identifier[_serverSelf] operator[SEP] { Keyword[continue] operator[SEP] } identifier[ServerTarget] identifier[target] operator[=] identifier[createTargetServer] operator[SEP] identifier[rackServer] operator[SEP] operator[SEP] identifier[target] operator[SEP] identifier[hubHeartbeat] operator[SEP] identifier[getServerSelf] operator[SEP] operator[SEP] operator[SEP] identifier[getUpdate] operator[SEP] operator[SEP] , identifier[updateRack] , identifier[updatePod] , identifier[now] operator[SEP] operator[SEP] } }
public void extract(@NotNull final InputStream inputStream, @NotNull final Metadata metadata) throws IOException { RandomAccessStreamReader reader = new RandomAccessStreamReader(inputStream); EpsDirectory directory = new EpsDirectory(); metadata.addDirectory(directory); /* * 0xC5D0D3C6 signifies an EPS Header block which contains 32-bytes of basic information * * 0x25215053 (%!PS) signifies an EPS File and leads straight into the PostScript */ switch (reader.getInt32(0)) { case 0xC5D0D3C6: reader.setMotorolaByteOrder(false); int postScriptOffset = reader.getInt32(4); int postScriptLength = reader.getInt32(8); int wmfOffset = reader.getInt32(12); int wmfSize = reader.getInt32(16); int tifOffset = reader.getInt32(20); int tifSize = reader.getInt32(24); //int checkSum = reader.getInt32(28); // Get Tiff/WMF preview data if applicable if (tifSize != 0) { directory.setInt(EpsDirectory.TAG_TIFF_PREVIEW_SIZE, tifSize); directory.setInt(EpsDirectory.TAG_TIFF_PREVIEW_OFFSET, tifOffset); // Get Tiff metadata try { ByteArrayReader byteArrayReader = new ByteArrayReader(reader.getBytes(tifOffset, tifSize)); new TiffReader().processTiff(byteArrayReader, new PhotoshopTiffHandler(metadata, null), 0); } catch (TiffProcessingException ex) { directory.addError("Unable to process TIFF data: " + ex.getMessage()); } } else if (wmfSize != 0) { directory.setInt(EpsDirectory.TAG_WMF_PREVIEW_SIZE, wmfSize); directory.setInt(EpsDirectory.TAG_WMF_PREVIEW_OFFSET, wmfOffset); } // TODO avoid allocating byte array here -- read directly from InputStream extract(directory, metadata, new SequentialByteArrayReader(reader.getBytes(postScriptOffset, postScriptLength))); break; case 0x25215053: inputStream.reset(); extract(directory, metadata, new StreamReader(inputStream)); break; default: directory.addError("File type not supported."); break; } }
class class_name[name] begin[{] method[extract, return_type[void], modifier[public], parameter[inputStream, metadata]] begin[{] local_variable[type[RandomAccessStreamReader], reader] local_variable[type[EpsDirectory], directory] call[metadata.addDirectory, parameter[member[.directory]]] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xC5D0D3C6)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setMotorolaByteOrder, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], member=getInt32, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=postScriptOffset)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8)], member=getInt32, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=postScriptLength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12)], member=getInt32, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=wmfOffset)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16)], member=getInt32, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=wmfSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=20)], member=getInt32, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=tifOffset)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24)], member=getInt32, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=tifSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tifSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=wmfSize, 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=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG_WMF_PREVIEW_SIZE, postfix_operators=[], prefix_operators=[], qualifier=EpsDirectory, selectors=[]), MemberReference(member=wmfSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=directory, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG_WMF_PREVIEW_OFFSET, postfix_operators=[], prefix_operators=[], qualifier=EpsDirectory, selectors=[]), MemberReference(member=wmfOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=directory, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG_TIFF_PREVIEW_SIZE, postfix_operators=[], prefix_operators=[], qualifier=EpsDirectory, selectors=[]), MemberReference(member=tifSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=directory, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG_TIFF_PREVIEW_OFFSET, postfix_operators=[], prefix_operators=[], qualifier=EpsDirectory, selectors=[]), MemberReference(member=tifOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=directory, selectors=[], type_arguments=None), label=None), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=tifOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tifSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayReader, sub_type=None)), name=byteArrayReader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayReader, sub_type=None)), StatementExpression(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=byteArrayReader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PhotoshopTiffHandler, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=processTiff, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TiffReader, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to process TIFF data: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), operator=+)], member=addError, postfix_operators=[], prefix_operators=[], qualifier=directory, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['TiffProcessingException']))], finally_block=None, label=None, resources=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=directory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=postScriptOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=postScriptLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SequentialByteArrayReader, sub_type=None))], member=extract, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x25215053)], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=inputStream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=directory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=inputStream, 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=StreamReader, sub_type=None))], member=extract, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File type not supported.")], member=addError, postfix_operators=[], prefix_operators=[], qualifier=directory, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getInt32, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[extract] operator[SEP] annotation[@] identifier[NotNull] Keyword[final] identifier[InputStream] identifier[inputStream] , annotation[@] identifier[NotNull] Keyword[final] identifier[Metadata] identifier[metadata] operator[SEP] Keyword[throws] identifier[IOException] { identifier[RandomAccessStreamReader] identifier[reader] operator[=] Keyword[new] identifier[RandomAccessStreamReader] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] identifier[EpsDirectory] identifier[directory] operator[=] Keyword[new] identifier[EpsDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[metadata] operator[SEP] identifier[addDirectory] operator[SEP] identifier[directory] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[reader] operator[SEP] identifier[getInt32] operator[SEP] Other[0] operator[SEP] operator[SEP] { Keyword[case] literal[Integer] operator[:] identifier[reader] operator[SEP] identifier[setMotorolaByteOrder] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[postScriptOffset] operator[=] identifier[reader] operator[SEP] identifier[getInt32] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[int] identifier[postScriptLength] operator[=] identifier[reader] operator[SEP] identifier[getInt32] operator[SEP] Other[8] operator[SEP] operator[SEP] Keyword[int] identifier[wmfOffset] operator[=] identifier[reader] operator[SEP] identifier[getInt32] operator[SEP] Other[12] operator[SEP] operator[SEP] Keyword[int] identifier[wmfSize] operator[=] identifier[reader] operator[SEP] identifier[getInt32] operator[SEP] Other[16] operator[SEP] operator[SEP] Keyword[int] identifier[tifOffset] operator[=] identifier[reader] operator[SEP] identifier[getInt32] operator[SEP] Other[20] operator[SEP] operator[SEP] Keyword[int] identifier[tifSize] operator[=] identifier[reader] operator[SEP] identifier[getInt32] operator[SEP] Other[24] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tifSize] operator[!=] Other[0] operator[SEP] { identifier[directory] operator[SEP] identifier[setInt] operator[SEP] identifier[EpsDirectory] operator[SEP] identifier[TAG_TIFF_PREVIEW_SIZE] , identifier[tifSize] operator[SEP] operator[SEP] identifier[directory] operator[SEP] identifier[setInt] operator[SEP] identifier[EpsDirectory] operator[SEP] identifier[TAG_TIFF_PREVIEW_OFFSET] , identifier[tifOffset] operator[SEP] operator[SEP] Keyword[try] { identifier[ByteArrayReader] identifier[byteArrayReader] operator[=] Keyword[new] identifier[ByteArrayReader] operator[SEP] identifier[reader] operator[SEP] identifier[getBytes] operator[SEP] identifier[tifOffset] , identifier[tifSize] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[TiffReader] operator[SEP] operator[SEP] operator[SEP] identifier[processTiff] operator[SEP] identifier[byteArrayReader] , Keyword[new] identifier[PhotoshopTiffHandler] operator[SEP] identifier[metadata] , Other[null] operator[SEP] , Other[0] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TiffProcessingException] identifier[ex] operator[SEP] { identifier[directory] operator[SEP] identifier[addError] operator[SEP] literal[String] operator[+] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[wmfSize] operator[!=] Other[0] operator[SEP] { identifier[directory] operator[SEP] identifier[setInt] operator[SEP] identifier[EpsDirectory] operator[SEP] identifier[TAG_WMF_PREVIEW_SIZE] , identifier[wmfSize] operator[SEP] operator[SEP] identifier[directory] operator[SEP] identifier[setInt] operator[SEP] identifier[EpsDirectory] operator[SEP] identifier[TAG_WMF_PREVIEW_OFFSET] , identifier[wmfOffset] operator[SEP] operator[SEP] } identifier[extract] operator[SEP] identifier[directory] , identifier[metadata] , Keyword[new] identifier[SequentialByteArrayReader] operator[SEP] identifier[reader] operator[SEP] identifier[getBytes] operator[SEP] identifier[postScriptOffset] , identifier[postScriptLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[Integer] operator[:] identifier[inputStream] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[extract] operator[SEP] identifier[directory] , identifier[metadata] , Keyword[new] identifier[StreamReader] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[directory] operator[SEP] identifier[addError] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } }
protected String htmlPagingBar() { if (getNumberOfPages() < 2) { return ""; } StringBuffer html = new StringBuffer(1024); CmsMessages messages = Messages.get().getBundle(getWp().getLocale()); html.append("<table width='100%' cellspacing='0' style='margin-top: 5px;'>\n"); html.append("\t<tr>\n"); html.append("\t\t<td class='main'>\n"); // prev button String id = "listPrev"; String name = messages.key(Messages.GUI_LIST_PAGING_PREVIOUS_NAME_0); String iconPath = ICON_LEFT; boolean enabled = getCurrentPage() > 1; String helpText = messages.key(Messages.GUI_LIST_PAGING_PREVIOUS_HELP_0); if (!enabled) { helpText = messages.key(Messages.GUI_LIST_PAGING_PREVIOUS_HELPDIS_0); } String onClic = "listSetPage('" + getId() + "', " + (getCurrentPage() - 1) + ")"; html.append(A_CmsHtmlIconButton.defaultButtonHtml( CmsHtmlIconButtonStyleEnum.SMALL_ICON_TEXT, id, name, helpText, enabled, iconPath, null, onClic)); html.append("\n"); // next button id = "listNext"; name = messages.key(Messages.GUI_LIST_PAGING_NEXT_NAME_0); iconPath = ICON_RIGHT; enabled = getCurrentPage() < getNumberOfPages(); helpText = messages.key(Messages.GUI_LIST_PAGING_NEXT_HELP_0); if (!enabled) { helpText = messages.key(Messages.GUI_LIST_PAGING_NEXT_HELPDIS_0); } onClic = "listSetPage('" + getId() + "', " + (getCurrentPage() + 1) + ")"; html.append(A_CmsHtmlIconButton.defaultButtonHtml( CmsHtmlIconButtonStyleEnum.SMALL_ICON_TEXT, id, name, helpText, enabled, iconPath, null, onClic)); html.append("\n"); // page selection list html.append("\t\t\t&nbsp;&nbsp;&nbsp;"); html.append("\t\t\t<select name='listPageSet' id='id-page_set' onChange =\"listSetPage('"); html.append(getId()); html.append("', this.value);\" style='vertical-align: bottom;'>\n"); html.append( htmlPageSelector( getNumberOfPages(), getMaxItemsPerPage(), getSize(), getCurrentPage(), getWp().getLocale())); html.append("\t\t\t</select>\n"); html.append("\t\t\t&nbsp;&nbsp;&nbsp;"); boolean isNotSearching = true; if (getMetadata().isSearchable()) { isNotSearching = CmsStringUtil.isEmptyOrWhitespaceOnly(m_searchFilter); } if (isNotSearching) { html.append( messages.key( Messages.GUI_LIST_PAGING_TEXT_2, new Object[] {m_name.key(getWp().getLocale()), new Integer(getTotalSize())})); } else { html.append(messages.key( Messages.GUI_LIST_PAGING_FILTER_TEXT_3, new Object[] {m_name.key(getWp().getLocale()), new Integer(getSize()), new Integer(getTotalSize())})); } html.append("\t\t</td>\n"); html.append("\t</tr>\n"); html.append("</table>\n"); return html.toString(); }
class class_name[name] begin[{] method[htmlPagingBar, return_type[type[String]], modifier[protected], parameter[]] begin[{] if[binary_operation[call[.getNumberOfPages, parameter[]], <, literal[2]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[StringBuffer], html] local_variable[type[CmsMessages], messages] call[html.append, parameter[literal["<table width='100%' cellspacing='0' style='margin-top: 5px;'>\n"]]] call[html.append, parameter[literal["\t<tr>\n"]]] call[html.append, parameter[literal["\t\t<td class='main'>\n"]]] local_variable[type[String], id] local_variable[type[String], name] local_variable[type[String], iconPath] local_variable[type[boolean], enabled] local_variable[type[String], helpText] if[member[.enabled]] begin[{] assign[member[.helpText], call[messages.key, parameter[member[Messages.GUI_LIST_PAGING_PREVIOUS_HELPDIS_0]]]] else begin[{] None end[}] local_variable[type[String], onClic] call[html.append, parameter[call[A_CmsHtmlIconButton.defaultButtonHtml, parameter[member[CmsHtmlIconButtonStyleEnum.SMALL_ICON_TEXT], member[.id], member[.name], member[.helpText], member[.enabled], member[.iconPath], literal[null], member[.onClic]]]]] call[html.append, parameter[literal["\n"]]] assign[member[.id], literal["listNext"]] assign[member[.name], call[messages.key, parameter[member[Messages.GUI_LIST_PAGING_NEXT_NAME_0]]]] assign[member[.iconPath], member[.ICON_RIGHT]] assign[member[.enabled], binary_operation[call[.getCurrentPage, parameter[]], <, call[.getNumberOfPages, parameter[]]]] assign[member[.helpText], call[messages.key, parameter[member[Messages.GUI_LIST_PAGING_NEXT_HELP_0]]]] if[member[.enabled]] begin[{] assign[member[.helpText], call[messages.key, parameter[member[Messages.GUI_LIST_PAGING_NEXT_HELPDIS_0]]]] else begin[{] None end[}] assign[member[.onClic], binary_operation[binary_operation[binary_operation[binary_operation[literal["listSetPage('"], +, call[.getId, parameter[]]], +, literal["', "]], +, binary_operation[call[.getCurrentPage, parameter[]], +, literal[1]]], +, literal[")"]]] call[html.append, parameter[call[A_CmsHtmlIconButton.defaultButtonHtml, parameter[member[CmsHtmlIconButtonStyleEnum.SMALL_ICON_TEXT], member[.id], member[.name], member[.helpText], member[.enabled], member[.iconPath], literal[null], member[.onClic]]]]] call[html.append, parameter[literal["\n"]]] call[html.append, parameter[literal["\t\t\t&nbsp;&nbsp;&nbsp;"]]] call[html.append, parameter[literal["\t\t\t<select name='listPageSet' id='id-page_set' onChange =\"listSetPage('"]]] call[html.append, parameter[call[.getId, parameter[]]]] call[html.append, parameter[literal["', this.value);\" style='vertical-align: bottom;'>\n"]]] call[html.append, parameter[call[.htmlPageSelector, parameter[call[.getNumberOfPages, parameter[]], call[.getMaxItemsPerPage, parameter[]], call[.getSize, parameter[]], call[.getCurrentPage, parameter[]], call[.getWp, parameter[]]]]]] call[html.append, parameter[literal["\t\t\t</select>\n"]]] call[html.append, parameter[literal["\t\t\t&nbsp;&nbsp;&nbsp;"]]] local_variable[type[boolean], isNotSearching] if[call[.getMetadata, parameter[]]] begin[{] assign[member[.isNotSearching], call[CmsStringUtil.isEmptyOrWhitespaceOnly, parameter[member[.m_searchFilter]]]] else begin[{] None end[}] if[member[.isNotSearching]] begin[{] call[html.append, parameter[call[messages.key, parameter[member[Messages.GUI_LIST_PAGING_TEXT_2], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getLocale, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=key, postfix_operators=[], prefix_operators=[], qualifier=m_name, selectors=[], type_arguments=None), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTotalSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]]] else begin[{] call[html.append, parameter[call[messages.key, parameter[member[Messages.GUI_LIST_PAGING_FILTER_TEXT_3], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getLocale, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=key, postfix_operators=[], prefix_operators=[], qualifier=m_name, selectors=[], type_arguments=None), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTotalSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]]] end[}] call[html.append, parameter[literal["\t\t</td>\n"]]] call[html.append, parameter[literal["\t</tr>\n"]]] call[html.append, parameter[literal["</table>\n"]]] return[call[html.toString, parameter[]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[htmlPagingBar] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[getNumberOfPages] operator[SEP] operator[SEP] operator[<] Other[2] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[StringBuffer] identifier[html] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[1024] operator[SEP] operator[SEP] identifier[CmsMessages] identifier[messages] operator[=] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] identifier[getWp] operator[SEP] operator[SEP] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[id] operator[=] literal[String] operator[SEP] identifier[String] identifier[name] operator[=] identifier[messages] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LIST_PAGING_PREVIOUS_NAME_0] operator[SEP] operator[SEP] identifier[String] identifier[iconPath] operator[=] identifier[ICON_LEFT] operator[SEP] Keyword[boolean] identifier[enabled] operator[=] identifier[getCurrentPage] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] identifier[String] identifier[helpText] operator[=] identifier[messages] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LIST_PAGING_PREVIOUS_HELP_0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[enabled] operator[SEP] { identifier[helpText] operator[=] identifier[messages] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LIST_PAGING_PREVIOUS_HELPDIS_0] operator[SEP] operator[SEP] } identifier[String] identifier[onClic] operator[=] literal[String] operator[+] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[getCurrentPage] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[+] literal[String] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[A_CmsHtmlIconButton] operator[SEP] identifier[defaultButtonHtml] operator[SEP] identifier[CmsHtmlIconButtonStyleEnum] operator[SEP] identifier[SMALL_ICON_TEXT] , identifier[id] , identifier[name] , identifier[helpText] , identifier[enabled] , identifier[iconPath] , Other[null] , identifier[onClic] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[id] operator[=] literal[String] operator[SEP] identifier[name] operator[=] identifier[messages] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LIST_PAGING_NEXT_NAME_0] operator[SEP] operator[SEP] identifier[iconPath] operator[=] identifier[ICON_RIGHT] operator[SEP] identifier[enabled] operator[=] identifier[getCurrentPage] operator[SEP] operator[SEP] operator[<] identifier[getNumberOfPages] operator[SEP] operator[SEP] operator[SEP] identifier[helpText] operator[=] identifier[messages] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LIST_PAGING_NEXT_HELP_0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[enabled] operator[SEP] { identifier[helpText] operator[=] identifier[messages] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LIST_PAGING_NEXT_HELPDIS_0] operator[SEP] operator[SEP] } identifier[onClic] operator[=] literal[String] operator[+] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[getCurrentPage] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[+] literal[String] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[A_CmsHtmlIconButton] operator[SEP] identifier[defaultButtonHtml] operator[SEP] identifier[CmsHtmlIconButtonStyleEnum] operator[SEP] identifier[SMALL_ICON_TEXT] , identifier[id] , identifier[name] , identifier[helpText] , identifier[enabled] , identifier[iconPath] , Other[null] , identifier[onClic] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[htmlPageSelector] operator[SEP] identifier[getNumberOfPages] operator[SEP] operator[SEP] , identifier[getMaxItemsPerPage] operator[SEP] operator[SEP] , identifier[getSize] operator[SEP] operator[SEP] , identifier[getCurrentPage] operator[SEP] operator[SEP] , identifier[getWp] operator[SEP] operator[SEP] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[isNotSearching] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[isSearchable] operator[SEP] operator[SEP] operator[SEP] { identifier[isNotSearching] operator[=] identifier[CmsStringUtil] operator[SEP] identifier[isEmptyOrWhitespaceOnly] operator[SEP] identifier[m_searchFilter] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isNotSearching] operator[SEP] { identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[messages] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LIST_PAGING_TEXT_2] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[m_name] operator[SEP] identifier[key] operator[SEP] identifier[getWp] operator[SEP] operator[SEP] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] , Keyword[new] identifier[Integer] operator[SEP] identifier[getTotalSize] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[messages] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LIST_PAGING_FILTER_TEXT_3] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[m_name] operator[SEP] identifier[key] operator[SEP] identifier[getWp] operator[SEP] operator[SEP] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] , Keyword[new] identifier[Integer] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] , Keyword[new] identifier[Integer] operator[SEP] identifier[getTotalSize] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] operator[SEP] } identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[html] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void parse(UNode resultsNode) throws IllegalArgumentException { // Root must be a "results" node. Utils.require("results".equals(resultsNode.getName()), "'results' expected: " + resultsNode.getName()); // Parse "groupsets" first if present. UNode groupsetsNode = resultsNode.getMember("groupsets"); if (groupsetsNode != null) { for (UNode groupsetNode : groupsetsNode.getMemberList()) { // Children should only be "groupset" Map. Utils.require(groupsetNode.getName().equals("groupset"), "'groupset' expected: " + groupsetNode); // Add an AggGroupSet child and parse child nodes into it. AggGroupSet groupset = addGroupSet(); groupset.parse(groupsetNode); } } // If a "groupsets" node was not found, and this is not a global aggregate query, // we'll create a single AggGroupSet object to hold the single-tree results using // this variable: AggGroupSet singleGroupSet = null; // Parse child nodes for (String childName : resultsNode.getMemberNames()) { UNode childNode = resultsNode.getMember(childName); // aggregate if (childName.equals("aggregate")) { for (String paramName : childNode.getMemberNames()) { UNode paramNode = childNode.getMember(paramName); Utils.require(paramNode.isValue(), "Value node expected: " + paramNode); if (paramName.equals("metric")) { m_metricParam = paramNode.getValue(); } else if (paramName.equals("query")) { m_queryParam = paramNode.getValue(); } else if (paramName.equals("group")) { m_groupingParam = paramNode.getValue(); } else { Utils.require(false, "Unrecognized aggregate parameter: " + paramName); } } // totalobjects } else if (childName.equals("totalobjects")) { Utils.require(childNode.isValue(), "Value expected: " + childNode); m_totalObjects = Long.parseLong(childNode.getValue()); // global "value" or "summary" } else if (childName.equals("value") || childName.equals("summary")) { Utils.require(childNode.isValue(), "Value expected: " + childNode); m_globalValue = childNode.getValue(); // groupsets } else if (childName.equals("groupsets")) { // Already parsed above. assert groupsetsNode != null; // groups } else if (childName.equals("groups")) { // Create and/or update the implicit groupset object. Utils.require(groupsetsNode == null, "Outer 'groups' not allowed with 'groupsets'"); if (singleGroupSet == null) { singleGroupSet = addGroupSet(); } singleGroupSet.parseOption(childNode); // totalgroups } else if (childName.equals("totalgroups")) { // Create and/or update the implicit groupset object. Utils.require(groupsetsNode == null, "Outer 'totalgroups' not allowed with 'groupsets'"); if (singleGroupSet == null) { singleGroupSet = addGroupSet(); } singleGroupSet.parseOption(childNode); // Unrecognized } else { Utils.require(false, "Unrecognized option: " + childName); } } }
class class_name[name] begin[{] method[parse, return_type[void], modifier[public], parameter[resultsNode]] begin[{] call[Utils.require, parameter[literal["results"], binary_operation[literal["'results' expected: "], +, call[resultsNode.getName, parameter[]]]]] local_variable[type[UNode], groupsetsNode] if[binary_operation[member[.groupsetsNode], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=groupsetNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="groupset")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'groupset' expected: "), operandr=MemberReference(member=groupsetNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=require, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=addGroupSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=groupset)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AggGroupSet, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=groupsetNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=groupset, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMemberList, postfix_operators=[], prefix_operators=[], qualifier=groupsetsNode, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=groupsetNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UNode, sub_type=None))), label=None) else begin[{] None end[}] local_variable[type[AggGroupSet], singleGroupSet] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=childName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMember, postfix_operators=[], prefix_operators=[], qualifier=resultsNode, selectors=[], type_arguments=None), name=childNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UNode, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="aggregate")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=childName, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="totalobjects")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=childName, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=childName, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="summary")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=childName, selectors=[], type_arguments=None), operator=||), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="groupsets")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=childName, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="groups")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=childName, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="totalgroups")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=childName, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecognized option: "), operandr=MemberReference(member=childName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=require, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=groupsetsNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Outer 'totalgroups' not allowed with 'groupsets'")], member=require, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=singleGroupSet, 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=singleGroupSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=addGroupSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseOption, postfix_operators=[], prefix_operators=[], qualifier=singleGroupSet, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=groupsetsNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Outer 'groups' not allowed with 'groupsets'")], member=require, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=singleGroupSet, 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=singleGroupSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=addGroupSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseOption, postfix_operators=[], prefix_operators=[], qualifier=singleGroupSet, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=groupsetsNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=isValue, postfix_operators=[], prefix_operators=[], qualifier=childNode, selectors=[], type_arguments=None), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Value expected: "), operandr=MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=require, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_globalValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=childNode, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=isValue, postfix_operators=[], prefix_operators=[], qualifier=childNode, selectors=[], type_arguments=None), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Value expected: "), operandr=MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=require, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_totalObjects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=childNode, selectors=[], type_arguments=None)], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=paramName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMember, postfix_operators=[], prefix_operators=[], qualifier=childNode, selectors=[], type_arguments=None), name=paramNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UNode, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=isValue, postfix_operators=[], prefix_operators=[], qualifier=paramNode, selectors=[], type_arguments=None), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Value node expected: "), operandr=MemberReference(member=paramNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=require, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="metric")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=paramName, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="query")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=paramName, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="group")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=paramName, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecognized aggregate parameter: "), operandr=MemberReference(member=paramName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=require, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_groupingParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=paramNode, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_queryParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=paramNode, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_metricParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=paramNode, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMemberNames, postfix_operators=[], prefix_operators=[], qualifier=childNode, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=paramName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMemberNames, postfix_operators=[], prefix_operators=[], qualifier=resultsNode, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=childName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[parse] operator[SEP] identifier[UNode] identifier[resultsNode] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[resultsNode] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[resultsNode] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[UNode] identifier[groupsetsNode] operator[=] identifier[resultsNode] operator[SEP] identifier[getMember] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[groupsetsNode] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[UNode] identifier[groupsetNode] operator[:] identifier[groupsetsNode] operator[SEP] identifier[getMemberList] operator[SEP] operator[SEP] operator[SEP] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[groupsetNode] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] , literal[String] operator[+] identifier[groupsetNode] operator[SEP] operator[SEP] identifier[AggGroupSet] identifier[groupset] operator[=] identifier[addGroupSet] operator[SEP] operator[SEP] operator[SEP] identifier[groupset] operator[SEP] identifier[parse] operator[SEP] identifier[groupsetNode] operator[SEP] operator[SEP] } } identifier[AggGroupSet] identifier[singleGroupSet] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[childName] operator[:] identifier[resultsNode] operator[SEP] identifier[getMemberNames] operator[SEP] operator[SEP] operator[SEP] { identifier[UNode] identifier[childNode] operator[=] identifier[resultsNode] operator[SEP] identifier[getMember] operator[SEP] identifier[childName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[childName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[paramName] operator[:] identifier[childNode] operator[SEP] identifier[getMemberNames] operator[SEP] operator[SEP] operator[SEP] { identifier[UNode] identifier[paramNode] operator[=] identifier[childNode] operator[SEP] identifier[getMember] operator[SEP] identifier[paramName] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[paramNode] operator[SEP] identifier[isValue] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[paramNode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[paramName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[m_metricParam] operator[=] identifier[paramNode] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[paramName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[m_queryParam] operator[=] identifier[paramNode] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[paramName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[m_groupingParam] operator[=] identifier[paramNode] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] literal[boolean] , literal[String] operator[+] identifier[paramName] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[childName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[childNode] operator[SEP] identifier[isValue] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[childNode] operator[SEP] operator[SEP] identifier[m_totalObjects] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[childNode] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[childName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[childName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[childNode] operator[SEP] identifier[isValue] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[childNode] operator[SEP] operator[SEP] identifier[m_globalValue] operator[=] identifier[childNode] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[childName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[assert] identifier[groupsetsNode] operator[!=] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[childName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[groupsetsNode] operator[==] Other[null] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[singleGroupSet] operator[==] Other[null] operator[SEP] { identifier[singleGroupSet] operator[=] identifier[addGroupSet] operator[SEP] operator[SEP] operator[SEP] } identifier[singleGroupSet] operator[SEP] identifier[parseOption] operator[SEP] identifier[childNode] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[childName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[groupsetsNode] operator[==] Other[null] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[singleGroupSet] operator[==] Other[null] operator[SEP] { identifier[singleGroupSet] operator[=] identifier[addGroupSet] operator[SEP] operator[SEP] operator[SEP] } identifier[singleGroupSet] operator[SEP] identifier[parseOption] operator[SEP] identifier[childNode] operator[SEP] operator[SEP] } Keyword[else] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] literal[boolean] , literal[String] operator[+] identifier[childName] operator[SEP] operator[SEP] } } }
public boolean isKeyword(String... keywords) { if (keywords.length == 0) { return is(TokenType.KEYWORD); } for (String keyword : keywords) { if (matches(TokenType.KEYWORD, keyword)) { return true; } } return false; }
class class_name[name] begin[{] method[isKeyword, return_type[type[boolean]], modifier[public], parameter[keywords]] begin[{] if[binary_operation[member[keywords.length], ==, literal[0]]] begin[{] return[call[.is, parameter[member[TokenType.KEYWORD]]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=KEYWORD, postfix_operators=[], prefix_operators=[], qualifier=TokenType, selectors=[]), MemberReference(member=keyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=, 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=MemberReference(member=keywords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=keyword)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isKeyword] operator[SEP] identifier[String] operator[...] identifier[keywords] operator[SEP] { Keyword[if] operator[SEP] identifier[keywords] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[is] operator[SEP] identifier[TokenType] operator[SEP] identifier[KEYWORD] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[keyword] operator[:] identifier[keywords] operator[SEP] { Keyword[if] operator[SEP] identifier[matches] operator[SEP] identifier[TokenType] operator[SEP] identifier[KEYWORD] , identifier[keyword] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public InputStream sendRequest(String requestMethod, Map<String, String> parameters) throws IOException { String queryString = getQueryString(parameters); URL url = new URL(this.apiBaseUrl); HttpURLConnection connection = (HttpURLConnection) WebResourceFetcherImpl .getUrlConnection(url); setupConnection(requestMethod, queryString, connection); OutputStreamWriter writer = new OutputStreamWriter( connection.getOutputStream()); writer.write(queryString); writer.flush(); writer.close(); int rc = connection.getResponseCode(); if (rc != 200) { logger.warn("Error: API request returned response code " + rc); } InputStream iStream = connection.getInputStream(); fillCookies(connection.getHeaderFields()); return iStream; }
class class_name[name] begin[{] method[sendRequest, return_type[type[InputStream]], modifier[public], parameter[requestMethod, parameters]] begin[{] local_variable[type[String], queryString] local_variable[type[URL], url] local_variable[type[HttpURLConnection], connection] call[.setupConnection, parameter[member[.requestMethod], member[.queryString], member[.connection]]] local_variable[type[OutputStreamWriter], writer] call[writer.write, parameter[member[.queryString]]] call[writer.flush, parameter[]] call[writer.close, parameter[]] local_variable[type[int], rc] if[binary_operation[member[.rc], !=, literal[200]]] begin[{] call[logger.warn, parameter[binary_operation[literal["Error: API request returned response code "], +, member[.rc]]]] else begin[{] None end[}] local_variable[type[InputStream], iStream] call[.fillCookies, parameter[call[connection.getHeaderFields, parameter[]]]] return[member[.iStream]] end[}] END[}]
Keyword[public] identifier[InputStream] identifier[sendRequest] operator[SEP] identifier[String] identifier[requestMethod] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parameters] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[queryString] operator[=] identifier[getQueryString] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] identifier[URL] identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] Keyword[this] operator[SEP] identifier[apiBaseUrl] operator[SEP] operator[SEP] identifier[HttpURLConnection] identifier[connection] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[WebResourceFetcherImpl] operator[SEP] identifier[getUrlConnection] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[setupConnection] operator[SEP] identifier[requestMethod] , identifier[queryString] , identifier[connection] operator[SEP] operator[SEP] identifier[OutputStreamWriter] identifier[writer] operator[=] Keyword[new] identifier[OutputStreamWriter] operator[SEP] identifier[connection] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[queryString] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[rc] operator[=] identifier[connection] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rc] operator[!=] Other[200] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[rc] operator[SEP] operator[SEP] } identifier[InputStream] identifier[iStream] operator[=] identifier[connection] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] identifier[fillCookies] operator[SEP] identifier[connection] operator[SEP] identifier[getHeaderFields] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[iStream] operator[SEP] }
public static <T, F> Function<F, T> memoize(final Function<F, T> function) { return new MemoizeFunction<F, T>() { @Override public T calc(F arg) { return function.apply(arg); } }; }
class class_name[name] begin[{] method[memoize, return_type[type[Function]], modifier[public static], parameter[function]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=function, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=calc, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg, type=ReferenceType(arguments=None, dimensions=[], name=F, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), 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=F, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=MemoizeFunction, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[F] operator[>] identifier[Function] operator[<] identifier[F] , identifier[T] operator[>] identifier[memoize] operator[SEP] Keyword[final] identifier[Function] operator[<] identifier[F] , identifier[T] operator[>] identifier[function] operator[SEP] { Keyword[return] Keyword[new] identifier[MemoizeFunction] operator[<] identifier[F] , identifier[T] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[calc] operator[SEP] identifier[F] identifier[arg] operator[SEP] { Keyword[return] identifier[function] operator[SEP] identifier[apply] operator[SEP] identifier[arg] operator[SEP] operator[SEP] } } operator[SEP] }
public Matrix solve (Matrix B) throws SingularityException { if (B.getRowCount() != m) { throw new IllegalArgumentException("Matrix row dimensions must agree."); } if (!this.isNonsingular()) { throw new SingularityException("Matrix is singular."); } // Copy right hand side with pivoting int nx = B.getColumnCount(); double[][] X = new double[piv.length][nx]; for (int i=0; i<piv.length; i++) { for (int j=0; j<nx; j++) { X[i][j]=B.getQuick(piv[i], j); } } // Solve L*Y = B(piv,:) for (int k = 0; k < n; k++) { for (int i = k+1; i < n; i++) { for (int j = 0; j < nx; j++) { X[i][j] -= X[k][j]*LU[i][k]; } } } // Solve U*X = Y; for (int k = n-1; k >= 0; k--) { for (int j = 0; j < nx; j++) { X[k][j] /= LU[k][k]; } for (int i = 0; i < k; i++) { for (int j = 0; j < nx; j++) { X[i][j] -= X[k][j]*LU[i][k]; } } } return MatrixFactory.createMatrix(X); }
class class_name[name] begin[{] method[solve, return_type[type[Matrix]], modifier[public], parameter[B]] begin[{] if[binary_operation[call[B.getRowCount, parameter[]], !=, member[.m]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Matrix row dimensions must agree.")], 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[THIS[call[None.isNonsingular, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Matrix is singular.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SingularityException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], nx] local_variable[type[double], X] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=X, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=piv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getQuick, postfix_operators=[], prefix_operators=[], qualifier=B, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nx, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), 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=piv, 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) ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=X, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=-=, value=BinaryOperation(operandl=MemberReference(member=X, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=LU, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nx, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, 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=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=X, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=/=, value=MemberReference(member=LU, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, 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=nx, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=X, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=-=, value=BinaryOperation(operandl=MemberReference(member=X, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=LU, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nx, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, 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)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[MatrixFactory.createMatrix, parameter[member[.X]]]] end[}] END[}]
Keyword[public] identifier[Matrix] identifier[solve] operator[SEP] identifier[Matrix] identifier[B] operator[SEP] Keyword[throws] identifier[SingularityException] { Keyword[if] operator[SEP] identifier[B] operator[SEP] identifier[getRowCount] operator[SEP] operator[SEP] operator[!=] identifier[m] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[isNonsingular] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[SingularityException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[nx] operator[=] identifier[B] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[X] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[piv] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[nx] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[piv] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[nx] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[X] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[B] operator[SEP] identifier[getQuick] operator[SEP] identifier[piv] operator[SEP] identifier[i] operator[SEP] , identifier[j] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[n] operator[SEP] identifier[k] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[k] operator[+] Other[1] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[nx] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[X] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[-=] identifier[X] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[*] identifier[LU] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[SEP] } } } Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] identifier[n] operator[-] Other[1] operator[SEP] identifier[k] operator[>=] Other[0] operator[SEP] identifier[k] operator[--] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[nx] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[X] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[/=] identifier[LU] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[k] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[nx] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[X] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[-=] identifier[X] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[*] identifier[LU] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[SEP] } } } Keyword[return] identifier[MatrixFactory] operator[SEP] identifier[createMatrix] operator[SEP] identifier[X] operator[SEP] operator[SEP] }
@Override public String getjcaResource() { final boolean trace = TraceComponent.isAnyTracingEnabled(); Collection<JCAResourceMBeanImpl> c = jcaMBeanRuntime.jcaResources.values(); Iterator<JCAResourceMBeanImpl> i = c.iterator(); String jcaResourceString = null; while (i.hasNext()) { JCAResourceMBeanImpl jcaResource = i.next(); String resourceAdapter = jcaResource.getResourceAdapter(); String s = jcaResource.getobjectName().toString(); if (trace && tc.isDebugEnabled()) Tr.debug(tc, "getjcaResource - ", s); //ResourceAdapter if (this.resourceAdapter.equals(resourceAdapter)) { // I believe we should only have one that matches, if we have more, its likely a bug. // A resource adapter should only have one jcaResource and a jca jcaResource can // have several connection factories. While debugging this code I see we have two // jcaResources for this resource adapter. jcaResourceString = s; } } return jcaResourceString; }
class class_name[name] begin[{] method[getjcaResource, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[boolean], trace] local_variable[type[Collection], c] local_variable[type[Iterator], i] local_variable[type[String], jcaResourceString] while[call[i.hasNext, parameter[]]] begin[{] local_variable[type[JCAResourceMBeanImpl], jcaResource] local_variable[type[String], resourceAdapter] local_variable[type[String], s] if[binary_operation[member[.trace], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["getjcaResource - "], member[.s]]] else begin[{] None end[}] if[THIS[member[None.resourceAdapter]call[None.equals, parameter[member[.resourceAdapter]]]]] begin[{] assign[member[.jcaResourceString], member[.s]] else begin[{] None end[}] end[}] return[member[.jcaResourceString]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getjcaResource] operator[SEP] operator[SEP] { Keyword[final] Keyword[boolean] identifier[trace] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[JCAResourceMBeanImpl] operator[>] identifier[c] operator[=] identifier[jcaMBeanRuntime] operator[SEP] identifier[jcaResources] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[JCAResourceMBeanImpl] operator[>] identifier[i] operator[=] identifier[c] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[jcaResourceString] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[JCAResourceMBeanImpl] identifier[jcaResource] operator[=] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[resourceAdapter] operator[=] identifier[jcaResource] operator[SEP] identifier[getResourceAdapter] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[s] operator[=] identifier[jcaResource] operator[SEP] identifier[getobjectName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] 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] , identifier[s] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[resourceAdapter] operator[SEP] identifier[equals] operator[SEP] identifier[resourceAdapter] operator[SEP] operator[SEP] { identifier[jcaResourceString] operator[=] identifier[s] operator[SEP] } } Keyword[return] identifier[jcaResourceString] operator[SEP] }
@Override protected void init() throws Exception { BootstrapContextImpl bootstrapContext = bootstrapContextRef.getServiceWithException(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "loading", mcfImplClassName); if (mcfImplClassName == null) // TODO: get the real config element name of the nested properties throw new IllegalArgumentException(Utils.getMessage("J2CA8504.incorrect.props.list", "properties", configElementName, id)); mcf = (ManagedConnectionFactory) bootstrapContext.loadClass(mcfImplClassName).newInstance(); bootstrapContext.configure(mcf, jndiName, properties, null, null, null); if (connectionManagerRef == null) conMgrSvc = ConnectionManagerService.createDefaultService(jndiName); else conMgrSvc = (ConnectionManagerService) priv.locateService(componentContext, CONNECTION_MANAGER); conMgrSvc.addObserver(this); isInitialized.set(true); conMgrSvc.addRaClassLoader(bootstrapContext.getRaClassLoader()); }
class class_name[name] begin[{] method[init, return_type[void], modifier[protected], parameter[]] begin[{] local_variable[type[BootstrapContextImpl], bootstrapContext] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[THIS[], member[.tc], literal["loading"], member[.mcfImplClassName]]] else begin[{] None end[}] if[binary_operation[member[.mcfImplClassName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="J2CA8504.incorrect.props.list"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="properties"), MemberReference(member=configElementName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None)], 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[member[.mcf], Cast(expression=MethodInvocation(arguments=[MemberReference(member=mcfImplClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=bootstrapContext, selectors=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ManagedConnectionFactory, sub_type=None))] call[bootstrapContext.configure, parameter[member[.mcf], member[.jndiName], member[.properties], literal[null], literal[null], literal[null]]] if[binary_operation[member[.connectionManagerRef], ==, literal[null]]] begin[{] assign[member[.conMgrSvc], call[ConnectionManagerService.createDefaultService, parameter[member[.jndiName]]]] else begin[{] assign[member[.conMgrSvc], Cast(expression=MethodInvocation(arguments=[MemberReference(member=componentContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=CONNECTION_MANAGER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=locateService, postfix_operators=[], prefix_operators=[], qualifier=priv, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ConnectionManagerService, sub_type=None))] end[}] call[conMgrSvc.addObserver, parameter[THIS[]]] call[isInitialized.set, parameter[literal[true]]] call[conMgrSvc.addRaClassLoader, parameter[call[bootstrapContext.getRaClassLoader, parameter[]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[init] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[BootstrapContextImpl] identifier[bootstrapContext] operator[=] identifier[bootstrapContextRef] operator[SEP] identifier[getServiceWithException] 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] Keyword[this] , identifier[tc] , literal[String] , identifier[mcfImplClassName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mcfImplClassName] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[Utils] operator[SEP] identifier[getMessage] operator[SEP] literal[String] , literal[String] , identifier[configElementName] , identifier[id] operator[SEP] operator[SEP] operator[SEP] identifier[mcf] operator[=] operator[SEP] identifier[ManagedConnectionFactory] operator[SEP] identifier[bootstrapContext] operator[SEP] identifier[loadClass] operator[SEP] identifier[mcfImplClassName] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[bootstrapContext] operator[SEP] identifier[configure] operator[SEP] identifier[mcf] , identifier[jndiName] , identifier[properties] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connectionManagerRef] operator[==] Other[null] operator[SEP] identifier[conMgrSvc] operator[=] identifier[ConnectionManagerService] operator[SEP] identifier[createDefaultService] operator[SEP] identifier[jndiName] operator[SEP] operator[SEP] Keyword[else] identifier[conMgrSvc] operator[=] operator[SEP] identifier[ConnectionManagerService] operator[SEP] identifier[priv] operator[SEP] identifier[locateService] operator[SEP] identifier[componentContext] , identifier[CONNECTION_MANAGER] operator[SEP] operator[SEP] identifier[conMgrSvc] operator[SEP] identifier[addObserver] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[isInitialized] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[conMgrSvc] operator[SEP] identifier[addRaClassLoader] operator[SEP] identifier[bootstrapContext] operator[SEP] identifier[getRaClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static JUnitCommandLineParseResult parse(String[] args) { JUnitCommandLineParseResult result = new JUnitCommandLineParseResult(); result.parseArgs(args); return result; }
class class_name[name] begin[{] method[parse, return_type[type[JUnitCommandLineParseResult]], modifier[public static], parameter[args]] begin[{] local_variable[type[JUnitCommandLineParseResult], result] call[result.parseArgs, parameter[member[.args]]] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[JUnitCommandLineParseResult] identifier[parse] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { identifier[JUnitCommandLineParseResult] identifier[result] operator[=] Keyword[new] identifier[JUnitCommandLineParseResult] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[parseArgs] operator[SEP] identifier[args] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static InetSocketAddress createWithResolveRetry( String hostname, int port, int delayMillis, int maxAttempt ) { InetSocketAddress socketAddress; int attempts = 0; do { socketAddress = new InetSocketAddress(hostname, port); // if dns failed, try one more time if (socketAddress.isUnresolved()) { attempts++; LOG.info(String.format( "failed to resolve host %s, attempt %d", hostname, attempts )); try { Thread.sleep(delayMillis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } else if (attempts > 0) { LOG.info( String.format("successful resolution on attempt %d", attempts) ); } } while (socketAddress.isUnresolved() && attempts < maxAttempt); return socketAddress; }
class class_name[name] begin[{] method[createWithResolveRetry, return_type[type[InetSocketAddress]], modifier[public static], parameter[hostname, port, delayMillis, maxAttempt]] begin[{] local_variable[type[InetSocketAddress], socketAddress] local_variable[type[int], attempts] do[binary_operation[call[socketAddress.isUnresolved, parameter[]], &&, binary_operation[member[.attempts], <, member[.maxAttempt]]]] begin[{] assign[member[.socketAddress], ClassCreator(arguments=[MemberReference(member=hostname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, 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=InetSocketAddress, sub_type=None))] if[call[socketAddress.isUnresolved, parameter[]]] begin[{] member[.attempts] call[LOG.info, parameter[call[String.format, parameter[literal["failed to resolve host %s, attempt %d"], member[.hostname], member[.attempts]]]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=delayMillis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) else begin[{] if[binary_operation[member[.attempts], >, literal[0]]] begin[{] call[LOG.info, parameter[call[String.format, parameter[literal["successful resolution on attempt %d"], member[.attempts]]]]] else begin[{] None end[}] end[}] end[}] return[member[.socketAddress]] end[}] END[}]
Keyword[public] Keyword[static] identifier[InetSocketAddress] identifier[createWithResolveRetry] operator[SEP] identifier[String] identifier[hostname] , Keyword[int] identifier[port] , Keyword[int] identifier[delayMillis] , Keyword[int] identifier[maxAttempt] operator[SEP] { identifier[InetSocketAddress] identifier[socketAddress] operator[SEP] Keyword[int] identifier[attempts] operator[=] Other[0] operator[SEP] Keyword[do] { identifier[socketAddress] operator[=] Keyword[new] identifier[InetSocketAddress] operator[SEP] identifier[hostname] , identifier[port] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[socketAddress] operator[SEP] identifier[isUnresolved] operator[SEP] operator[SEP] operator[SEP] { identifier[attempts] operator[++] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[hostname] , identifier[attempts] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] identifier[delayMillis] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[attempts] operator[>] Other[0] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[attempts] operator[SEP] operator[SEP] operator[SEP] } } Keyword[while] operator[SEP] identifier[socketAddress] operator[SEP] identifier[isUnresolved] operator[SEP] operator[SEP] operator[&&] identifier[attempts] operator[<] identifier[maxAttempt] operator[SEP] operator[SEP] Keyword[return] identifier[socketAddress] operator[SEP] }
public void write(final Object object, final String path) throws IOException { write(object, new File(path)); }
class class_name[name] begin[{] method[write, return_type[void], modifier[public], parameter[object, path]] begin[{] call[.write, parameter[member[.object], ClassCreator(arguments=[MemberReference(member=path, 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=File, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[write] operator[SEP] Keyword[final] identifier[Object] identifier[object] , Keyword[final] identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[IOException] { identifier[write] operator[SEP] identifier[object] , Keyword[new] identifier[File] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] }
public void receive(WSMessage message) { log.trace("receive message"); if (isConnected()) { WebSocketPlugin plugin = (WebSocketPlugin) PluginRegistry.getPlugin("WebSocketPlugin"); Optional<WebSocketScopeManager> optional = Optional.ofNullable((WebSocketScopeManager) session.getAttribute(Constants.MANAGER)); WebSocketScopeManager manager = optional.isPresent() ? optional.get() : plugin.getManager(path); WebSocketScope scope = manager.getScope(path); scope.onMessage(message); } else { log.warn("Not connected"); } }
class class_name[name] begin[{] method[receive, return_type[void], modifier[public], parameter[message]] begin[{] call[log.trace, parameter[literal["receive message"]]] if[call[.isConnected, parameter[]]] begin[{] local_variable[type[WebSocketPlugin], plugin] local_variable[type[Optional], optional] local_variable[type[WebSocketScopeManager], manager] local_variable[type[WebSocketScope], scope] call[scope.onMessage, parameter[member[.message]]] else begin[{] call[log.warn, parameter[literal["Not connected"]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[receive] operator[SEP] identifier[WSMessage] identifier[message] operator[SEP] { identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isConnected] operator[SEP] operator[SEP] operator[SEP] { identifier[WebSocketPlugin] identifier[plugin] operator[=] operator[SEP] identifier[WebSocketPlugin] operator[SEP] identifier[PluginRegistry] operator[SEP] identifier[getPlugin] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Optional] operator[<] identifier[WebSocketScopeManager] operator[>] identifier[optional] operator[=] identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] operator[SEP] identifier[WebSocketScopeManager] operator[SEP] identifier[session] operator[SEP] identifier[getAttribute] operator[SEP] identifier[Constants] operator[SEP] identifier[MANAGER] operator[SEP] operator[SEP] operator[SEP] identifier[WebSocketScopeManager] identifier[manager] operator[=] identifier[optional] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[?] identifier[optional] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[:] identifier[plugin] operator[SEP] identifier[getManager] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[WebSocketScope] identifier[scope] operator[=] identifier[manager] operator[SEP] identifier[getScope] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[scope] operator[SEP] identifier[onMessage] operator[SEP] identifier[message] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
private void obtainTextColor(@NonNull final TypedArray typedArray) { ColorStateList colorStateList = typedArray.getColorStateList(R.styleable.ActionPreference_android_textColor); if (colorStateList == null) { colorStateList = ContextCompat .getColorStateList(getContext(), R.color.action_preference_text_color); } setTextColor(colorStateList); }
class class_name[name] begin[{] method[obtainTextColor, return_type[void], modifier[private], parameter[typedArray]] begin[{] local_variable[type[ColorStateList], colorStateList] if[binary_operation[member[.colorStateList], ==, literal[null]]] begin[{] assign[member[.colorStateList], call[ContextCompat.getColorStateList, parameter[call[.getContext, parameter[]], member[R.color.action_preference_text_color]]]] else begin[{] None end[}] call[.setTextColor, parameter[member[.colorStateList]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[obtainTextColor] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[TypedArray] identifier[typedArray] operator[SEP] { identifier[ColorStateList] identifier[colorStateList] operator[=] identifier[typedArray] operator[SEP] identifier[getColorStateList] operator[SEP] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[ActionPreference_android_textColor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[colorStateList] operator[==] Other[null] operator[SEP] { identifier[colorStateList] operator[=] identifier[ContextCompat] operator[SEP] identifier[getColorStateList] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] , identifier[R] operator[SEP] identifier[color] operator[SEP] identifier[action_preference_text_color] operator[SEP] operator[SEP] } identifier[setTextColor] operator[SEP] identifier[colorStateList] operator[SEP] operator[SEP] }
public void requestState(long fileId, final FileCallback callback) { if (LOG) { Log.d(TAG, "Requesting state file #" + fileId); } Downloaded downloaded1 = downloaded.getValue(fileId); if (downloaded1 != null) { FileSystemReference reference = Storage.fileFromDescriptor(downloaded1.getDescriptor()); boolean isExist = reference.isExist(); int fileSize = reference.getSize(); if (isExist && fileSize == downloaded1.getFileSize()) { if (LOG) { Log.d(TAG, "- Downloaded"); } final FileSystemReference fileSystemReference = Storage.fileFromDescriptor(downloaded1.getDescriptor()); im.actor.runtime.Runtime.dispatch(() -> callback.onDownloaded(fileSystemReference)); return; } else { if (LOG) { Log.d(TAG, "- File is corrupted"); if (!isExist) { Log.d(TAG, "- File not found"); } if (fileSize != downloaded1.getFileSize()) { Log.d(TAG, "- Incorrect file size. Expected: " + downloaded1.getFileSize() + ", got: " + fileSize); } } downloaded.removeItem(downloaded1.getFileId()); } } final QueueItem queueItem = findItem(fileId); if (queueItem == null) { im.actor.runtime.Runtime.dispatch(() -> callback.onNotDownloaded()); } else { if (queueItem.isStarted) { final float progress = queueItem.progress; im.actor.runtime.Runtime.dispatch(() -> callback.onDownloading(progress)); } else if (queueItem.isStopped) { im.actor.runtime.Runtime.dispatch(() -> callback.onNotDownloaded()); } else { im.actor.runtime.Runtime.dispatch(() -> callback.onDownloading(0)); } } }
class class_name[name] begin[{] method[requestState, return_type[void], modifier[public], parameter[fileId, callback]] begin[{] if[member[.LOG]] begin[{] call[Log.d, parameter[member[.TAG], binary_operation[literal["Requesting state file #"], +, member[.fileId]]]] else begin[{] None end[}] local_variable[type[Downloaded], downloaded1] if[binary_operation[member[.downloaded1], !=, literal[null]]] begin[{] local_variable[type[FileSystemReference], reference] local_variable[type[boolean], isExist] local_variable[type[int], fileSize] if[binary_operation[member[.isExist], &&, binary_operation[member[.fileSize], ==, call[downloaded1.getFileSize, parameter[]]]]] begin[{] if[member[.LOG]] begin[{] call[Log.d, parameter[member[.TAG], literal["- Downloaded"]]] else begin[{] None end[}] local_variable[type[FileSystemReference], fileSystemReference] call[im.actor.runtime.Runtime.dispatch, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=fileSystemReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onDownloaded, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), parameters=[])]] return[None] else begin[{] if[member[.LOG]] begin[{] call[Log.d, parameter[member[.TAG], literal["- File is corrupted"]]] if[member[.isExist]] begin[{] call[Log.d, parameter[member[.TAG], literal["- File not found"]]] else begin[{] None end[}] if[binary_operation[member[.fileSize], !=, call[downloaded1.getFileSize, parameter[]]]] begin[{] call[Log.d, parameter[member[.TAG], binary_operation[binary_operation[binary_operation[literal["- Incorrect file size. Expected: "], +, call[downloaded1.getFileSize, parameter[]]], +, literal[", got: "]], +, member[.fileSize]]]] else begin[{] None end[}] else begin[{] None end[}] call[downloaded.removeItem, parameter[call[downloaded1.getFileId, parameter[]]]] end[}] else begin[{] None end[}] local_variable[type[QueueItem], queueItem] if[binary_operation[member[.queueItem], ==, literal[null]]] begin[{] call[im.actor.runtime.Runtime.dispatch, parameter[LambdaExpression(body=MethodInvocation(arguments=[], member=onNotDownloaded, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), parameters=[])]] else begin[{] if[member[queueItem.isStarted]] begin[{] local_variable[type[float], progress] call[im.actor.runtime.Runtime.dispatch, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=progress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onDownloading, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), parameters=[])]] else begin[{] if[member[queueItem.isStopped]] begin[{] call[im.actor.runtime.Runtime.dispatch, parameter[LambdaExpression(body=MethodInvocation(arguments=[], member=onNotDownloaded, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), parameters=[])]] else begin[{] call[im.actor.runtime.Runtime.dispatch, parameter[LambdaExpression(body=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=onDownloading, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), parameters=[])]] end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[requestState] operator[SEP] Keyword[long] identifier[fileId] , Keyword[final] identifier[FileCallback] identifier[callback] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] { identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[fileId] operator[SEP] operator[SEP] } identifier[Downloaded] identifier[downloaded1] operator[=] identifier[downloaded] operator[SEP] identifier[getValue] operator[SEP] identifier[fileId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[downloaded1] operator[!=] Other[null] operator[SEP] { identifier[FileSystemReference] identifier[reference] operator[=] identifier[Storage] operator[SEP] identifier[fileFromDescriptor] operator[SEP] identifier[downloaded1] operator[SEP] identifier[getDescriptor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isExist] operator[=] identifier[reference] operator[SEP] identifier[isExist] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[fileSize] operator[=] identifier[reference] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isExist] operator[&&] identifier[fileSize] operator[==] identifier[downloaded1] operator[SEP] identifier[getFileSize] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] { identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[FileSystemReference] identifier[fileSystemReference] operator[=] identifier[Storage] operator[SEP] identifier[fileFromDescriptor] operator[SEP] identifier[downloaded1] operator[SEP] identifier[getDescriptor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[im] operator[SEP] identifier[actor] operator[SEP] identifier[runtime] operator[SEP] identifier[Runtime] operator[SEP] identifier[dispatch] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[callback] operator[SEP] identifier[onDownloaded] operator[SEP] identifier[fileSystemReference] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] { identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isExist] operator[SEP] { identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[fileSize] operator[!=] identifier[downloaded1] operator[SEP] identifier[getFileSize] operator[SEP] operator[SEP] operator[SEP] { identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[downloaded1] operator[SEP] identifier[getFileSize] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[fileSize] operator[SEP] operator[SEP] } } identifier[downloaded] operator[SEP] identifier[removeItem] operator[SEP] identifier[downloaded1] operator[SEP] identifier[getFileId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[final] identifier[QueueItem] identifier[queueItem] operator[=] identifier[findItem] operator[SEP] identifier[fileId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[queueItem] operator[==] Other[null] operator[SEP] { identifier[im] operator[SEP] identifier[actor] operator[SEP] identifier[runtime] operator[SEP] identifier[Runtime] operator[SEP] identifier[dispatch] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[callback] operator[SEP] identifier[onNotDownloaded] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[queueItem] operator[SEP] identifier[isStarted] operator[SEP] { Keyword[final] Keyword[float] identifier[progress] operator[=] identifier[queueItem] operator[SEP] identifier[progress] operator[SEP] identifier[im] operator[SEP] identifier[actor] operator[SEP] identifier[runtime] operator[SEP] identifier[Runtime] operator[SEP] identifier[dispatch] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[callback] operator[SEP] identifier[onDownloading] operator[SEP] identifier[progress] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[queueItem] operator[SEP] identifier[isStopped] operator[SEP] { identifier[im] operator[SEP] identifier[actor] operator[SEP] identifier[runtime] operator[SEP] identifier[Runtime] operator[SEP] identifier[dispatch] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[callback] operator[SEP] identifier[onNotDownloaded] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[im] operator[SEP] identifier[actor] operator[SEP] identifier[runtime] operator[SEP] identifier[Runtime] operator[SEP] identifier[dispatch] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[callback] operator[SEP] identifier[onDownloading] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } } }
@Trivial private static boolean contains(String[] fileList, String fileName) { if (fileList != null) { for (String name : fileList) { if (name.equals(fileName)) { return true; } } } return false; }
class class_name[name] begin[{] method[contains, return_type[type[boolean]], modifier[private static], parameter[fileList, fileName]] begin[{] if[binary_operation[member[.fileList], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=name, 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=MemberReference(member=fileList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] return[literal[false]] end[}] END[}]
annotation[@] identifier[Trivial] Keyword[private] Keyword[static] Keyword[boolean] identifier[contains] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[fileList] , identifier[String] identifier[fileName] operator[SEP] { Keyword[if] operator[SEP] identifier[fileList] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] identifier[fileList] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
public static final String printPercent(Double value) { return value == null ? null : Double.toString(value.doubleValue() / 100.0); }
class class_name[name] begin[{] method[printPercent, return_type[type[String]], modifier[final public static], parameter[value]] begin[{] return[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=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100.0), operator=/)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] identifier[String] identifier[printPercent] operator[SEP] identifier[Double] identifier[value] operator[SEP] { Keyword[return] identifier[value] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[Double] operator[SEP] identifier[toString] operator[SEP] identifier[value] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[/] literal[Float] operator[SEP] operator[SEP] }
public static String addMethod(Method m) { if (methods == null) { methods = new HashMap<String, Method>(); } String hashCode = String.valueOf(m.hashCode()); if (!methods.containsKey(hashCode)) { methods.put(hashCode, m); } return String.valueOf(m.hashCode()); }
class class_name[name] begin[{] method[addMethod, return_type[type[String]], modifier[public static], parameter[m]] begin[{] if[binary_operation[member[.methods], ==, literal[null]]] begin[{] assign[member[.methods], 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=Method, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))] else begin[{] None end[}] local_variable[type[String], hashCode] if[call[methods.containsKey, parameter[member[.hashCode]]]] begin[{] call[methods.put, parameter[member[.hashCode], member[.m]]] else begin[{] None end[}] return[call[String.valueOf, parameter[call[m.hashCode, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[addMethod] operator[SEP] identifier[Method] identifier[m] operator[SEP] { Keyword[if] operator[SEP] identifier[methods] operator[==] Other[null] operator[SEP] { identifier[methods] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Method] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[hashCode] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[m] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[methods] operator[SEP] identifier[containsKey] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] { identifier[methods] operator[SEP] identifier[put] operator[SEP] identifier[hashCode] , identifier[m] operator[SEP] operator[SEP] } Keyword[return] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[m] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public List<Example> actionCells(Example row) { List<Example> checkRow = new ArrayList<Example>(); checkRow.add(row.at(0, 1)); return checkRow; }
class class_name[name] begin[{] method[actionCells, return_type[type[List]], modifier[public], parameter[row]] begin[{] local_variable[type[List], checkRow] call[checkRow.add, parameter[call[row.at, parameter[literal[0], literal[1]]]]] return[member[.checkRow]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Example] operator[>] identifier[actionCells] operator[SEP] identifier[Example] identifier[row] operator[SEP] { identifier[List] operator[<] identifier[Example] operator[>] identifier[checkRow] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Example] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[checkRow] operator[SEP] identifier[add] operator[SEP] identifier[row] operator[SEP] identifier[at] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[checkRow] operator[SEP] }
@Override public Table<AllocationStatus, Integer, Long> getAllocationStatistics() { Table<AllocationStatus, Integer, Long> table = HashBasedTable.create(); table.put(AllocationStatus.HOST, 0, zeroUseCounter.get()); for (Integer deviceId : configuration.getAvailableDevices()) { table.put(AllocationStatus.DEVICE, deviceId, getAllocatedDeviceMemory(deviceId)); } return table; }
class class_name[name] begin[{] method[getAllocationStatistics, return_type[type[Table]], modifier[public], parameter[]] begin[{] local_variable[type[Table], table] call[table.put, parameter[member[AllocationStatus.HOST], literal[0], call[zeroUseCounter.get, parameter[]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DEVICE, postfix_operators=[], prefix_operators=[], qualifier=AllocationStatus, selectors=[]), MemberReference(member=deviceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=deviceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAllocatedDeviceMemory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAvailableDevices, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=deviceId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None) return[member[.table]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Table] operator[<] identifier[AllocationStatus] , identifier[Integer] , identifier[Long] operator[>] identifier[getAllocationStatistics] operator[SEP] operator[SEP] { identifier[Table] operator[<] identifier[AllocationStatus] , identifier[Integer] , identifier[Long] operator[>] identifier[table] operator[=] identifier[HashBasedTable] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[table] operator[SEP] identifier[put] operator[SEP] identifier[AllocationStatus] operator[SEP] identifier[HOST] , Other[0] , identifier[zeroUseCounter] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[deviceId] operator[:] identifier[configuration] operator[SEP] identifier[getAvailableDevices] operator[SEP] operator[SEP] operator[SEP] { identifier[table] operator[SEP] identifier[put] operator[SEP] identifier[AllocationStatus] operator[SEP] identifier[DEVICE] , identifier[deviceId] , identifier[getAllocatedDeviceMemory] operator[SEP] identifier[deviceId] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[table] operator[SEP] }
@Override public CPMeasurementUnit fetchByG_K_T(long groupId, String key, int type, boolean retrieveFromCache) { Object[] finderArgs = new Object[] { groupId, key, type }; Object result = null; if (retrieveFromCache) { result = finderCache.getResult(FINDER_PATH_FETCH_BY_G_K_T, finderArgs, this); } if (result instanceof CPMeasurementUnit) { CPMeasurementUnit cpMeasurementUnit = (CPMeasurementUnit)result; if ((groupId != cpMeasurementUnit.getGroupId()) || !Objects.equals(key, cpMeasurementUnit.getKey()) || (type != cpMeasurementUnit.getType())) { result = null; } } if (result == null) { StringBundler query = new StringBundler(5); query.append(_SQL_SELECT_CPMEASUREMENTUNIT_WHERE); query.append(_FINDER_COLUMN_G_K_T_GROUPID_2); boolean bindKey = false; if (key == null) { query.append(_FINDER_COLUMN_G_K_T_KEY_1); } else if (key.equals("")) { query.append(_FINDER_COLUMN_G_K_T_KEY_3); } else { bindKey = true; query.append(_FINDER_COLUMN_G_K_T_KEY_2); } query.append(_FINDER_COLUMN_G_K_T_TYPE_2); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); if (bindKey) { qPos.add(StringUtil.toLowerCase(key)); } qPos.add(type); List<CPMeasurementUnit> list = q.list(); if (list.isEmpty()) { finderCache.putResult(FINDER_PATH_FETCH_BY_G_K_T, finderArgs, list); } else { CPMeasurementUnit cpMeasurementUnit = list.get(0); result = cpMeasurementUnit; cacheResult(cpMeasurementUnit); } } catch (Exception e) { finderCache.removeResult(FINDER_PATH_FETCH_BY_G_K_T, finderArgs); throw processException(e); } finally { closeSession(session); } } if (result instanceof List<?>) { return null; } else { return (CPMeasurementUnit)result; } }
class class_name[name] begin[{] method[fetchByG_K_T, return_type[type[CPMeasurementUnit]], modifier[public], parameter[groupId, key, type, retrieveFromCache]] begin[{] local_variable[type[Object], finderArgs] local_variable[type[Object], result] if[member[.retrieveFromCache]] begin[{] assign[member[.result], call[finderCache.getResult, parameter[member[.FINDER_PATH_FETCH_BY_G_K_T], member[.finderArgs], THIS[]]]] else begin[{] None end[}] if[binary_operation[member[.result], instanceof, type[CPMeasurementUnit]]] begin[{] local_variable[type[CPMeasurementUnit], cpMeasurementUnit] if[binary_operation[binary_operation[binary_operation[member[.groupId], !=, call[cpMeasurementUnit.getGroupId, parameter[]]], ||, call[Objects.equals, parameter[member[.key], call[cpMeasurementUnit.getKey, parameter[]]]]], ||, binary_operation[member[.type], !=, call[cpMeasurementUnit.getType, parameter[]]]]] begin[{] assign[member[.result], literal[null]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.result], ==, literal[null]]] begin[{] local_variable[type[StringBundler], query] call[query.append, parameter[member[._SQL_SELECT_CPMEASUREMENTUNIT_WHERE]]] call[query.append, parameter[member[._FINDER_COLUMN_G_K_T_GROUPID_2]]] local_variable[type[boolean], bindKey] if[binary_operation[member[.key], ==, literal[null]]] begin[{] call[query.append, parameter[member[._FINDER_COLUMN_G_K_T_KEY_1]]] else begin[{] if[call[key.equals, parameter[literal[""]]]] begin[{] call[query.append, parameter[member[._FINDER_COLUMN_G_K_T_KEY_3]]] else begin[{] assign[member[.bindKey], literal[true]] call[query.append, parameter[member[._FINDER_COLUMN_G_K_T_KEY_2]]] end[}] end[}] call[query.append, parameter[member[._FINDER_COLUMN_G_K_T_TYPE_2]]] local_variable[type[String], sql] local_variable[type[Session], session] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createQuery, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), name=q)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Query, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=QueryPos, selectors=[], type_arguments=None), name=qPos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryPos, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=qPos, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=bindKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=qPos, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=qPos, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=list, postfix_operators=[], prefix_operators=[], qualifier=q, selectors=[], type_arguments=None), name=list)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CPMeasurementUnit, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), name=cpMeasurementUnit)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CPMeasurementUnit, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=cpMeasurementUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cpMeasurementUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cacheResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINDER_PATH_FETCH_BY_G_K_T, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=finderArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putResult, postfix_operators=[], prefix_operators=[], qualifier=finderCache, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINDER_PATH_FETCH_BY_G_K_T, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=finderArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeResult, postfix_operators=[], prefix_operators=[], qualifier=finderCache, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] if[binary_operation[member[.result], instanceof, type[List]]] begin[{] return[literal[null]] else begin[{] return[Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CPMeasurementUnit, sub_type=None))] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CPMeasurementUnit] identifier[fetchByG_K_T] operator[SEP] Keyword[long] identifier[groupId] , identifier[String] identifier[key] , Keyword[int] identifier[type] , Keyword[boolean] identifier[retrieveFromCache] operator[SEP] { identifier[Object] operator[SEP] operator[SEP] identifier[finderArgs] operator[=] Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[groupId] , identifier[key] , identifier[type] } operator[SEP] identifier[Object] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[retrieveFromCache] operator[SEP] { identifier[result] operator[=] identifier[finderCache] operator[SEP] identifier[getResult] operator[SEP] identifier[FINDER_PATH_FETCH_BY_G_K_T] , identifier[finderArgs] , Keyword[this] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[result] Keyword[instanceof] identifier[CPMeasurementUnit] operator[SEP] { identifier[CPMeasurementUnit] identifier[cpMeasurementUnit] operator[=] operator[SEP] identifier[CPMeasurementUnit] operator[SEP] identifier[result] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[groupId] operator[!=] identifier[cpMeasurementUnit] operator[SEP] identifier[getGroupId] operator[SEP] operator[SEP] operator[SEP] operator[||] operator[!] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[key] , identifier[cpMeasurementUnit] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[type] operator[!=] identifier[cpMeasurementUnit] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[=] Other[null] operator[SEP] } } Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] { identifier[StringBundler] identifier[query] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[5] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[append] operator[SEP] identifier[_SQL_SELECT_CPMEASUREMENTUNIT_WHERE] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[append] operator[SEP] identifier[_FINDER_COLUMN_G_K_T_GROUPID_2] operator[SEP] operator[SEP] Keyword[boolean] identifier[bindKey] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] { identifier[query] operator[SEP] identifier[append] operator[SEP] identifier[_FINDER_COLUMN_G_K_T_KEY_1] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[query] operator[SEP] identifier[append] operator[SEP] identifier[_FINDER_COLUMN_G_K_T_KEY_3] operator[SEP] operator[SEP] } Keyword[else] { identifier[bindKey] operator[=] literal[boolean] operator[SEP] identifier[query] operator[SEP] identifier[append] operator[SEP] identifier[_FINDER_COLUMN_G_K_T_KEY_2] operator[SEP] operator[SEP] } identifier[query] operator[SEP] identifier[append] operator[SEP] identifier[_FINDER_COLUMN_G_K_T_TYPE_2] operator[SEP] operator[SEP] identifier[String] identifier[sql] operator[=] identifier[query] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[Session] identifier[session] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[session] operator[=] identifier[openSession] operator[SEP] operator[SEP] operator[SEP] identifier[Query] identifier[q] operator[=] identifier[session] operator[SEP] identifier[createQuery] operator[SEP] identifier[sql] operator[SEP] operator[SEP] identifier[QueryPos] identifier[qPos] operator[=] identifier[QueryPos] operator[SEP] identifier[getInstance] operator[SEP] identifier[q] operator[SEP] operator[SEP] identifier[qPos] operator[SEP] identifier[add] operator[SEP] identifier[groupId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bindKey] operator[SEP] { identifier[qPos] operator[SEP] identifier[add] operator[SEP] identifier[StringUtil] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] } identifier[qPos] operator[SEP] identifier[add] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CPMeasurementUnit] operator[>] identifier[list] operator[=] identifier[q] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[finderCache] operator[SEP] identifier[putResult] operator[SEP] identifier[FINDER_PATH_FETCH_BY_G_K_T] , identifier[finderArgs] , identifier[list] operator[SEP] operator[SEP] } Keyword[else] { identifier[CPMeasurementUnit] identifier[cpMeasurementUnit] operator[=] identifier[list] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[cpMeasurementUnit] operator[SEP] identifier[cacheResult] operator[SEP] identifier[cpMeasurementUnit] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[finderCache] operator[SEP] identifier[removeResult] operator[SEP] identifier[FINDER_PATH_FETCH_BY_G_K_T] , identifier[finderArgs] operator[SEP] operator[SEP] Keyword[throw] identifier[processException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeSession] operator[SEP] identifier[session] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[result] Keyword[instanceof] identifier[List] operator[<] operator[?] operator[>] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[return] operator[SEP] identifier[CPMeasurementUnit] operator[SEP] identifier[result] operator[SEP] } }
private static Templates initTemplates() { try { URL xsltURL = ThemeUtil.class.getResource(RESOURCE_NAME); if (xsltURL != null) { Source xsltSource = new StreamSource(xsltURL.openStream(), xsltURL.toExternalForm()); TransformerFactory factory = new net.sf.saxon.TransformerFactoryImpl(); Templates templates = factory.newTemplates(xsltSource); LOG.debug("Generated XSLT templates for: " + RESOURCE_NAME); return templates; } else { // Server-side XSLT enabled but theme resource not on classpath. throw new IllegalStateException(RESOURCE_NAME + " not on classpath"); } } catch (IOException | TransformerConfigurationException ex) { throw new SystemException("Could not create transformer for " + RESOURCE_NAME, ex); } }
class class_name[name] begin[{] method[initTemplates, return_type[type[Templates]], modifier[private static], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=RESOURCE_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ThemeUtil, sub_type=None)), name=xsltURL)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=xsltURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=RESOURCE_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not on classpath"), operator=+)], 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, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=openStream, postfix_operators=[], prefix_operators=[], qualifier=xsltURL, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=toExternalForm, postfix_operators=[], prefix_operators=[], qualifier=xsltURL, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StreamSource, sub_type=None)), name=xsltSource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Source, sub_type=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=net, sub_type=ReferenceType(arguments=None, dimensions=None, name=sf, sub_type=ReferenceType(arguments=None, dimensions=None, name=saxon, sub_type=ReferenceType(arguments=None, dimensions=None, name=TransformerFactoryImpl, sub_type=None))))), name=factory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransformerFactory, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=xsltSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newTemplates, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None), name=templates)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Templates, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Generated XSLT templates for: "), operandr=MemberReference(member=RESOURCE_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=templates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not create transformer for "), operandr=MemberReference(member=RESOURCE_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), 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=SystemException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException', 'TransformerConfigurationException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[Templates] identifier[initTemplates] operator[SEP] operator[SEP] { Keyword[try] { identifier[URL] identifier[xsltURL] operator[=] identifier[ThemeUtil] operator[SEP] Keyword[class] operator[SEP] identifier[getResource] operator[SEP] identifier[RESOURCE_NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xsltURL] operator[!=] Other[null] operator[SEP] { identifier[Source] identifier[xsltSource] operator[=] Keyword[new] identifier[StreamSource] operator[SEP] identifier[xsltURL] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] , identifier[xsltURL] operator[SEP] identifier[toExternalForm] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[TransformerFactory] identifier[factory] operator[=] Keyword[new] identifier[net] operator[SEP] identifier[sf] operator[SEP] identifier[saxon] operator[SEP] identifier[TransformerFactoryImpl] operator[SEP] operator[SEP] operator[SEP] identifier[Templates] identifier[templates] operator[=] identifier[factory] operator[SEP] identifier[newTemplates] operator[SEP] identifier[xsltSource] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[RESOURCE_NAME] operator[SEP] operator[SEP] Keyword[return] identifier[templates] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[RESOURCE_NAME] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] operator[|] identifier[TransformerConfigurationException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[SystemException] operator[SEP] literal[String] operator[+] identifier[RESOURCE_NAME] , identifier[ex] operator[SEP] operator[SEP] } }
public MisplacedClassProcessor getProcessorForName(String name) { if (name == null) { return getDefaultProcessor(); } switch (Strategy.valueOf(name.toUpperCase())) { case FATAL: return new FatalMisplacedClassProcessor(); case MOVE: return new MoveMisplacedClassProcessor(); case OMIT: return new OmitMisplacedClassProcessor(); case SKIP: return new SkipMisplacedClassProcessor(); } throw new IllegalArgumentException("Unrecognized strategy name \"" + name + "\"."); }
class class_name[name] begin[{] method[getProcessorForName, return_type[type[MisplacedClassProcessor]], modifier[public], parameter[name]] begin[{] if[binary_operation[member[.name], ==, literal[null]]] begin[{] return[call[.getDefaultProcessor, parameter[]]] else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=['FATAL'], statements=[ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FatalMisplacedClassProcessor, sub_type=None)), label=None)]), SwitchStatementCase(case=['MOVE'], statements=[ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MoveMisplacedClassProcessor, sub_type=None)), label=None)]), SwitchStatementCase(case=['OMIT'], statements=[ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OmitMisplacedClassProcessor, sub_type=None)), label=None)]), SwitchStatementCase(case=['SKIP'], statements=[ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SkipMisplacedClassProcessor, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Strategy, selectors=[], type_arguments=None), label=None) ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecognized strategy name \""), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] identifier[MisplacedClassProcessor] identifier[getProcessorForName] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[getDefaultProcessor] operator[SEP] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[Strategy] operator[SEP] identifier[valueOf] operator[SEP] identifier[name] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[FATAL] operator[:] Keyword[return] Keyword[new] identifier[FatalMisplacedClassProcessor] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[MOVE] operator[:] Keyword[return] Keyword[new] identifier[MoveMisplacedClassProcessor] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[OMIT] operator[:] Keyword[return] Keyword[new] identifier[OmitMisplacedClassProcessor] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[SKIP] operator[:] Keyword[return] Keyword[new] identifier[SkipMisplacedClassProcessor] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] }
public void setRoleMembership(String subject, Set<String> roles) { validateStringValue(subject); Validate.notNull(roles); if(roles.isEmpty()) return; Validate.noNullElements(roles); props.setProperty(String.format(ROLE_MEMBERSHIP_FORMAT, subject), ArrayUtils.toString(encapsulateValues(roles))); }
class class_name[name] begin[{] method[setRoleMembership, return_type[void], modifier[public], parameter[subject, roles]] begin[{] call[.validateStringValue, parameter[member[.subject]]] call[Validate.notNull, parameter[member[.roles]]] if[call[roles.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] call[Validate.noNullElements, parameter[member[.roles]]] call[props.setProperty, parameter[call[String.format, parameter[member[.ROLE_MEMBERSHIP_FORMAT], member[.subject]]], call[ArrayUtils.toString, parameter[call[.encapsulateValues, parameter[member[.roles]]]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setRoleMembership] operator[SEP] identifier[String] identifier[subject] , identifier[Set] operator[<] identifier[String] operator[>] identifier[roles] operator[SEP] { identifier[validateStringValue] operator[SEP] identifier[subject] operator[SEP] operator[SEP] identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[roles] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[roles] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Validate] operator[SEP] identifier[noNullElements] operator[SEP] identifier[roles] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[setProperty] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[ROLE_MEMBERSHIP_FORMAT] , identifier[subject] operator[SEP] , identifier[ArrayUtils] operator[SEP] identifier[toString] operator[SEP] identifier[encapsulateValues] operator[SEP] identifier[roles] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public synchronized QueryBatcher withForestConfig(ForestConfiguration forestConfig) { super.withForestConfig(forestConfig); Forest[] forests = forestConfig.listForests(); Set<Forest> oldForests = new HashSet<>(forestResults.keySet()); Map<String,Forest> hosts = new HashMap<>(); for ( Forest forest : forests ) { if ( forest.getPreferredHost() == null ) throw new IllegalStateException("Hostname must not be null for any forest"); hosts.put(forest.getPreferredHost(), forest); if ( forestResults.get(forest) == null ) forestResults.put(forest, new AtomicLong()); if ( forestIsDone.get(forest) == null ) forestIsDone.put(forest, new AtomicBoolean(false)); if ( retryForestMap.get(forest) == null ) retryForestMap.put(forest, new AtomicInteger(0)); } logger.info("(withForestConfig) Using forests on {} hosts for \"{}\"", hosts.keySet(), forests[0].getDatabaseName()); List<DatabaseClient> newClientList = new ArrayList<>(); for ( String host : hosts.keySet() ) { Forest forest = hosts.get(host); DatabaseClient client = getMoveMgr().getForestClient(forest); newClientList.add(client); } clientList.set(newClientList); boolean started = (threadPool != null); if ( started == true && oldForests.size() > 0 ) calucluateDeltas(oldForests, forests); return this; }
class class_name[name] begin[{] method[withForestConfig, return_type[type[QueryBatcher]], modifier[synchronized public], parameter[forestConfig]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=forestConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withForestConfig, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) local_variable[type[Forest], forests] local_variable[type[Set], oldForests] local_variable[type[Map], hosts] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPreferredHost, postfix_operators=[], prefix_operators=[], qualifier=forest, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Hostname must not be null for any forest")], 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)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPreferredHost, postfix_operators=[], prefix_operators=[], qualifier=forest, selectors=[], type_arguments=None), MemberReference(member=forest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=hosts, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=forest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=forestResults, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=forest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AtomicLong, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=forestResults, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=forest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=forestIsDone, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=forest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AtomicBoolean, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=forestIsDone, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=forest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=retryForestMap, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=forest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AtomicInteger, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=retryForestMap, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=forests, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=forest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Forest, sub_type=None))), label=None) call[logger.info, parameter[literal["(withForestConfig) Using forests on {} hosts for \"{}\""], call[hosts.keySet, parameter[]], member[.forests]]] local_variable[type[List], newClientList] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=hosts, selectors=[], type_arguments=None), name=forest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Forest, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMoveMgr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=forest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getForestClient, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=client)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DatabaseClient, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=newClientList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=hosts, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=host)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[clientList.set, parameter[member[.newClientList]]] local_variable[type[boolean], started] if[binary_operation[binary_operation[member[.started], ==, literal[true]], &&, binary_operation[call[oldForests.size, parameter[]], >, literal[0]]]] begin[{] call[.calucluateDeltas, parameter[member[.oldForests], member[.forests]]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] identifier[QueryBatcher] identifier[withForestConfig] operator[SEP] identifier[ForestConfiguration] identifier[forestConfig] operator[SEP] { Keyword[super] operator[SEP] identifier[withForestConfig] operator[SEP] identifier[forestConfig] operator[SEP] operator[SEP] identifier[Forest] operator[SEP] operator[SEP] identifier[forests] operator[=] identifier[forestConfig] operator[SEP] identifier[listForests] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Forest] operator[>] identifier[oldForests] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] identifier[forestResults] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Forest] operator[>] identifier[hosts] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Forest] identifier[forest] operator[:] identifier[forests] operator[SEP] { Keyword[if] operator[SEP] identifier[forest] operator[SEP] identifier[getPreferredHost] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[hosts] operator[SEP] identifier[put] operator[SEP] identifier[forest] operator[SEP] identifier[getPreferredHost] operator[SEP] operator[SEP] , identifier[forest] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[forestResults] operator[SEP] identifier[get] operator[SEP] identifier[forest] operator[SEP] operator[==] Other[null] operator[SEP] identifier[forestResults] operator[SEP] identifier[put] operator[SEP] identifier[forest] , Keyword[new] identifier[AtomicLong] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[forestIsDone] operator[SEP] identifier[get] operator[SEP] identifier[forest] operator[SEP] operator[==] Other[null] operator[SEP] identifier[forestIsDone] operator[SEP] identifier[put] operator[SEP] identifier[forest] , Keyword[new] identifier[AtomicBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[retryForestMap] operator[SEP] identifier[get] operator[SEP] identifier[forest] operator[SEP] operator[==] Other[null] operator[SEP] identifier[retryForestMap] operator[SEP] identifier[put] operator[SEP] identifier[forest] , Keyword[new] identifier[AtomicInteger] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[hosts] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] , identifier[forests] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getDatabaseName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[DatabaseClient] operator[>] identifier[newClientList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[host] operator[:] identifier[hosts] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Forest] identifier[forest] operator[=] identifier[hosts] operator[SEP] identifier[get] operator[SEP] identifier[host] operator[SEP] operator[SEP] identifier[DatabaseClient] identifier[client] operator[=] identifier[getMoveMgr] operator[SEP] operator[SEP] operator[SEP] identifier[getForestClient] operator[SEP] identifier[forest] operator[SEP] operator[SEP] identifier[newClientList] operator[SEP] identifier[add] operator[SEP] identifier[client] operator[SEP] operator[SEP] } identifier[clientList] operator[SEP] identifier[set] operator[SEP] identifier[newClientList] operator[SEP] operator[SEP] Keyword[boolean] identifier[started] operator[=] operator[SEP] identifier[threadPool] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[started] operator[==] literal[boolean] operator[&&] identifier[oldForests] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] identifier[calucluateDeltas] operator[SEP] identifier[oldForests] , identifier[forests] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void setInHeader(boolean inHeader) { super.setInHeader(inHeader); for(int i = 0; i < this.items.size(); i++) { ((RtfBasicElement) this.items.get(i)).setInHeader(inHeader); } }
class class_name[name] begin[{] method[setInHeader, return_type[void], modifier[public], parameter[inHeader]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=inHeader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInHeader, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=items, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=RtfBasicElement, sub_type=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=items, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=size, 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=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setInHeader] operator[SEP] Keyword[boolean] identifier[inHeader] operator[SEP] { Keyword[super] operator[SEP] identifier[setInHeader] operator[SEP] identifier[inHeader] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[items] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { operator[SEP] operator[SEP] identifier[RtfBasicElement] operator[SEP] Keyword[this] operator[SEP] identifier[items] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[setInHeader] operator[SEP] identifier[inHeader] operator[SEP] operator[SEP] } }
@Override public String requestDepositAddress(Currency currency, String... arguments) throws IOException { CryptonitDepositAddress response = null; throw new NotYetImplementedForExchangeException(); // return response.getDepositAddress(); }
class class_name[name] begin[{] method[requestDepositAddress, return_type[type[String]], modifier[public], parameter[currency, arguments]] begin[{] local_variable[type[CryptonitDepositAddress], response] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NotYetImplementedForExchangeException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[requestDepositAddress] operator[SEP] identifier[Currency] identifier[currency] , identifier[String] operator[...] identifier[arguments] operator[SEP] Keyword[throws] identifier[IOException] { identifier[CryptonitDepositAddress] identifier[response] operator[=] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NotYetImplementedForExchangeException] operator[SEP] operator[SEP] operator[SEP] }
public static <A, B> Map<A, B> fromLists(List<A> keys, List<B> values) { Preconditions.checkArgument(keys.size() == values.size()); Map<A, B> map = Maps.newHashMap(); for (int i = 0; i < keys.size(); i++) { map.put(keys.get(i), values.get(i)); } return map; }
class class_name[name] begin[{] method[fromLists, return_type[type[Map]], modifier[public static], parameter[keys, values]] begin[{] call[Preconditions.checkArgument, parameter[binary_operation[call[keys.size, parameter[]], ==, call[values.size, parameter[]]]]] local_variable[type[Map], map] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), 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[.map]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[A] , identifier[B] operator[>] identifier[Map] operator[<] identifier[A] , identifier[B] operator[>] identifier[fromLists] operator[SEP] identifier[List] operator[<] identifier[A] operator[>] identifier[keys] , identifier[List] operator[<] identifier[B] operator[>] identifier[values] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[keys] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[A] , identifier[B] operator[>] identifier[map] operator[=] identifier[Maps] operator[SEP] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[keys] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[keys] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[values] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[map] operator[SEP] }
public AptEventSet getEventSet(String name) { for (AptEventSet eventSet: getEventSets()) if (eventSet.getClassName().equals(name)) return eventSet; if (_superClass != null) return _superClass.getEventSet(name); return null; }
class class_name[name] begin[{] method[getEventSet, return_type[type[AptEventSet]], modifier[public], parameter[name]] begin[{] ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=eventSet, selectors=[MethodInvocation(arguments=[MemberReference(member=name, 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=MemberReference(member=eventSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getEventSets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=eventSet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AptEventSet, sub_type=None))), label=None) if[binary_operation[member[._superClass], !=, literal[null]]] begin[{] return[call[_superClass.getEventSet, parameter[member[.name]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[AptEventSet] identifier[getEventSet] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[for] operator[SEP] identifier[AptEventSet] identifier[eventSet] operator[:] identifier[getEventSets] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eventSet] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[eventSet] operator[SEP] Keyword[if] operator[SEP] identifier[_superClass] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[_superClass] operator[SEP] identifier[getEventSet] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
private void writeMap(String fieldName, Object value) throws IOException { @SuppressWarnings("unchecked") Map<String, Object> map = (Map<String, Object>) value; m_writer.writeStartObject(fieldName); for (Map.Entry<String, Object> entry : map.entrySet()) { Object entryValue = entry.getValue(); if (entryValue != null) { DataType type = TYPE_MAP.get(entryValue.getClass().getName()); if (type == null) { type = DataType.STRING; entryValue = entryValue.toString(); } writeField(entry.getKey(), type, entryValue); } } m_writer.writeEndObject(); }
class class_name[name] begin[{] method[writeMap, return_type[void], modifier[private], parameter[fieldName, value]] begin[{] local_variable[type[Map], map] call[m_writer.writeStartObject, parameter[member[.fieldName]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=entryValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=entryValue, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=entryValue, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=TYPE_MAP, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, 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=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STRING, postfix_operators=[], prefix_operators=[], qualifier=DataType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=entryValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=entryValue, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=entryValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeField, postfix_operators=[], prefix_operators=[], qualifier=, 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=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=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) call[m_writer.writeEndObject, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[writeMap] operator[SEP] identifier[String] identifier[fieldName] , identifier[Object] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[map] operator[=] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[value] operator[SEP] identifier[m_writer] operator[SEP] identifier[writeStartObject] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[entryValue] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entryValue] operator[!=] Other[null] operator[SEP] { identifier[DataType] identifier[type] operator[=] identifier[TYPE_MAP] operator[SEP] identifier[get] operator[SEP] identifier[entryValue] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] { identifier[type] operator[=] identifier[DataType] operator[SEP] identifier[STRING] operator[SEP] identifier[entryValue] operator[=] identifier[entryValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } identifier[writeField] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[type] , identifier[entryValue] operator[SEP] operator[SEP] } } identifier[m_writer] operator[SEP] identifier[writeEndObject] operator[SEP] operator[SEP] operator[SEP] }
public static long parseLong (@Nullable final String sStr, @Nonnegative final int nRadix, final long nDefault) { if (sStr != null && sStr.length () > 0) try { return Long.parseLong (sStr, nRadix); } catch (final NumberFormatException ex) { // Fall through } return nDefault; }
class class_name[name] begin[{] method[parseLong, return_type[type[long]], modifier[public static], parameter[sStr, nRadix, nDefault]] begin[{] if[binary_operation[binary_operation[member[.sStr], !=, literal[null]], &&, binary_operation[call[sStr.length, parameter[]], >, literal[0]]]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=sStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nRadix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.nDefault]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[long] identifier[parseLong] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[sStr] , annotation[@] identifier[Nonnegative] Keyword[final] Keyword[int] identifier[nRadix] , Keyword[final] Keyword[long] identifier[nDefault] operator[SEP] { Keyword[if] operator[SEP] identifier[sStr] operator[!=] Other[null] operator[&&] identifier[sStr] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] Keyword[try] { Keyword[return] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[sStr] , identifier[nRadix] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[NumberFormatException] identifier[ex] operator[SEP] { } Keyword[return] identifier[nDefault] operator[SEP] }
public static Map<String, List<ExtensionElement>> getExtensionElements(DelegateExecution execution) { if (isExecutingExecutionListener(execution)) { return getListenerExtensionElements(execution); } else { return getFlowElementExtensionElements(execution); } }
class class_name[name] begin[{] method[getExtensionElements, return_type[type[Map]], modifier[public static], parameter[execution]] begin[{] if[call[.isExecutingExecutionListener, parameter[member[.execution]]]] begin[{] return[call[.getListenerExtensionElements, parameter[member[.execution]]]] else begin[{] return[call[.getFlowElementExtensionElements, parameter[member[.execution]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[ExtensionElement] operator[>] operator[>] identifier[getExtensionElements] operator[SEP] identifier[DelegateExecution] identifier[execution] operator[SEP] { Keyword[if] operator[SEP] identifier[isExecutingExecutionListener] operator[SEP] identifier[execution] operator[SEP] operator[SEP] { Keyword[return] identifier[getListenerExtensionElements] operator[SEP] identifier[execution] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[getFlowElementExtensionElements] operator[SEP] identifier[execution] operator[SEP] operator[SEP] } }
static public CoordinateTransform makeCoordinateTransform (NetcdfDataset ds, AttributeContainer ctv, Formatter parseInfo, Formatter errInfo) { // standard name String transform_name = ctv.findAttValueIgnoreCase("transform_name", null); if (null == transform_name) transform_name = ctv.findAttValueIgnoreCase("Projection_Name", null); // these names are from CF - dont want to have to duplicate if (null == transform_name) transform_name = ctv.findAttValueIgnoreCase(CF.GRID_MAPPING_NAME, null); if (null == transform_name) transform_name = ctv.findAttValueIgnoreCase(CF.STANDARD_NAME, null); if (null == transform_name) { parseInfo.format("**Failed to find Coordinate Transform name from Variable= %s%n", ctv); return null; } transform_name = transform_name.trim(); // do we have a transform registered for this ? Class builderClass = null; for (Transform transform : transformList) { if (transform.transName.equals(transform_name)) { builderClass = transform.transClass; break; } } if (null == builderClass) { parseInfo.format("**Failed to find CoordTransBuilder name= %s from Variable= %s%n", transform_name, ctv); return null; } // get an instance of that class Object builderObject; try { builderObject = builderClass.newInstance(); } catch (InstantiationException | IllegalAccessException e) { log.error("Cant create new instance "+builderClass.getName(), e); return null; } if (null == builderObject) { // cant happen - because this was tested in registerTransform() parseInfo.format("**Failed to build CoordTransBuilder object from class= %s for Variable= %s%n", builderClass.getName(), ctv); return null; } CoordinateTransform ct; if (builderObject instanceof VertTransformBuilderIF){ VertTransformBuilderIF vertBuilder = (VertTransformBuilderIF) builderObject; vertBuilder.setErrorBuffer(errInfo); ct = vertBuilder.makeCoordinateTransform(ds, ctv); } else if (builderObject instanceof HorizTransformBuilderIF){ HorizTransformBuilderIF horizBuilder = (HorizTransformBuilderIF) builderObject; horizBuilder.setErrorBuffer(errInfo); String units = AbstractTransformBuilder.getGeoCoordinateUnits(ds, ctv); // barfola ct = horizBuilder.makeCoordinateTransform(ctv, units); } else { log.error("Illegals class "+builderClass.getName()); return null; } if (ct != null) { parseInfo.format(" Made Coordinate transform %s from variable %s: %s%n", transform_name, ctv.getName(), builderObject.getClass().getName()); } return ct; }
class class_name[name] begin[{] method[makeCoordinateTransform, return_type[type[CoordinateTransform]], modifier[public static], parameter[ds, ctv, parseInfo, errInfo]] begin[{] local_variable[type[String], transform_name] if[binary_operation[literal[null], ==, member[.transform_name]]] begin[{] assign[member[.transform_name], call[ctv.findAttValueIgnoreCase, parameter[literal["Projection_Name"], literal[null]]]] else begin[{] None end[}] if[binary_operation[literal[null], ==, member[.transform_name]]] begin[{] assign[member[.transform_name], call[ctv.findAttValueIgnoreCase, parameter[member[CF.GRID_MAPPING_NAME], literal[null]]]] else begin[{] None end[}] if[binary_operation[literal[null], ==, member[.transform_name]]] begin[{] assign[member[.transform_name], call[ctv.findAttValueIgnoreCase, parameter[member[CF.STANDARD_NAME], literal[null]]]] else begin[{] None end[}] if[binary_operation[literal[null], ==, member[.transform_name]]] begin[{] call[parseInfo.format, parameter[literal["**Failed to find Coordinate Transform name from Variable= %s%n"], member[.ctv]]] return[literal[null]] else begin[{] None end[}] assign[member[.transform_name], call[transform_name.trim, parameter[]]] local_variable[type[Class], builderClass] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=transform_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=transform.transName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=builderClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=transClass, postfix_operators=[], prefix_operators=[], qualifier=transform, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=transformList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=transform)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Transform, sub_type=None))), label=None) if[binary_operation[literal[null], ==, member[.builderClass]]] begin[{] call[parseInfo.format, parameter[literal["**Failed to find CoordTransBuilder name= %s from Variable= %s%n"], member[.transform_name], member[.ctv]]] return[literal[null]] else begin[{] None end[}] local_variable[type[Object], builderObject] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=builderObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=builderClass, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cant create new instance "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=builderClass, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, 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=['InstantiationException', 'IllegalAccessException']))], finally_block=None, label=None, resources=None) if[binary_operation[literal[null], ==, member[.builderObject]]] begin[{] call[parseInfo.format, parameter[literal["**Failed to build CoordTransBuilder object from class= %s for Variable= %s%n"], call[builderClass.getName, parameter[]], member[.ctv]]] return[literal[null]] else begin[{] None end[}] local_variable[type[CoordinateTransform], ct] if[binary_operation[member[.builderObject], instanceof, type[VertTransformBuilderIF]]] begin[{] local_variable[type[VertTransformBuilderIF], vertBuilder] call[vertBuilder.setErrorBuffer, parameter[member[.errInfo]]] assign[member[.ct], call[vertBuilder.makeCoordinateTransform, parameter[member[.ds], member[.ctv]]]] else begin[{] if[binary_operation[member[.builderObject], instanceof, type[HorizTransformBuilderIF]]] begin[{] local_variable[type[HorizTransformBuilderIF], horizBuilder] call[horizBuilder.setErrorBuffer, parameter[member[.errInfo]]] local_variable[type[String], units] assign[member[.ct], call[horizBuilder.makeCoordinateTransform, parameter[member[.ctv], member[.units]]]] else begin[{] call[log.error, parameter[binary_operation[literal["Illegals class "], +, call[builderClass.getName, parameter[]]]]] return[literal[null]] end[}] end[}] if[binary_operation[member[.ct], !=, literal[null]]] begin[{] call[parseInfo.format, parameter[literal[" Made Coordinate transform %s from variable %s: %s%n"], member[.transform_name], call[ctv.getName, parameter[]], call[builderObject.getClass, parameter[]]]] else begin[{] None end[}] return[member[.ct]] end[}] END[}]
Keyword[static] Keyword[public] identifier[CoordinateTransform] identifier[makeCoordinateTransform] operator[SEP] identifier[NetcdfDataset] identifier[ds] , identifier[AttributeContainer] identifier[ctv] , identifier[Formatter] identifier[parseInfo] , identifier[Formatter] identifier[errInfo] operator[SEP] { identifier[String] identifier[transform_name] operator[=] identifier[ctv] operator[SEP] identifier[findAttValueIgnoreCase] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[transform_name] operator[SEP] identifier[transform_name] operator[=] identifier[ctv] operator[SEP] identifier[findAttValueIgnoreCase] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[transform_name] operator[SEP] identifier[transform_name] operator[=] identifier[ctv] operator[SEP] identifier[findAttValueIgnoreCase] operator[SEP] identifier[CF] operator[SEP] identifier[GRID_MAPPING_NAME] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[transform_name] operator[SEP] identifier[transform_name] operator[=] identifier[ctv] operator[SEP] identifier[findAttValueIgnoreCase] operator[SEP] identifier[CF] operator[SEP] identifier[STANDARD_NAME] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[transform_name] operator[SEP] { identifier[parseInfo] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[ctv] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[transform_name] operator[=] identifier[transform_name] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[Class] identifier[builderClass] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Transform] identifier[transform] operator[:] identifier[transformList] operator[SEP] { Keyword[if] operator[SEP] identifier[transform] operator[SEP] identifier[transName] operator[SEP] identifier[equals] operator[SEP] identifier[transform_name] operator[SEP] operator[SEP] { identifier[builderClass] operator[=] identifier[transform] operator[SEP] identifier[transClass] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] Other[null] operator[==] identifier[builderClass] operator[SEP] { identifier[parseInfo] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[transform_name] , identifier[ctv] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[Object] identifier[builderObject] operator[SEP] Keyword[try] { identifier[builderObject] operator[=] identifier[builderClass] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InstantiationException] operator[|] identifier[IllegalAccessException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[builderClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] Other[null] operator[==] identifier[builderObject] operator[SEP] { identifier[parseInfo] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[builderClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[ctv] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[CoordinateTransform] identifier[ct] operator[SEP] Keyword[if] operator[SEP] identifier[builderObject] Keyword[instanceof] identifier[VertTransformBuilderIF] operator[SEP] { identifier[VertTransformBuilderIF] identifier[vertBuilder] operator[=] operator[SEP] identifier[VertTransformBuilderIF] operator[SEP] identifier[builderObject] operator[SEP] identifier[vertBuilder] operator[SEP] identifier[setErrorBuffer] operator[SEP] identifier[errInfo] operator[SEP] operator[SEP] identifier[ct] operator[=] identifier[vertBuilder] operator[SEP] identifier[makeCoordinateTransform] operator[SEP] identifier[ds] , identifier[ctv] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[builderObject] Keyword[instanceof] identifier[HorizTransformBuilderIF] operator[SEP] { identifier[HorizTransformBuilderIF] identifier[horizBuilder] operator[=] operator[SEP] identifier[HorizTransformBuilderIF] operator[SEP] identifier[builderObject] operator[SEP] identifier[horizBuilder] operator[SEP] identifier[setErrorBuffer] operator[SEP] identifier[errInfo] operator[SEP] operator[SEP] identifier[String] identifier[units] operator[=] identifier[AbstractTransformBuilder] operator[SEP] identifier[getGeoCoordinateUnits] operator[SEP] identifier[ds] , identifier[ctv] operator[SEP] operator[SEP] identifier[ct] operator[=] identifier[horizBuilder] operator[SEP] identifier[makeCoordinateTransform] operator[SEP] identifier[ctv] , identifier[units] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[builderClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[ct] operator[!=] Other[null] operator[SEP] { identifier[parseInfo] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[transform_name] , identifier[ctv] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[builderObject] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ct] operator[SEP] }
private <T> void runProcessorsOnInlineContent(ProxyBuilder<T> proxyBuilder, ParagraphCoordinates paragraphCoordinates) { ParagraphWrapper paragraph = new ParagraphWrapper(paragraphCoordinates.getParagraph()); List<String> processorExpressions = expressionUtil .findProcessorExpressions(paragraph.getText()); for (String processorExpression : processorExpressions) { String strippedExpression = expressionUtil.stripExpression(processorExpression); for (final ICommentProcessor processor : commentProcessors) { Class<?> commentProcessorInterface = commentProcessorInterfaces.get(processor); proxyBuilder.withInterface(commentProcessorInterface, processor); processor.setCurrentParagraphCoordinates(paragraphCoordinates); } try { T contextRootProxy = proxyBuilder.build(); expressionResolver.resolveExpression(strippedExpression, contextRootProxy); placeholderReplacer.replace(paragraph, processorExpression, null); logger.debug(String.format( "Processor expression '%s' has been successfully processed by a comment processor.", processorExpression)); } catch (SpelEvaluationException | SpelParseException e) { if (failOnInvalidExpression) { throw new UnresolvedExpressionException(strippedExpression, e); } else { logger.warn(String.format( "Skipping processor expression '%s' because it can not be resolved by any comment processor. Reason: %s. Set log level to TRACE to view Stacktrace.", processorExpression, e.getMessage())); logger.trace("Reason for skipping processor expression: ", e); } } catch (ProxyException e) { throw new DocxStamperException("Could not create a proxy around context root object", e); } } }
class class_name[name] begin[{] method[runProcessorsOnInlineContent, return_type[void], modifier[private], parameter[proxyBuilder, paragraphCoordinates]] begin[{] local_variable[type[ParagraphWrapper], paragraph] local_variable[type[List], processorExpressions] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=processorExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stripExpression, postfix_operators=[], prefix_operators=[], qualifier=expressionUtil, selectors=[], type_arguments=None), name=strippedExpression)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=processor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=commentProcessorInterfaces, selectors=[], type_arguments=None), name=commentProcessorInterface)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=commentProcessorInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=processor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withInterface, postfix_operators=[], prefix_operators=[], qualifier=proxyBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=paragraphCoordinates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCurrentParagraphCoordinates, postfix_operators=[], prefix_operators=[], qualifier=processor, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=commentProcessors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=processor)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ICommentProcessor, sub_type=None))), label=None), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=proxyBuilder, selectors=[], type_arguments=None), name=contextRootProxy)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=strippedExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contextRootProxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveExpression, postfix_operators=[], prefix_operators=[], qualifier=expressionResolver, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=paragraph, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=processorExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=replace, postfix_operators=[], prefix_operators=[], qualifier=placeholderReplacer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Processor expression '%s' has been successfully processed by a comment processor."), MemberReference(member=processorExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MemberReference(member=failOnInvalidExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Skipping processor expression '%s' because it can not be resolved by any comment processor. Reason: %s. Set log level to TRACE to view Stacktrace."), MemberReference(member=processorExpression, 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=String, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Reason for skipping processor expression: "), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=strippedExpression, 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=UnresolvedExpressionException, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SpelEvaluationException', 'SpelParseException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not create a proxy around context root object"), 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=DocxStamperException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ProxyException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=processorExpressions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=processorExpression)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[private] operator[<] identifier[T] operator[>] Keyword[void] identifier[runProcessorsOnInlineContent] operator[SEP] identifier[ProxyBuilder] operator[<] identifier[T] operator[>] identifier[proxyBuilder] , identifier[ParagraphCoordinates] identifier[paragraphCoordinates] operator[SEP] { identifier[ParagraphWrapper] identifier[paragraph] operator[=] Keyword[new] identifier[ParagraphWrapper] operator[SEP] identifier[paragraphCoordinates] operator[SEP] identifier[getParagraph] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[processorExpressions] operator[=] identifier[expressionUtil] operator[SEP] identifier[findProcessorExpressions] operator[SEP] identifier[paragraph] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[processorExpression] operator[:] identifier[processorExpressions] operator[SEP] { identifier[String] identifier[strippedExpression] operator[=] identifier[expressionUtil] operator[SEP] identifier[stripExpression] operator[SEP] identifier[processorExpression] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[ICommentProcessor] identifier[processor] operator[:] identifier[commentProcessors] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[commentProcessorInterface] operator[=] identifier[commentProcessorInterfaces] operator[SEP] identifier[get] operator[SEP] identifier[processor] operator[SEP] operator[SEP] identifier[proxyBuilder] operator[SEP] identifier[withInterface] operator[SEP] identifier[commentProcessorInterface] , identifier[processor] operator[SEP] operator[SEP] identifier[processor] operator[SEP] identifier[setCurrentParagraphCoordinates] operator[SEP] identifier[paragraphCoordinates] operator[SEP] operator[SEP] } Keyword[try] { identifier[T] identifier[contextRootProxy] operator[=] identifier[proxyBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[expressionResolver] operator[SEP] identifier[resolveExpression] operator[SEP] identifier[strippedExpression] , identifier[contextRootProxy] operator[SEP] operator[SEP] identifier[placeholderReplacer] operator[SEP] identifier[replace] operator[SEP] identifier[paragraph] , identifier[processorExpression] , Other[null] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[processorExpression] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SpelEvaluationException] operator[|] identifier[SpelParseException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[failOnInvalidExpression] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnresolvedExpressionException] operator[SEP] identifier[strippedExpression] , identifier[e] operator[SEP] operator[SEP] } Keyword[else] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[processorExpression] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[ProxyException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[DocxStamperException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } }
public void propertyChange(final java.beans.PropertyChangeEvent p1) { this.firePropertyChange(p1.getPropertyName(), p1.getOldValue(), p1.getNewValue()); }
class class_name[name] begin[{] method[propertyChange, return_type[void], modifier[public], parameter[p1]] begin[{] THIS[call[None.firePropertyChange, parameter[call[p1.getPropertyName, parameter[]], call[p1.getOldValue, parameter[]], call[p1.getNewValue, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[propertyChange] operator[SEP] Keyword[final] identifier[java] operator[SEP] identifier[beans] operator[SEP] identifier[PropertyChangeEvent] identifier[p1] operator[SEP] { Keyword[this] operator[SEP] identifier[firePropertyChange] operator[SEP] identifier[p1] operator[SEP] identifier[getPropertyName] operator[SEP] operator[SEP] , identifier[p1] operator[SEP] identifier[getOldValue] operator[SEP] operator[SEP] , identifier[p1] operator[SEP] identifier[getNewValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private static <E> void loadIntoCounter(String filename, Class<E> c, Counter<E> counter) throws RuntimeException { try { Constructor<E> m = c.getConstructor(String.class); BufferedReader in = IOUtils.getBufferedFileReader(filename);// new // BufferedReader(new // FileReader(filename)); String line = in.readLine(); while (line != null && line.length() > 0) { int endPos = Math.max(line.lastIndexOf(' '), line.lastIndexOf('\t')); counter.setCount(m.newInstance(line.substring(0, endPos).trim()), Double.parseDouble(line.substring(endPos, line.length()).trim())); line = in.readLine(); } in.close(); } catch (Exception e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[loadIntoCounter, return_type[void], modifier[private static], parameter[filename, c, counter]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), name=m)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBufferedFileReader, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), name=in)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t')], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=endPos)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=endPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=endPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseDouble, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None)], member=setCount, postfix_operators=[], prefix_operators=[], qualifier=counter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=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=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[E] operator[>] Keyword[void] identifier[loadIntoCounter] operator[SEP] identifier[String] identifier[filename] , identifier[Class] operator[<] identifier[E] operator[>] identifier[c] , identifier[Counter] operator[<] identifier[E] operator[>] identifier[counter] operator[SEP] Keyword[throws] identifier[RuntimeException] { Keyword[try] { identifier[Constructor] operator[<] identifier[E] operator[>] identifier[m] operator[=] identifier[c] operator[SEP] identifier[getConstructor] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[BufferedReader] identifier[in] operator[=] identifier[IOUtils] operator[SEP] identifier[getBufferedFileReader] operator[SEP] identifier[filename] operator[SEP] operator[SEP] identifier[String] identifier[line] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[line] operator[!=] Other[null] operator[&&] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[endPos] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[line] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] , identifier[line] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[counter] operator[SEP] identifier[setCount] operator[SEP] identifier[m] operator[SEP] identifier[newInstance] operator[SEP] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[endPos] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] , identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[line] operator[SEP] identifier[substring] operator[SEP] identifier[endPos] , identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] } identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
protected final CnvBnRsToDouble<RS> createPutCnvBnRsToDouble() throws Exception { CnvBnRsToDouble<RS> convrt = new CnvBnRsToDouble<RS>(); //assigning fully initialized object: this.convertersMap .put(CnvBnRsToDouble.class.getSimpleName(), convrt); return convrt; }
class class_name[name] begin[{] method[createPutCnvBnRsToDouble, return_type[type[CnvBnRsToDouble]], modifier[final protected], parameter[]] begin[{] local_variable[type[CnvBnRsToDouble], convrt] THIS[member[None.convertersMap]call[None.put, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=CnvBnRsToDouble, sub_type=None)), member[.convrt]]]] return[member[.convrt]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[CnvBnRsToDouble] operator[<] identifier[RS] operator[>] identifier[createPutCnvBnRsToDouble] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[CnvBnRsToDouble] operator[<] identifier[RS] operator[>] identifier[convrt] operator[=] Keyword[new] identifier[CnvBnRsToDouble] operator[<] identifier[RS] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[convertersMap] operator[SEP] identifier[put] operator[SEP] identifier[CnvBnRsToDouble] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[convrt] operator[SEP] operator[SEP] Keyword[return] identifier[convrt] operator[SEP] }
@Trivial public void log(TraceComponent logger) { Tr.debug(logger, MessageFormat.format("Annotation [ {0} ]", getAnnotationClassName())); // Only log the non-defaulted values. for (String valueName : this.values.keySet()) { AnnotationValueImpl nextValue = getValue(valueName); String valueEnumClassName = nextValue.getEnumClassName(); Object valueValue = nextValue.getObjectValue(); // works for all value types, e.g., Object, Enumerated (as String), Class, Array if (valueEnumClassName != null) { Tr.debug(logger, MessageFormat.format(" Value: Name [ {0} ] Enum Type [ {1} ] Value [ {2} ]", new Object[] { valueName, valueEnumClassName, valueValue })); } else { Tr.debug(logger, MessageFormat.format(" Value: Name [ {0} ] Value [ {1} ]", new Object[] { valueName, valueValue })); } } }
class class_name[name] begin[{] method[log, return_type[void], modifier[public], parameter[logger]] begin[{] call[Tr.debug, parameter[member[.logger], call[MessageFormat.format, parameter[literal["Annotation [ {0} ]"], call[.getAnnotationClassName, parameter[]]]]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=valueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=nextValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationValueImpl, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEnumClassName, postfix_operators=[], prefix_operators=[], qualifier=nextValue, selectors=[], type_arguments=None), name=valueEnumClassName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getObjectValue, postfix_operators=[], prefix_operators=[], qualifier=nextValue, selectors=[], type_arguments=None), name=valueValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=valueEnumClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Value: Name [ {0} ] Value [ {1} ]"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=valueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=format, postfix_operators=[], prefix_operators=[], qualifier=MessageFormat, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Value: Name [ {0} ] Enum Type [ {1} ] Value [ {2} ]"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=valueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueEnumClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=format, postfix_operators=[], prefix_operators=[], qualifier=MessageFormat, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=valueName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Trivial] Keyword[public] Keyword[void] identifier[log] operator[SEP] identifier[TraceComponent] identifier[logger] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[logger] , identifier[MessageFormat] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[getAnnotationClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[valueName] operator[:] Keyword[this] operator[SEP] identifier[values] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[AnnotationValueImpl] identifier[nextValue] operator[=] identifier[getValue] operator[SEP] identifier[valueName] operator[SEP] operator[SEP] identifier[String] identifier[valueEnumClassName] operator[=] identifier[nextValue] operator[SEP] identifier[getEnumClassName] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[valueValue] operator[=] identifier[nextValue] operator[SEP] identifier[getObjectValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[valueEnumClassName] operator[!=] Other[null] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[logger] , identifier[MessageFormat] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[valueName] , identifier[valueEnumClassName] , identifier[valueValue] } operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[logger] , identifier[MessageFormat] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[valueName] , identifier[valueValue] } operator[SEP] operator[SEP] operator[SEP] } } }
@Override public EClass getIfcStructuralLoadTemperature() { if (ifcStructuralLoadTemperatureEClass == null) { ifcStructuralLoadTemperatureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(652); } return ifcStructuralLoadTemperatureEClass; }
class class_name[name] begin[{] method[getIfcStructuralLoadTemperature, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcStructuralLoadTemperatureEClass], ==, literal[null]]] begin[{] assign[member[.ifcStructuralLoadTemperatureEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=652)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcStructuralLoadTemperatureEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcStructuralLoadTemperature] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcStructuralLoadTemperatureEClass] operator[==] Other[null] operator[SEP] { identifier[ifcStructuralLoadTemperatureEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[652] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcStructuralLoadTemperatureEClass] operator[SEP] }
public static List<ClassReference> analyze(WildcardImportResolver importResolver, Set<String> libraryPaths, Set<String> sourcePaths, Path sourceFile) { ASTParser parser = ASTParser.newParser(AST.JLS11); parser.setEnvironment(libraryPaths.toArray(new String[libraryPaths.size()]), sourcePaths.toArray(new String[sourcePaths.size()]), null, true); parser.setBindingsRecovery(false); parser.setResolveBindings(true); Map options = JavaCore.getOptions(); JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options); parser.setCompilerOptions(options); String fileName = sourceFile.getFileName().toString(); parser.setUnitName(fileName); try { parser.setSource(FileUtils.readFileToString(sourceFile.toFile()).toCharArray()); } catch (IOException e) { throw new ASTException("Failed to get source for file: " + sourceFile.toString() + " due to: " + e.getMessage(), e); } parser.setKind(ASTParser.K_COMPILATION_UNIT); CompilationUnit cu = (CompilationUnit) parser.createAST(null); ReferenceResolvingVisitor visitor = new ReferenceResolvingVisitor(importResolver, cu, sourceFile.toString()); cu.accept(visitor); return visitor.getJavaClassReferences(); }
class class_name[name] begin[{] method[analyze, return_type[type[List]], modifier[public static], parameter[importResolver, libraryPaths, sourcePaths, sourceFile]] begin[{] local_variable[type[ASTParser], parser] call[parser.setEnvironment, parameter[call[libraryPaths.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=libraryPaths, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]], call[sourcePaths.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=sourcePaths, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]], literal[null], literal[true]]] call[parser.setBindingsRecovery, parameter[literal[false]]] call[parser.setResolveBindings, parameter[literal[true]]] local_variable[type[Map], options] call[JavaCore.setComplianceOptions, parameter[member[JavaCore.VERSION_1_8], member[.options]]] call[parser.setCompilerOptions, parameter[member[.options]]] local_variable[type[String], fileName] call[parser.setUnitName, parameter[member[.fileName]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toFile, postfix_operators=[], prefix_operators=[], qualifier=sourceFile, selectors=[], type_arguments=None)], member=readFileToString, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[MethodInvocation(arguments=[], member=toCharArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setSource, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to get source for file: "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sourceFile, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" due to: "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ASTException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) call[parser.setKind, parameter[member[ASTParser.K_COMPILATION_UNIT]]] local_variable[type[CompilationUnit], cu] local_variable[type[ReferenceResolvingVisitor], visitor] call[cu.accept, parameter[member[.visitor]]] return[call[visitor.getJavaClassReferences, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[ClassReference] operator[>] identifier[analyze] operator[SEP] identifier[WildcardImportResolver] identifier[importResolver] , identifier[Set] operator[<] identifier[String] operator[>] identifier[libraryPaths] , identifier[Set] operator[<] identifier[String] operator[>] identifier[sourcePaths] , identifier[Path] identifier[sourceFile] operator[SEP] { identifier[ASTParser] identifier[parser] operator[=] identifier[ASTParser] operator[SEP] identifier[newParser] operator[SEP] identifier[AST] operator[SEP] identifier[JLS11] operator[SEP] operator[SEP] identifier[parser] operator[SEP] identifier[setEnvironment] operator[SEP] identifier[libraryPaths] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[libraryPaths] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , identifier[sourcePaths] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[sourcePaths] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , Other[null] , literal[boolean] operator[SEP] operator[SEP] identifier[parser] operator[SEP] identifier[setBindingsRecovery] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[parser] operator[SEP] identifier[setResolveBindings] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[Map] identifier[options] operator[=] identifier[JavaCore] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] identifier[JavaCore] operator[SEP] identifier[setComplianceOptions] operator[SEP] identifier[JavaCore] operator[SEP] identifier[VERSION_1_8] , identifier[options] operator[SEP] operator[SEP] identifier[parser] operator[SEP] identifier[setCompilerOptions] operator[SEP] identifier[options] operator[SEP] operator[SEP] identifier[String] identifier[fileName] operator[=] identifier[sourceFile] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[parser] operator[SEP] identifier[setUnitName] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] Keyword[try] { identifier[parser] operator[SEP] identifier[setSource] operator[SEP] identifier[FileUtils] operator[SEP] identifier[readFileToString] operator[SEP] identifier[sourceFile] operator[SEP] identifier[toFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ASTException] operator[SEP] literal[String] operator[+] identifier[sourceFile] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } identifier[parser] operator[SEP] identifier[setKind] operator[SEP] identifier[ASTParser] operator[SEP] identifier[K_COMPILATION_UNIT] operator[SEP] operator[SEP] identifier[CompilationUnit] identifier[cu] operator[=] operator[SEP] identifier[CompilationUnit] operator[SEP] identifier[parser] operator[SEP] identifier[createAST] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[ReferenceResolvingVisitor] identifier[visitor] operator[=] Keyword[new] identifier[ReferenceResolvingVisitor] operator[SEP] identifier[importResolver] , identifier[cu] , identifier[sourceFile] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cu] operator[SEP] identifier[accept] operator[SEP] identifier[visitor] operator[SEP] operator[SEP] Keyword[return] identifier[visitor] operator[SEP] identifier[getJavaClassReferences] operator[SEP] operator[SEP] operator[SEP] }
protected void interceptIntDataType(Op op) { // FIXME: Remove this method, after we'll add support for <int> dtype operations if (op.x() != null && op.x().data().dataType() == DataBuffer.Type.INT) throw new ND4JIllegalStateException( "Op.X contains INT data. Operations on INT dataType are not supported yet"); if (op.z() != null && op.z().data().dataType() == DataBuffer.Type.INT) throw new ND4JIllegalStateException( "Op.Z contains INT data. Operations on INT dataType are not supported yet"); if (op.y() != null && op.y().data().dataType() == DataBuffer.Type.INT) throw new ND4JIllegalStateException( "Op.Y contains INT data. Operations on INT dataType are not supported yet."); }
class class_name[name] begin[{] method[interceptIntDataType, return_type[void], modifier[protected], parameter[op]] begin[{] if[binary_operation[binary_operation[call[op.x, parameter[]], !=, literal[null]], &&, binary_operation[call[op.x, parameter[]], ==, member[DataBuffer.Type.INT]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Op.X contains INT data. Operations on INT dataType are not supported yet")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ND4JIllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[call[op.z, parameter[]], !=, literal[null]], &&, binary_operation[call[op.z, parameter[]], ==, member[DataBuffer.Type.INT]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Op.Z contains INT data. Operations on INT dataType are not supported yet")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ND4JIllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[call[op.y, parameter[]], !=, literal[null]], &&, binary_operation[call[op.y, parameter[]], ==, member[DataBuffer.Type.INT]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Op.Y contains INT data. Operations on INT dataType are not supported yet.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ND4JIllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[interceptIntDataType] operator[SEP] identifier[Op] identifier[op] operator[SEP] { Keyword[if] operator[SEP] identifier[op] operator[SEP] identifier[x] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[op] operator[SEP] identifier[x] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP] identifier[dataType] operator[SEP] operator[SEP] operator[==] identifier[DataBuffer] operator[SEP] identifier[Type] operator[SEP] identifier[INT] operator[SEP] Keyword[throw] Keyword[new] identifier[ND4JIllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[op] operator[SEP] identifier[z] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[op] operator[SEP] identifier[z] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP] identifier[dataType] operator[SEP] operator[SEP] operator[==] identifier[DataBuffer] operator[SEP] identifier[Type] operator[SEP] identifier[INT] operator[SEP] Keyword[throw] Keyword[new] identifier[ND4JIllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[op] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[op] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP] identifier[dataType] operator[SEP] operator[SEP] operator[==] identifier[DataBuffer] operator[SEP] identifier[Type] operator[SEP] identifier[INT] operator[SEP] Keyword[throw] Keyword[new] identifier[ND4JIllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public static String getPathFromBaseDir(String path) { int i = path.indexOf("grails-app/"); if(i > -1 ) { return path.substring(i + 11); } else { try { File baseDir = BuildSettings.BASE_DIR; String basePath = baseDir != null ? baseDir.getCanonicalPath() : null; if(basePath != null) { String canonicalPath = new File(path).getCanonicalPath(); return canonicalPath.substring(basePath.length()+1); } } catch (IOException e) { // ignore } } return null; }
class class_name[name] begin[{] method[getPathFromBaseDir, return_type[type[String]], modifier[public static], parameter[path]] begin[{] local_variable[type[int], i] if[binary_operation[member[.i], >, literal[1]]] begin[{] return[call[path.substring, parameter[binary_operation[member[.i], +, literal[11]]]]] else begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=BASE_DIR, postfix_operators=[], prefix_operators=[], qualifier=BuildSettings, selectors=[]), name=baseDir)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=baseDir, 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=getCanonicalPath, postfix_operators=[], prefix_operators=[], qualifier=baseDir, selectors=[], type_arguments=None)), name=basePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=basePath, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getCanonicalPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=canonicalPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=basePath, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=canonicalPath, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getPathFromBaseDir] operator[SEP] identifier[String] identifier[path] operator[SEP] { Keyword[int] identifier[i] operator[=] identifier[path] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[>] operator[-] Other[1] operator[SEP] { Keyword[return] identifier[path] operator[SEP] identifier[substring] operator[SEP] identifier[i] operator[+] Other[11] operator[SEP] operator[SEP] } Keyword[else] { Keyword[try] { identifier[File] identifier[baseDir] operator[=] identifier[BuildSettings] operator[SEP] identifier[BASE_DIR] operator[SEP] identifier[String] identifier[basePath] operator[=] identifier[baseDir] operator[!=] Other[null] operator[?] identifier[baseDir] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[basePath] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[canonicalPath] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[canonicalPath] operator[SEP] identifier[substring] operator[SEP] identifier[basePath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { } } Keyword[return] Other[null] operator[SEP] }
@Override public boolean execute(final LineReader reader, final String[] parts, final SqlConfig sqlConfig, final Properties props) { PrintWriter writer = reader.getTerminal().writer(); writer.println("LIST:"); writer.flush(); List<String> pathList = null; if (parts.length > 1) { pathList = sqlConfig.getSqlManager().getSqlPathList().stream().filter(p -> p.contains(parts[1])) .collect(Collectors.toList()); } else { pathList = sqlConfig.getSqlManager().getSqlPathList(); } for (String key : pathList) { writer.println(key); } writer.flush(); return true; }
class class_name[name] begin[{] method[execute, return_type[type[boolean]], modifier[public], parameter[reader, parts, sqlConfig, props]] begin[{] local_variable[type[PrintWriter], writer] call[writer.println, parameter[literal["LIST:"]]] call[writer.flush, parameter[]] local_variable[type[List], pathList] if[binary_operation[member[parts.length], >, literal[1]]] begin[{] assign[member[.pathList], call[sqlConfig.getSqlManager, parameter[]]] else begin[{] assign[member[.pathList], call[sqlConfig.getSqlManager, parameter[]]] end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pathList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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) call[writer.flush, parameter[]] return[literal[true]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[execute] operator[SEP] Keyword[final] identifier[LineReader] identifier[reader] , Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[parts] , Keyword[final] identifier[SqlConfig] identifier[sqlConfig] , Keyword[final] identifier[Properties] identifier[props] operator[SEP] { identifier[PrintWriter] identifier[writer] operator[=] identifier[reader] operator[SEP] identifier[getTerminal] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[pathList] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] { identifier[pathList] operator[=] identifier[sqlConfig] operator[SEP] identifier[getSqlManager] operator[SEP] operator[SEP] operator[SEP] identifier[getSqlPathList] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[p] operator[->] identifier[p] operator[SEP] identifier[contains] operator[SEP] identifier[parts] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[pathList] operator[=] identifier[sqlConfig] operator[SEP] identifier[getSqlManager] operator[SEP] operator[SEP] operator[SEP] identifier[getSqlPathList] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[pathList] operator[SEP] { identifier[writer] operator[SEP] identifier[println] operator[SEP] identifier[key] operator[SEP] operator[SEP] } identifier[writer] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public SymbolOptions withLatLng(LatLng latLng) { geometry = Point.fromLngLat(latLng.getLongitude(), latLng.getLatitude()); return this; }
class class_name[name] begin[{] method[withLatLng, return_type[type[SymbolOptions]], modifier[public], parameter[latLng]] begin[{] assign[member[.geometry], call[Point.fromLngLat, parameter[call[latLng.getLongitude, parameter[]], call[latLng.getLatitude, parameter[]]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[SymbolOptions] identifier[withLatLng] operator[SEP] identifier[LatLng] identifier[latLng] operator[SEP] { identifier[geometry] operator[=] identifier[Point] operator[SEP] identifier[fromLngLat] operator[SEP] identifier[latLng] operator[SEP] identifier[getLongitude] operator[SEP] operator[SEP] , identifier[latLng] operator[SEP] identifier[getLatitude] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static InternetAddress parseFirstAddress(String address, Charset charset) { final InternetAddress[] internetAddresses = parseAddress(address, charset); if (ArrayUtil.isEmpty(internetAddresses)) { try { return new InternetAddress(address); } catch (AddressException e) { throw new MailException(e); } } return internetAddresses[0]; }
class class_name[name] begin[{] method[parseFirstAddress, return_type[type[InternetAddress]], modifier[public static], parameter[address, charset]] begin[{] local_variable[type[InternetAddress], internetAddresses] if[call[ArrayUtil.isEmpty, parameter[member[.internetAddresses]]]] begin[{] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=address, 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=InternetAddress, 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=MailException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AddressException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.internetAddresses]] end[}] END[}]
Keyword[public] Keyword[static] identifier[InternetAddress] identifier[parseFirstAddress] operator[SEP] identifier[String] identifier[address] , identifier[Charset] identifier[charset] operator[SEP] { Keyword[final] identifier[InternetAddress] operator[SEP] operator[SEP] identifier[internetAddresses] operator[=] identifier[parseAddress] operator[SEP] identifier[address] , identifier[charset] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ArrayUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[internetAddresses] operator[SEP] operator[SEP] { Keyword[try] { Keyword[return] Keyword[new] identifier[InternetAddress] operator[SEP] identifier[address] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[AddressException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[MailException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[return] identifier[internetAddresses] operator[SEP] Other[0] operator[SEP] operator[SEP] }
@Override public String retrievePublicIpAddress( TargetHandlerParameters parameters, String machineId ) throws TargetException { String result = null; try { AmazonEC2 ec2 = createEc2Client( parameters.getTargetProperties()); DescribeInstancesRequest dis = new DescribeInstancesRequest(); dis.setInstanceIds(Collections.singletonList(machineId)); DescribeInstancesResult disresult = ec2.describeInstances( dis ); if( ! disresult.getReservations().isEmpty()) { // Only one instance should match this machine ID result = disresult.getReservations().get( 0 ).getInstances().get( 0 ).getPublicIpAddress(); } } catch( AmazonServiceException e ) { // nothing, the instance does not exist } catch( Exception e ) { this.logger.severe( "An error occurred while retrieving a public IP address from Amazon EC2. " + e.getMessage()); throw new TargetException( e ); } return result; }
class class_name[name] begin[{] method[retrievePublicIpAddress, return_type[type[String]], modifier[public], parameter[parameters, machineId]] begin[{] local_variable[type[String], result] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTargetProperties, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[], type_arguments=None)], member=createEc2Client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=ec2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AmazonEC2, sub_type=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=DescribeInstancesRequest, sub_type=None)), name=dis)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DescribeInstancesRequest, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=machineId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=singletonList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], member=setInstanceIds, postfix_operators=[], prefix_operators=[], qualifier=dis, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=describeInstances, postfix_operators=[], prefix_operators=[], qualifier=ec2, selectors=[], type_arguments=None), name=disresult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DescribeInstancesResult, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getReservations, postfix_operators=[], prefix_operators=['!'], qualifier=disresult, selectors=[MethodInvocation(arguments=[], member=isEmpty, 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=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getReservations, postfix_operators=[], prefix_operators=[], qualifier=disresult, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getInstances, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getPublicIpAddress, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AmazonServiceException'])), CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occurred while retrieving a public IP address from Amazon EC2. "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=severe, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), 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=TargetException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[retrievePublicIpAddress] operator[SEP] identifier[TargetHandlerParameters] identifier[parameters] , identifier[String] identifier[machineId] operator[SEP] Keyword[throws] identifier[TargetException] { identifier[String] identifier[result] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[AmazonEC2] identifier[ec2] operator[=] identifier[createEc2Client] operator[SEP] identifier[parameters] operator[SEP] identifier[getTargetProperties] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DescribeInstancesRequest] identifier[dis] operator[=] Keyword[new] identifier[DescribeInstancesRequest] operator[SEP] operator[SEP] operator[SEP] identifier[dis] operator[SEP] identifier[setInstanceIds] operator[SEP] identifier[Collections] operator[SEP] identifier[singletonList] operator[SEP] identifier[machineId] operator[SEP] operator[SEP] operator[SEP] identifier[DescribeInstancesResult] identifier[disresult] operator[=] identifier[ec2] operator[SEP] identifier[describeInstances] operator[SEP] identifier[dis] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[disresult] operator[SEP] identifier[getReservations] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[=] identifier[disresult] operator[SEP] identifier[getReservations] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getInstances] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getPublicIpAddress] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[AmazonServiceException] identifier[e] operator[SEP] { } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[severe] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[TargetException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
@Override public void addSynchronizationObserver(Observer<Registry<KEY, ENTRY>,Long> observer) { synchronisationObservable.addObserver(observer); }
class class_name[name] begin[{] method[addSynchronizationObserver, return_type[void], modifier[public], parameter[observer]] begin[{] call[synchronisationObservable.addObserver, parameter[member[.observer]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addSynchronizationObserver] operator[SEP] identifier[Observer] operator[<] identifier[Registry] operator[<] identifier[KEY] , identifier[ENTRY] operator[>] , identifier[Long] operator[>] identifier[observer] operator[SEP] { identifier[synchronisationObservable] operator[SEP] identifier[addObserver] operator[SEP] identifier[observer] operator[SEP] operator[SEP] }
public void addHttpSessionListener(HttpSessionListener listener, String J2EEName) { synchronized (mHttpSessionListeners) { mHttpSessionListeners.add(listener); mHttpSessionListenersJ2eeNames.add(J2EEName); sessionListener = true; _coreHttpSessionManager.getIStore().setHttpSessionListener(true); // PM03375: Set app listeners if (mHttpAppSessionListeners != null) mHttpAppSessionListeners.add(listener); // PM03375: Set listener for app session manager if (_coreHttpAppSessionManager != null) _coreHttpAppSessionManager.getIStore().setHttpSessionListener(true); if (listener instanceof IBMSessionListener) { wasHttpSessionObserver.setDoesContainIBMSessionListener(true); // PM03375: Mark app observer // Begin: PM03375: Use separate observer for app sessions if (wasHttpAppSessionObserver != null) { wasHttpAppSessionObserver.setDoesContainIBMSessionListener(true); LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, methodNames[ADD_HTTP_SESSION_LISTENER], "Marked " + " app IBM session listener for app observer " + mHttpAppSessionListeners); } // End: PM03375 } } }
class class_name[name] begin[{] method[addHttpSessionListener, return_type[void], modifier[public], parameter[listener, J2EEName]] begin[{] SYNCHRONIZED[member[.mHttpSessionListeners]] BEGIN[{] call[mHttpSessionListeners.add, parameter[member[.listener]]] call[mHttpSessionListenersJ2eeNames.add, parameter[member[.J2EEName]]] assign[member[.sessionListener], literal[true]] call[_coreHttpSessionManager.getIStore, parameter[]] if[binary_operation[member[.mHttpAppSessionListeners], !=, literal[null]]] begin[{] call[mHttpAppSessionListeners.add, parameter[member[.listener]]] else begin[{] None end[}] if[binary_operation[member[._coreHttpAppSessionManager], !=, literal[null]]] begin[{] call[_coreHttpAppSessionManager.getIStore, parameter[]] else begin[{] None end[}] if[binary_operation[member[.listener], instanceof, type[IBMSessionListener]]] begin[{] call[wasHttpSessionObserver.setDoesContainIBMSessionListener, parameter[literal[true]]] if[binary_operation[member[.wasHttpAppSessionObserver], !=, literal[null]]] begin[{] call[wasHttpAppSessionObserver.setDoesContainIBMSessionListener, parameter[literal[true]]] call[LoggingUtil.SESSION_LOGGER_CORE.logp, parameter[member[Level.FINE], member[.methodClassName], member[.methodNames], binary_operation[binary_operation[literal["Marked "], +, literal[" app IBM session listener for app observer "]], +, member[.mHttpAppSessionListeners]]]] else begin[{] None end[}] else begin[{] None end[}] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addHttpSessionListener] operator[SEP] identifier[HttpSessionListener] identifier[listener] , identifier[String] identifier[J2EEName] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[mHttpSessionListeners] operator[SEP] { identifier[mHttpSessionListeners] operator[SEP] identifier[add] operator[SEP] identifier[listener] operator[SEP] operator[SEP] identifier[mHttpSessionListenersJ2eeNames] operator[SEP] identifier[add] operator[SEP] identifier[J2EEName] operator[SEP] operator[SEP] identifier[sessionListener] operator[=] literal[boolean] operator[SEP] identifier[_coreHttpSessionManager] operator[SEP] identifier[getIStore] operator[SEP] operator[SEP] operator[SEP] identifier[setHttpSessionListener] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mHttpAppSessionListeners] operator[!=] Other[null] operator[SEP] identifier[mHttpAppSessionListeners] operator[SEP] identifier[add] operator[SEP] identifier[listener] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_coreHttpAppSessionManager] operator[!=] Other[null] operator[SEP] identifier[_coreHttpAppSessionManager] operator[SEP] identifier[getIStore] operator[SEP] operator[SEP] operator[SEP] identifier[setHttpSessionListener] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[listener] Keyword[instanceof] identifier[IBMSessionListener] operator[SEP] { identifier[wasHttpSessionObserver] operator[SEP] identifier[setDoesContainIBMSessionListener] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wasHttpAppSessionObserver] operator[!=] Other[null] operator[SEP] { identifier[wasHttpAppSessionObserver] operator[SEP] identifier[setDoesContainIBMSessionListener] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[LoggingUtil] operator[SEP] identifier[SESSION_LOGGER_CORE] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[methodClassName] , identifier[methodNames] operator[SEP] identifier[ADD_HTTP_SESSION_LISTENER] operator[SEP] , literal[String] operator[+] literal[String] operator[+] identifier[mHttpAppSessionListeners] operator[SEP] operator[SEP] } } } }
public java.util.List<Object> getDispQuoteOrSpeechOrStatement() { if (dispQuoteOrSpeechOrStatement == null) { dispQuoteOrSpeechOrStatement = new ArrayList<Object>(); } return this.dispQuoteOrSpeechOrStatement; }
class class_name[name] begin[{] method[getDispQuoteOrSpeechOrStatement, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.dispQuoteOrSpeechOrStatement], ==, literal[null]]] begin[{] assign[member[.dispQuoteOrSpeechOrStatement], 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=Object, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] return[THIS[member[None.dispQuoteOrSpeechOrStatement]]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] identifier[getDispQuoteOrSpeechOrStatement] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[dispQuoteOrSpeechOrStatement] operator[==] Other[null] operator[SEP] { identifier[dispQuoteOrSpeechOrStatement] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[dispQuoteOrSpeechOrStatement] operator[SEP] }
public boolean store (T item) { if (size == items.length) { if (!resizable) return false; // Resize this queue resize(Math.max(8, (int)(items.length * 1.75f))); } size++; items[tail++] = item; if (tail == items.length) tail = 0; return true; }
class class_name[name] begin[{] method[store, return_type[type[boolean]], modifier[public], parameter[item]] begin[{] if[binary_operation[member[.size], ==, member[items.length]]] begin[{] if[member[.resizable]] begin[{] return[literal[false]] else begin[{] None end[}] call[.resize, parameter[call[Math.max, parameter[literal[8], Cast(expression=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=items, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.75f), operator=*), type=BasicType(dimensions=[], name=int))]]]] else begin[{] None end[}] member[.size] assign[member[.items], member[.item]] if[binary_operation[member[.tail], ==, member[items.length]]] begin[{] assign[member[.tail], literal[0]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[store] operator[SEP] identifier[T] identifier[item] operator[SEP] { Keyword[if] operator[SEP] identifier[size] operator[==] identifier[items] operator[SEP] identifier[length] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[resizable] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[resize] operator[SEP] identifier[Math] operator[SEP] identifier[max] operator[SEP] Other[8] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[items] operator[SEP] identifier[length] operator[*] literal[Float] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[size] operator[++] operator[SEP] identifier[items] operator[SEP] identifier[tail] operator[++] operator[SEP] operator[=] identifier[item] operator[SEP] Keyword[if] operator[SEP] identifier[tail] operator[==] identifier[items] operator[SEP] identifier[length] operator[SEP] identifier[tail] operator[=] Other[0] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public static int countNaN(double[] v) { int c = 0; for (double d : v) { if (Double.isNaN(d)) { c++; } } return c; }
class class_name[name] begin[{] method[countNaN, return_type[type[int]], modifier[public static], parameter[v]] begin[{] local_variable[type[int], c] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNaN, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=c, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=d)], modifiers=set(), type=BasicType(dimensions=[], name=double))), label=None) return[member[.c]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[countNaN] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[v] operator[SEP] { Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[double] identifier[d] operator[:] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[isNaN] operator[SEP] identifier[d] operator[SEP] operator[SEP] { identifier[c] operator[++] operator[SEP] } } Keyword[return] identifier[c] operator[SEP] }
public Observable<ServiceResponse<FlowLogInformationInner>> beginGetFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (networkWatcherName == null) { throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (targetResourceId == null) { throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null."); } final String apiVersion = "2017-10-01"; FlowLogStatusParameters parameters = new FlowLogStatusParameters(); parameters.withTargetResourceId(targetResourceId); return service.beginGetFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<FlowLogInformationInner>>>() { @Override public Observable<ServiceResponse<FlowLogInformationInner>> call(Response<ResponseBody> response) { try { ServiceResponse<FlowLogInformationInner> clientResponse = beginGetFlowLogStatusDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[beginGetFlowLogStatusWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, networkWatcherName, targetResourceId]] begin[{] if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and 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[member[.networkWatcherName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter networkWatcherName is required and 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[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and 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[member[.targetResourceId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter targetResourceId is required and 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[}] local_variable[type[String], apiVersion] local_variable[type[FlowLogStatusParameters], parameters] call[parameters.withTargetResourceId, parameter[member[.targetResourceId]]] return[call[service.beginGetFlowLogStatus, parameter[member[.resourceGroupName], member[.networkWatcherName], THIS[member[None.client]call[None.subscriptionId, parameter[]]], member[.apiVersion], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], member[.parameters], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[FlowLogInformationInner] operator[>] operator[>] identifier[beginGetFlowLogStatusWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[networkWatcherName] , identifier[String] identifier[targetResourceId] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[networkWatcherName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[targetResourceId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[apiVersion] operator[=] literal[String] operator[SEP] identifier[FlowLogStatusParameters] identifier[parameters] operator[=] Keyword[new] identifier[FlowLogStatusParameters] operator[SEP] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[withTargetResourceId] operator[SEP] identifier[targetResourceId] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[beginGetFlowLogStatus] operator[SEP] identifier[resourceGroupName] , identifier[networkWatcherName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[apiVersion] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , identifier[parameters] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[FlowLogInformationInner] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[FlowLogInformationInner] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[FlowLogInformationInner] operator[>] identifier[clientResponse] operator[=] identifier[beginGetFlowLogStatusDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
@Override public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException { // EE subsystem doesn't have any attributes, so make sure that the xml doesn't have any requireNoAttributes(reader); final ModelNode eeSubSystem = Util.createAddOperation(PathAddress.pathAddress(EeExtension.PATH_SUBSYSTEM)); // add the subsystem to the ModelNode(s) list.add(eeSubSystem); // elements final EnumSet<Element> encountered = EnumSet.noneOf(Element.class); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { switch (Namespace.forUri(reader.getNamespaceURI())) { case EE_1_0: { final Element element = Element.forName(reader.getLocalName()); if (!encountered.add(element)) { throw unexpectedElement(reader); } switch (element) { case GLOBAL_MODULES: { final ModelNode model = parseGlobalModules(reader); eeSubSystem.get(GlobalModulesDefinition.GLOBAL_MODULES).set(model); break; } case EAR_SUBDEPLOYMENTS_ISOLATED: { final String earSubDeploymentsIsolated = parseEarSubDeploymentsIsolatedElement(reader); // set the ear subdeployment isolation on the subsystem operation EeSubsystemRootResource.EAR_SUBDEPLOYMENTS_ISOLATED.parseAndSetParameter(earSubDeploymentsIsolated, eeSubSystem, reader); break; } default: { throw unexpectedElement(reader); } } break; } default: { throw unexpectedElement(reader); } } } }
class class_name[name] begin[{] method[readElement, return_type[void], modifier[public], parameter[reader, list]] begin[{] call[.requireNoAttributes, parameter[member[.reader]]] local_variable[type[ModelNode], eeSubSystem] call[list.add, parameter[member[.eeSubSystem]]] local_variable[type[EnumSet], encountered] while[binary_operation[call[reader.hasNext, parameter[]], &&, binary_operation[call[reader.nextTag, parameter[]], !=, member[.END_ELEMENT]]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['EE_1_0'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Element, selectors=[], type_arguments=None), name=element)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=['!'], qualifier=encountered, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unexpectedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=['GLOBAL_MODULES'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseGlobalModules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=model)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ModelNode, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=GLOBAL_MODULES, postfix_operators=[], prefix_operators=[], qualifier=GlobalModulesDefinition, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=eeSubSystem, selectors=[MethodInvocation(arguments=[MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['EAR_SUBDEPLOYMENTS_ISOLATED'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseEarSubDeploymentsIsolatedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=earSubDeploymentsIsolated)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=earSubDeploymentsIsolated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=eeSubSystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseAndSetParameter, postfix_operators=[], prefix_operators=[], qualifier=EeSubsystemRootResource.EAR_SUBDEPLOYMENTS_ISOLATED, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[], statements=[BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unexpectedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])])], expression=MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[], statements=[BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unexpectedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])])], expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNamespaceURI, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)], member=forUri, postfix_operators=[], prefix_operators=[], qualifier=Namespace, selectors=[], type_arguments=None), label=None) end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[readElement] operator[SEP] identifier[XMLExtendedStreamReader] identifier[reader] , identifier[List] operator[<] identifier[ModelNode] operator[>] identifier[list] operator[SEP] Keyword[throws] identifier[XMLStreamException] { identifier[requireNoAttributes] operator[SEP] identifier[reader] operator[SEP] operator[SEP] Keyword[final] identifier[ModelNode] identifier[eeSubSystem] operator[=] identifier[Util] operator[SEP] identifier[createAddOperation] operator[SEP] identifier[PathAddress] operator[SEP] identifier[pathAddress] operator[SEP] identifier[EeExtension] operator[SEP] identifier[PATH_SUBSYSTEM] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[eeSubSystem] operator[SEP] operator[SEP] Keyword[final] identifier[EnumSet] operator[<] identifier[Element] operator[>] identifier[encountered] operator[=] identifier[EnumSet] operator[SEP] identifier[noneOf] operator[SEP] identifier[Element] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[reader] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] identifier[reader] operator[SEP] identifier[nextTag] operator[SEP] operator[SEP] operator[!=] identifier[END_ELEMENT] operator[SEP] { Keyword[switch] operator[SEP] identifier[Namespace] operator[SEP] identifier[forUri] operator[SEP] identifier[reader] operator[SEP] identifier[getNamespaceURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[EE_1_0] operator[:] { Keyword[final] identifier[Element] identifier[element] operator[=] identifier[Element] operator[SEP] identifier[forName] operator[SEP] identifier[reader] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[encountered] operator[SEP] identifier[add] operator[SEP] identifier[element] operator[SEP] operator[SEP] { Keyword[throw] identifier[unexpectedElement] operator[SEP] identifier[reader] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[element] operator[SEP] { Keyword[case] identifier[GLOBAL_MODULES] operator[:] { Keyword[final] identifier[ModelNode] identifier[model] operator[=] identifier[parseGlobalModules] operator[SEP] identifier[reader] operator[SEP] operator[SEP] identifier[eeSubSystem] operator[SEP] identifier[get] operator[SEP] identifier[GlobalModulesDefinition] operator[SEP] identifier[GLOBAL_MODULES] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[model] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] identifier[EAR_SUBDEPLOYMENTS_ISOLATED] operator[:] { Keyword[final] identifier[String] identifier[earSubDeploymentsIsolated] operator[=] identifier[parseEarSubDeploymentsIsolatedElement] operator[SEP] identifier[reader] operator[SEP] operator[SEP] identifier[EeSubsystemRootResource] operator[SEP] identifier[EAR_SUBDEPLOYMENTS_ISOLATED] operator[SEP] identifier[parseAndSetParameter] operator[SEP] identifier[earSubDeploymentsIsolated] , identifier[eeSubSystem] , identifier[reader] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[default] operator[:] { Keyword[throw] identifier[unexpectedElement] operator[SEP] identifier[reader] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] } Keyword[default] operator[:] { Keyword[throw] identifier[unexpectedElement] operator[SEP] identifier[reader] operator[SEP] operator[SEP] } } } }
public Observable<RegistryUsageListResultInner> listUsagesAsync(String resourceGroupName, String registryName) { return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1<ServiceResponse<RegistryUsageListResultInner>, RegistryUsageListResultInner>() { @Override public RegistryUsageListResultInner call(ServiceResponse<RegistryUsageListResultInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[listUsagesAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, registryName]] begin[{] return[call[.listUsagesWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.registryName]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[RegistryUsageListResultInner] operator[>] identifier[listUsagesAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[registryName] operator[SEP] { Keyword[return] identifier[listUsagesWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[registryName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[RegistryUsageListResultInner] operator[>] , identifier[RegistryUsageListResultInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[RegistryUsageListResultInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[RegistryUsageListResultInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public void deallocate(long block) throws IOException { int size; if (readOnly) { throw (new FileManagerException("Attempt to deallocate in read only mode")); } block = block - HDR_SIZE; if (block < FIRST_TAIL) { throw (new FileManagerException("Illegal block address passed to deallocate")); } size = get_block_size(block); if (size >= 0) { throw (new FileManagerException("Attempt to deallocate block with illegal size")); } size = abs(size); deallocs++; seek_and_count(block); writeInt(size); add_to_freelist(block, size); allocated_blocks--; allocated_words -= size; }
class class_name[name] begin[{] method[deallocate, return_type[void], modifier[public], parameter[block]] begin[{] local_variable[type[int], size] if[member[.readOnly]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attempt to deallocate in read only mode")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileManagerException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.block], binary_operation[member[.block], -, member[.HDR_SIZE]]] if[binary_operation[member[.block], <, member[.FIRST_TAIL]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Illegal block address passed to deallocate")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileManagerException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.size], call[.get_block_size, parameter[member[.block]]]] if[binary_operation[member[.size], >=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attempt to deallocate block with illegal size")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileManagerException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.size], call[.abs, parameter[member[.size]]]] member[.deallocs] call[.seek_and_count, parameter[member[.block]]] call[.writeInt, parameter[member[.size]]] call[.add_to_freelist, parameter[member[.block], member[.size]]] member[.allocated_blocks] assign[member[.allocated_words], member[.size]] end[}] END[}]
Keyword[public] Keyword[void] identifier[deallocate] operator[SEP] Keyword[long] identifier[block] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[size] operator[SEP] Keyword[if] operator[SEP] identifier[readOnly] operator[SEP] { Keyword[throw] operator[SEP] Keyword[new] identifier[FileManagerException] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } identifier[block] operator[=] identifier[block] operator[-] identifier[HDR_SIZE] operator[SEP] Keyword[if] operator[SEP] identifier[block] operator[<] identifier[FIRST_TAIL] operator[SEP] { Keyword[throw] operator[SEP] Keyword[new] identifier[FileManagerException] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } identifier[size] operator[=] identifier[get_block_size] operator[SEP] identifier[block] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[>=] Other[0] operator[SEP] { Keyword[throw] operator[SEP] Keyword[new] identifier[FileManagerException] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } identifier[size] operator[=] identifier[abs] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[deallocs] operator[++] operator[SEP] identifier[seek_and_count] operator[SEP] identifier[block] operator[SEP] operator[SEP] identifier[writeInt] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[add_to_freelist] operator[SEP] identifier[block] , identifier[size] operator[SEP] operator[SEP] identifier[allocated_blocks] operator[--] operator[SEP] identifier[allocated_words] operator[-=] identifier[size] operator[SEP] }
public Plan selectPlan(PlanSelectionPolicy policy) { Plan plan = null; int index = 0; switch (policy) { case FIRST: case LAST: Plan[] plans = bindings.keySet().toArray(new Plan[0]); plan = (policy == PlanSelectionPolicy.FIRST) ? plans[0] : plans[plans.length - 1]; index = (policy == PlanSelectionPolicy.FIRST) ? 0 : plans.length - 1; setPlanVariables(plan.getAgent(), plan, bindings.get(plan), index); break; case RANDOM: plan = selectPlanAtRandom(); break; default: // TODO: ignore remaining polic break; } return plan; }
class class_name[name] begin[{] method[selectPlan, return_type[type[Plan]], modifier[public], parameter[policy]] begin[{] local_variable[type[Plan], plan] local_variable[type[int], index] SwitchStatement(cases=[SwitchStatementCase(case=['FIRST', 'LAST'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=bindings, selectors=[MethodInvocation(arguments=[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=Plan, sub_type=None))], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=plans)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Plan, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=plan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=policy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=FIRST, postfix_operators=[], prefix_operators=[], qualifier=PlanSelectionPolicy, selectors=[]), operator===), if_false=MemberReference(member=plans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=plans, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), if_true=MemberReference(member=plans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=policy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=FIRST, postfix_operators=[], prefix_operators=[], qualifier=PlanSelectionPolicy, selectors=[]), operator===), if_false=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=plans, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAgent, postfix_operators=[], prefix_operators=[], qualifier=plan, selectors=[], type_arguments=None), MemberReference(member=plan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=plan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=bindings, selectors=[], type_arguments=None), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setPlanVariables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['RANDOM'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=plan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=selectPlanAtRandom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MemberReference(member=policy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[member[.plan]] end[}] END[}]
Keyword[public] identifier[Plan] identifier[selectPlan] operator[SEP] identifier[PlanSelectionPolicy] identifier[policy] operator[SEP] { identifier[Plan] identifier[plan] operator[=] Other[null] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[switch] operator[SEP] identifier[policy] operator[SEP] { Keyword[case] identifier[FIRST] operator[:] Keyword[case] identifier[LAST] operator[:] identifier[Plan] operator[SEP] operator[SEP] identifier[plans] operator[=] identifier[bindings] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Plan] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[plan] operator[=] operator[SEP] identifier[policy] operator[==] identifier[PlanSelectionPolicy] operator[SEP] identifier[FIRST] operator[SEP] operator[?] identifier[plans] operator[SEP] Other[0] operator[SEP] operator[:] identifier[plans] operator[SEP] identifier[plans] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[index] operator[=] operator[SEP] identifier[policy] operator[==] identifier[PlanSelectionPolicy] operator[SEP] identifier[FIRST] operator[SEP] operator[?] Other[0] operator[:] identifier[plans] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[setPlanVariables] operator[SEP] identifier[plan] operator[SEP] identifier[getAgent] operator[SEP] operator[SEP] , identifier[plan] , identifier[bindings] operator[SEP] identifier[get] operator[SEP] identifier[plan] operator[SEP] , identifier[index] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[RANDOM] operator[:] identifier[plan] operator[=] identifier[selectPlanAtRandom] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP] } Keyword[return] identifier[plan] operator[SEP] }
public Observable<ServiceResponse<FoundFaces>> findFacesWithServiceResponseAsync(FindFacesOptionalParameter findFacesOptionalParameter) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and cannot be null."); } final Boolean cacheImage = findFacesOptionalParameter != null ? findFacesOptionalParameter.cacheImage() : null; return findFacesWithServiceResponseAsync(cacheImage); }
class class_name[name] begin[{] method[findFacesWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[findFacesOptionalParameter]] begin[{] if[binary_operation[THIS[member[None.client]call[None.baseUrl, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.baseUrl() is required and 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[}] local_variable[type[Boolean], cacheImage] return[call[.findFacesWithServiceResponseAsync, parameter[member[.cacheImage]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[FoundFaces] operator[>] operator[>] identifier[findFacesWithServiceResponseAsync] operator[SEP] identifier[FindFacesOptionalParameter] identifier[findFacesOptionalParameter] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[baseUrl] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[Boolean] identifier[cacheImage] operator[=] identifier[findFacesOptionalParameter] operator[!=] Other[null] operator[?] identifier[findFacesOptionalParameter] operator[SEP] identifier[cacheImage] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[return] identifier[findFacesWithServiceResponseAsync] operator[SEP] identifier[cacheImage] operator[SEP] operator[SEP] }
public void checkout(@Nonnull Run<?,?> build, @Nonnull Launcher launcher, @Nonnull FilePath workspace, @Nonnull TaskListener listener, @CheckForNull File changelogFile, @CheckForNull SCMRevisionState baseline) throws IOException, InterruptedException { if (build instanceof AbstractBuild && listener instanceof BuildListener && Util.isOverridden(SCM.class, getClass(), "checkout", AbstractBuild.class, Launcher.class, FilePath.class, BuildListener.class, File.class)) { if (changelogFile == null) { changelogFile = File.createTempFile("changelog", ".xml"); try { if (!checkout((AbstractBuild) build, launcher, workspace, (BuildListener) listener, changelogFile)) { throw new AbortException(); } } finally { Util.deleteFile(changelogFile); } } else { if (!checkout((AbstractBuild) build, launcher, workspace, (BuildListener) listener, changelogFile)) { throw new AbortException(); } } } else { throw new AbstractMethodError("you must override the new overload of checkout"); } }
class class_name[name] begin[{] method[checkout, return_type[void], modifier[public], parameter[build, launcher, workspace, listener, changelogFile, baseline]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.build], instanceof, type[AbstractBuild]], &&, binary_operation[member[.listener], instanceof, type[BuildListener]]], &&, call[Util.isOverridden, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SCM, sub_type=None)), call[.getClass, parameter[]], literal["checkout"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractBuild, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Launcher, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FilePath, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BuildListener, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]]]] begin[{] if[binary_operation[member[.changelogFile], ==, literal[null]]] begin[{] assign[member[.changelogFile], call[File.createTempFile, parameter[literal["changelog"], literal[".xml"]]]] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[Cast(expression=MemberReference(member=build, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractBuild, sub_type=None)), MemberReference(member=launcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=workspace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BuildListener, sub_type=None)), MemberReference(member=changelogFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkout, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_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=AbortException, sub_type=None)), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=changelogFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteFile, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] if[call[.checkout, parameter[Cast(expression=MemberReference(member=build, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractBuild, sub_type=None)), member[.launcher], member[.workspace], Cast(expression=MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BuildListener, sub_type=None)), member[.changelogFile]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbortException, sub_type=None)), label=None) else begin[{] None end[}] end[}] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="you must override the new overload of checkout")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractMethodError, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[checkout] operator[SEP] annotation[@] identifier[Nonnull] identifier[Run] operator[<] operator[?] , operator[?] operator[>] identifier[build] , annotation[@] identifier[Nonnull] identifier[Launcher] identifier[launcher] , annotation[@] identifier[Nonnull] identifier[FilePath] identifier[workspace] , annotation[@] identifier[Nonnull] identifier[TaskListener] identifier[listener] , annotation[@] identifier[CheckForNull] identifier[File] identifier[changelogFile] , annotation[@] identifier[CheckForNull] identifier[SCMRevisionState] identifier[baseline] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] { Keyword[if] operator[SEP] identifier[build] Keyword[instanceof] identifier[AbstractBuild] operator[&&] identifier[listener] Keyword[instanceof] identifier[BuildListener] operator[&&] identifier[Util] operator[SEP] identifier[isOverridden] operator[SEP] identifier[SCM] operator[SEP] Keyword[class] , identifier[getClass] operator[SEP] operator[SEP] , literal[String] , identifier[AbstractBuild] operator[SEP] Keyword[class] , identifier[Launcher] operator[SEP] Keyword[class] , identifier[FilePath] operator[SEP] Keyword[class] , identifier[BuildListener] operator[SEP] Keyword[class] , identifier[File] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[changelogFile] operator[==] Other[null] operator[SEP] { identifier[changelogFile] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[checkout] operator[SEP] operator[SEP] identifier[AbstractBuild] operator[SEP] identifier[build] , identifier[launcher] , identifier[workspace] , operator[SEP] identifier[BuildListener] operator[SEP] identifier[listener] , identifier[changelogFile] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[AbortException] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[Util] operator[SEP] identifier[deleteFile] operator[SEP] identifier[changelogFile] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[checkout] operator[SEP] operator[SEP] identifier[AbstractBuild] operator[SEP] identifier[build] , identifier[launcher] , identifier[workspace] , operator[SEP] identifier[BuildListener] operator[SEP] identifier[listener] , identifier[changelogFile] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[AbortException] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] { Keyword[throw] Keyword[new] identifier[AbstractMethodError] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public void setupAll(Connection connection, Statement statement) throws SQLException { for (Object key : mappings.keySet()) { Parameter parameter = mappings.get(key); if (parameter.getInput() != null) { Object value = parameter.getInput().getValue(); Converter encoder = parameter.getEncoder(); if (encoder != null) { value = encoder.perform(connection, value); } statement.in(key, value, parameter.getType()); } if (parameter.getOutput() != null) { Integer sqlType = parameter.getType(); String structName = parameter.getStruct(); statement.out(key, sqlType, structName); } } }
class class_name[name] begin[{] method[setupAll, return_type[void], modifier[public], parameter[connection, statement]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mappings, selectors=[], type_arguments=None), name=parameter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Parameter, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getInput, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInput, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[MethodInvocation(arguments=[], member=getValue, 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=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEncoder, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), name=encoder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Converter, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=encoder, 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=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=perform, postfix_operators=[], prefix_operators=[], qualifier=encoder, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None)], member=in, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getOutput, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), name=sqlType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getStruct, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), name=structName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sqlType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=structName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=out, postfix_operators=[], prefix_operators=[], qualifier=statement, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=mappings, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setupAll] operator[SEP] identifier[Connection] identifier[connection] , identifier[Statement] identifier[statement] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[for] operator[SEP] identifier[Object] identifier[key] operator[:] identifier[mappings] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Parameter] identifier[parameter] operator[=] identifier[mappings] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parameter] operator[SEP] identifier[getInput] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[Object] identifier[value] operator[=] identifier[parameter] operator[SEP] identifier[getInput] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[Converter] identifier[encoder] operator[=] identifier[parameter] operator[SEP] identifier[getEncoder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[encoder] operator[!=] Other[null] operator[SEP] { identifier[value] operator[=] identifier[encoder] operator[SEP] identifier[perform] operator[SEP] identifier[connection] , identifier[value] operator[SEP] operator[SEP] } identifier[statement] operator[SEP] identifier[in] operator[SEP] identifier[key] , identifier[value] , identifier[parameter] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[parameter] operator[SEP] identifier[getOutput] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[Integer] identifier[sqlType] operator[=] identifier[parameter] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[structName] operator[=] identifier[parameter] operator[SEP] identifier[getStruct] operator[SEP] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[out] operator[SEP] identifier[key] , identifier[sqlType] , identifier[structName] operator[SEP] operator[SEP] } } }
public static Class<?> commonBase(Class<?> a, Class<?> b) { Class<?> result; Class<?> ifc; if (b == null) { throw new IllegalArgumentException(); } else if (a == null) { return b; } else { result = commonSuperClass(a, b); if (Object.class.equals(result)) { ifc = commonInterfaces(a, b); if (ifc != null) { result = ifc; } } return result; } }
class class_name[name] begin[{] method[commonBase, return_type[type[Class]], modifier[public static], parameter[a, b]] begin[{] local_variable[type[Class], result] local_variable[type[Class], ifc] if[binary_operation[member[.b], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], 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[{] if[binary_operation[member[.a], ==, literal[null]]] begin[{] return[member[.b]] else begin[{] assign[member[.result], call[.commonSuperClass, parameter[member[.a], member[.b]]]] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))] begin[{] assign[member[.ifc], call[.commonInterfaces, parameter[member[.a], member[.b]]]] if[binary_operation[member[.ifc], !=, literal[null]]] begin[{] assign[member[.result], member[.ifc]] else begin[{] None end[}] else begin[{] None end[}] return[member[.result]] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] identifier[commonBase] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[a] , identifier[Class] operator[<] operator[?] operator[>] identifier[b] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[result] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[ifc] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[a] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[b] operator[SEP] } Keyword[else] { identifier[result] operator[=] identifier[commonSuperClass] operator[SEP] identifier[a] , identifier[b] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[result] operator[SEP] operator[SEP] { identifier[ifc] operator[=] identifier[commonInterfaces] operator[SEP] identifier[a] , identifier[b] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ifc] operator[!=] Other[null] operator[SEP] { identifier[result] operator[=] identifier[ifc] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] } }
public String toExternalForm() { // pre-compute length of StringBuffer int len = this.getProtocol().length() + 1; if (this.getAuthority() != null && this.getAuthority().length() > 0) { len += 2 + this.getAuthority().length(); } if (this.getPath() != null) { len += this.getPath().length(); } if (this.getQuery() != null) { len += 1 + this.getQuery().length(); } if (this.getRef() != null) { len += 1 + this.getRef().length(); } final StringBuffer result = new StringBuffer(len); result.append(this.getProtocol()); result.append(':'); if (this.getAuthority() != null && this.getAuthority().length() > 0) { result.append("//"); result.append(this.getAuthority()); } if (this.getPath() != null) { result.append(this.getPath()); } if (this.getQuery() != null) { result.append('?'); result.append(this.getQuery()); } if (this.getRef() != null) { result.append('#'); result.append(this.getRef()); } return result.toString(); }
class class_name[name] begin[{] method[toExternalForm, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[int], len] if[binary_operation[binary_operation[THIS[call[None.getAuthority, parameter[]]], !=, literal[null]], &&, binary_operation[THIS[call[None.getAuthority, parameter[]]call[None.length, parameter[]]], >, literal[0]]]] begin[{] assign[member[.len], binary_operation[literal[2], +, THIS[call[None.getAuthority, parameter[]]call[None.length, parameter[]]]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getPath, parameter[]]], !=, literal[null]]] begin[{] assign[member[.len], THIS[call[None.getPath, parameter[]]call[None.length, parameter[]]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getQuery, parameter[]]], !=, literal[null]]] begin[{] assign[member[.len], binary_operation[literal[1], +, THIS[call[None.getQuery, parameter[]]call[None.length, parameter[]]]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getRef, parameter[]]], !=, literal[null]]] begin[{] assign[member[.len], binary_operation[literal[1], +, THIS[call[None.getRef, parameter[]]call[None.length, parameter[]]]]] else begin[{] None end[}] local_variable[type[StringBuffer], result] call[result.append, parameter[THIS[call[None.getProtocol, parameter[]]]]] call[result.append, parameter[literal[':']]] if[binary_operation[binary_operation[THIS[call[None.getAuthority, parameter[]]], !=, literal[null]], &&, binary_operation[THIS[call[None.getAuthority, parameter[]]call[None.length, parameter[]]], >, literal[0]]]] begin[{] call[result.append, parameter[literal["//"]]] call[result.append, parameter[THIS[call[None.getAuthority, parameter[]]]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getPath, parameter[]]], !=, literal[null]]] begin[{] call[result.append, parameter[THIS[call[None.getPath, parameter[]]]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getQuery, parameter[]]], !=, literal[null]]] begin[{] call[result.append, parameter[literal['?']]] call[result.append, parameter[THIS[call[None.getQuery, parameter[]]]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getRef, parameter[]]], !=, literal[null]]] begin[{] call[result.append, parameter[literal['#']]] call[result.append, parameter[THIS[call[None.getRef, parameter[]]]]] else begin[{] None end[}] return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[toExternalForm] operator[SEP] operator[SEP] { Keyword[int] identifier[len] operator[=] Keyword[this] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[len] operator[+=] Other[2] operator[+] Keyword[this] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[len] operator[+=] Keyword[this] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[len] operator[+=] Other[1] operator[+] Keyword[this] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getRef] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[len] operator[+=] Other[1] operator[+] Keyword[this] operator[SEP] identifier[getRef] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[StringBuffer] identifier[result] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[len] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getRef] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[getRef] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private void addPostParams(final Request request) { if (to != null) { request.addPostParam("To", to); } if (channel != null) { request.addPostParam("Channel", channel); } if (customMessage != null) { request.addPostParam("CustomMessage", customMessage); } }
class class_name[name] begin[{] method[addPostParams, return_type[void], modifier[private], parameter[request]] begin[{] if[binary_operation[member[.to], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["To"], member[.to]]] else begin[{] None end[}] if[binary_operation[member[.channel], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["Channel"], member[.channel]]] else begin[{] None end[}] if[binary_operation[member[.customMessage], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["CustomMessage"], member[.customMessage]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[addPostParams] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] { Keyword[if] operator[SEP] identifier[to] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[to] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[channel] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[channel] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[customMessage] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[customMessage] operator[SEP] operator[SEP] } }
public static String join(String separator, List<String> topicsArray) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < topicsArray.size(); i++) { if (sb.length() > 0) { sb.append(","); } sb.append(topicsArray.get(i)); } return sb.toString(); }
class class_name[name] begin[{] method[join, return_type[type[String]], modifier[public static], parameter[separator, topicsArray]] begin[{] local_variable[type[StringBuilder], sb] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=topicsArray, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=topicsArray, selectors=[], type_arguments=None), 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[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[join] operator[SEP] identifier[String] identifier[separator] , identifier[List] operator[<] identifier[String] operator[>] identifier[topicsArray] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[topicsArray] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[topicsArray] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
@Override public void stop(final Throwable exception) { LOG.entering(CLASS_NAME, "stop"); synchronized (this.schedule) { if (this.isClosed) { LOG.log(Level.FINEST, "Clock has already been closed"); return; } this.isClosed = true; this.exceptionCausedStop = exception; final Time stopEvent = new StopTime(this.timer.getCurrent()); LOG.log(Level.FINE, "Stop scheduled immediately: {0} Outstanding client alarms: {1}", new Object[] {stopEvent, this.numClientAlarms}); assert this.numClientAlarms >= 0; this.numClientAlarms = 0; this.schedule.clear(); this.schedule.add(stopEvent); this.schedule.notify(); } LOG.exiting(CLASS_NAME, "stop"); }
class class_name[name] begin[{] method[stop, return_type[void], modifier[public], parameter[exception]] begin[{] call[LOG.entering, parameter[member[.CLASS_NAME], literal["stop"]]] SYNCHRONIZED[THIS[member[None.schedule]]] BEGIN[{] if[THIS[member[None.isClosed]]] begin[{] call[LOG.log, parameter[member[Level.FINEST], literal["Clock has already been closed"]]] return[None] else begin[{] None end[}] assign[THIS[member[None.isClosed]], literal[true]] assign[THIS[member[None.exceptionCausedStop]], member[.exception]] local_variable[type[Time], stopEvent] call[LOG.log, parameter[member[Level.FINE], literal["Stop scheduled immediately: {0} Outstanding client alarms: {1}"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=stopEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=numClientAlarms, 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))]] AssertStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=numClientAlarms, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None, value=None) assign[THIS[member[None.numClientAlarms]], literal[0]] THIS[member[None.schedule]call[None.clear, parameter[]]] THIS[member[None.schedule]call[None.add, parameter[member[.stopEvent]]]] THIS[member[None.schedule]call[None.notify, parameter[]]] END[}] call[LOG.exiting, parameter[member[.CLASS_NAME], literal["stop"]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[stop] operator[SEP] Keyword[final] identifier[Throwable] identifier[exception] operator[SEP] { identifier[LOG] operator[SEP] identifier[entering] operator[SEP] identifier[CLASS_NAME] , literal[String] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[schedule] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isClosed] operator[SEP] { identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[isClosed] operator[=] literal[boolean] operator[SEP] Keyword[this] operator[SEP] identifier[exceptionCausedStop] operator[=] identifier[exception] operator[SEP] Keyword[final] identifier[Time] identifier[stopEvent] operator[=] Keyword[new] identifier[StopTime] operator[SEP] Keyword[this] operator[SEP] identifier[timer] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[stopEvent] , Keyword[this] operator[SEP] identifier[numClientAlarms] } operator[SEP] operator[SEP] Keyword[assert] Keyword[this] operator[SEP] identifier[numClientAlarms] operator[>=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[numClientAlarms] operator[=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[schedule] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[schedule] operator[SEP] identifier[add] operator[SEP] identifier[stopEvent] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[schedule] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[exiting] operator[SEP] identifier[CLASS_NAME] , literal[String] operator[SEP] operator[SEP] }
public List<CmsResource> getUsersPubList(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException { synchronized (m_publishListUpdateLock) { updateLog(dbc); return m_projectDriver.getUsersPubList(dbc, userId); } }
class class_name[name] begin[{] method[getUsersPubList, return_type[type[List]], modifier[public], parameter[dbc, userId]] begin[{] SYNCHRONIZED[member[.m_publishListUpdateLock]] BEGIN[{] call[.updateLog, parameter[member[.dbc]]] return[call[m_projectDriver.getUsersPubList, parameter[member[.dbc], member[.userId]]]] END[}] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[getUsersPubList] operator[SEP] identifier[CmsDbContext] identifier[dbc] , identifier[CmsUUID] identifier[userId] operator[SEP] Keyword[throws] identifier[CmsDataAccessException] { Keyword[synchronized] operator[SEP] identifier[m_publishListUpdateLock] operator[SEP] { identifier[updateLog] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] Keyword[return] identifier[m_projectDriver] operator[SEP] identifier[getUsersPubList] operator[SEP] identifier[dbc] , identifier[userId] operator[SEP] operator[SEP] } }
public AuthorizedList addResource(String theResource) { Validate.notNull(theResource, "theResource must not be null"); if (myAllowedInstances == null) { myAllowedInstances = new ArrayList<>(); } myAllowedInstances.add(theResource); return this; }
class class_name[name] begin[{] method[addResource, return_type[type[AuthorizedList]], modifier[public], parameter[theResource]] begin[{] call[Validate.notNull, parameter[member[.theResource], literal["theResource must not be null"]]] if[binary_operation[member[.myAllowedInstances], ==, literal[null]]] begin[{] assign[member[.myAllowedInstances], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] call[myAllowedInstances.add, parameter[member[.theResource]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[AuthorizedList] identifier[addResource] operator[SEP] identifier[String] identifier[theResource] operator[SEP] { identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[theResource] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[myAllowedInstances] operator[==] Other[null] operator[SEP] { identifier[myAllowedInstances] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[myAllowedInstances] operator[SEP] identifier[add] operator[SEP] identifier[theResource] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private void createAnalyzers(final AnalysisJobBuilder ajb, final Class<? extends Analyzer<?>> analyzerClass, final List<InputColumn<?>> columns) { final int columnsPerAnalyzer = getColumnsPerAnalyzer(); AnalyzerComponentBuilder<?> analyzerJobBuilder = ajb.addAnalyzer(analyzerClass); int columnCount = 0; for (final InputColumn<?> inputColumn : columns) { if (columnCount == columnsPerAnalyzer) { analyzerJobBuilder = ajb.addAnalyzer(analyzerClass); columnCount = 0; } analyzerJobBuilder.addInputColumn(inputColumn); if (isIncludeValueDistribution()) { ajb.addAnalyzer(ValueDistributionAnalyzer.class).addInputColumn(inputColumn); } if (inputColumn.getDataType() == String.class && isIncludePatternFinder()) { ajb.addAnalyzer(PatternFinderAnalyzer.class).addInputColumn(inputColumn); } columnCount++; } }
class class_name[name] begin[{] method[createAnalyzers, return_type[void], modifier[private], parameter[ajb, analyzerClass, columns]] begin[{] local_variable[type[int], columnsPerAnalyzer] local_variable[type[AnalyzerComponentBuilder], analyzerJobBuilder] local_variable[type[int], columnCount] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=columnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=columnsPerAnalyzer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=analyzerJobBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=analyzerClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAnalyzer, postfix_operators=[], prefix_operators=[], qualifier=ajb, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=columnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=inputColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addInputColumn, postfix_operators=[], prefix_operators=[], qualifier=analyzerJobBuilder, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isIncludeValueDistribution, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValueDistributionAnalyzer, sub_type=None))], member=addAnalyzer, postfix_operators=[], prefix_operators=[], qualifier=ajb, selectors=[MethodInvocation(arguments=[MemberReference(member=inputColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addInputColumn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDataType, postfix_operators=[], prefix_operators=[], qualifier=inputColumn, selectors=[], type_arguments=None), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), operator===), operandr=MethodInvocation(arguments=[], member=isIncludePatternFinder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PatternFinderAnalyzer, sub_type=None))], member=addAnalyzer, postfix_operators=[], prefix_operators=[], qualifier=ajb, selectors=[MethodInvocation(arguments=[MemberReference(member=inputColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addInputColumn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=MemberReference(member=columnCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=inputColumn)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=InputColumn, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[createAnalyzers] operator[SEP] Keyword[final] identifier[AnalysisJobBuilder] identifier[ajb] , Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Analyzer] operator[<] operator[?] operator[>] operator[>] identifier[analyzerClass] , Keyword[final] identifier[List] operator[<] identifier[InputColumn] operator[<] operator[?] operator[>] operator[>] identifier[columns] operator[SEP] { Keyword[final] Keyword[int] identifier[columnsPerAnalyzer] operator[=] identifier[getColumnsPerAnalyzer] operator[SEP] operator[SEP] operator[SEP] identifier[AnalyzerComponentBuilder] operator[<] operator[?] operator[>] identifier[analyzerJobBuilder] operator[=] identifier[ajb] operator[SEP] identifier[addAnalyzer] operator[SEP] identifier[analyzerClass] operator[SEP] operator[SEP] Keyword[int] identifier[columnCount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[InputColumn] operator[<] operator[?] operator[>] identifier[inputColumn] operator[:] identifier[columns] operator[SEP] { Keyword[if] operator[SEP] identifier[columnCount] operator[==] identifier[columnsPerAnalyzer] operator[SEP] { identifier[analyzerJobBuilder] operator[=] identifier[ajb] operator[SEP] identifier[addAnalyzer] operator[SEP] identifier[analyzerClass] operator[SEP] operator[SEP] identifier[columnCount] operator[=] Other[0] operator[SEP] } identifier[analyzerJobBuilder] operator[SEP] identifier[addInputColumn] operator[SEP] identifier[inputColumn] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isIncludeValueDistribution] operator[SEP] operator[SEP] operator[SEP] { identifier[ajb] operator[SEP] identifier[addAnalyzer] operator[SEP] identifier[ValueDistributionAnalyzer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[addInputColumn] operator[SEP] identifier[inputColumn] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[inputColumn] operator[SEP] identifier[getDataType] operator[SEP] operator[SEP] operator[==] identifier[String] operator[SEP] Keyword[class] operator[&&] identifier[isIncludePatternFinder] operator[SEP] operator[SEP] operator[SEP] { identifier[ajb] operator[SEP] identifier[addAnalyzer] operator[SEP] identifier[PatternFinderAnalyzer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[addInputColumn] operator[SEP] identifier[inputColumn] operator[SEP] operator[SEP] } identifier[columnCount] operator[++] operator[SEP] } }
public static boolean isValidJsonStrict(String s) { try { new JSONParser(MODE_RFC4627).parse(s, FakeMapper.DEFAULT); return true; } catch (ParseException e) { return false; } }
class class_name[name] begin[{] method[isValidJsonStrict, return_type[type[boolean]], modifier[public static], parameter[s]] begin[{] TryStatement(block=[StatementExpression(expression=ClassCreator(arguments=[MemberReference(member=MODE_RFC4627, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT, postfix_operators=[], prefix_operators=[], qualifier=FakeMapper, selectors=[])], member=parse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JSONParser, sub_type=None)), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isValidJsonStrict] operator[SEP] identifier[String] identifier[s] operator[SEP] { Keyword[try] { Keyword[new] identifier[JSONParser] operator[SEP] identifier[MODE_RFC4627] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[s] , identifier[FakeMapper] operator[SEP] identifier[DEFAULT] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[ParseException] identifier[e] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } }
public static void print( IntegralKernel kernel ) { int x0 = 0,x1=0,y0=0,y1=0; for( ImageRectangle k : kernel.blocks) { if( k.x0 < x0 ) x0 = k.x0; if( k.y0 < y0 ) y0 = k.y0; if( k.x1 > x1 ) x1 = k.x1; if( k.y1 > y1 ) y1 = k.y1; } int w = x1-x0; int h = y1-y0; int sum[] = new int[ w*h ]; for( int i = 0; i < kernel.blocks.length; i++ ) { ImageRectangle r = kernel.blocks[i]; int value = kernel.scales[i]; for( int y = r.y0; y < r.y1; y++ ) { int yy = y-y0; for( int x = r.x0; x < r.x1; x++ ) { int xx = x - x0; sum[ yy*w + xx ] += value; } } } System.out.println("IntegralKernel: TL = ("+(x0+1)+","+(y0+1)+") BR=("+x1+","+y1+")"); for( int y = 0; y < h; y++ ) { for( int x = 0; x < w; x++ ) { System.out.printf("%4d ",sum[y*w+x]); } System.out.println(); } }
class class_name[name] begin[{] method[print, return_type[void], modifier[public static], parameter[kernel]] begin[{] local_variable[type[int], x0] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=k, selectors=[]), operandr=MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=k, selectors=[])), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=y0, postfix_operators=[], prefix_operators=[], qualifier=k, selectors=[]), operandr=MemberReference(member=y0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=y0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=y0, postfix_operators=[], prefix_operators=[], qualifier=k, selectors=[])), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=k, selectors=[]), operandr=MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=k, selectors=[])), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=y1, postfix_operators=[], prefix_operators=[], qualifier=k, selectors=[]), operandr=MemberReference(member=y1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=y1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=y1, postfix_operators=[], prefix_operators=[], qualifier=k, selectors=[])), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=blocks, postfix_operators=[], prefix_operators=[], qualifier=kernel, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=k)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ImageRectangle, sub_type=None))), label=None) local_variable[type[int], w] local_variable[type[int], h] local_variable[type[int], sum] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=blocks, postfix_operators=[], prefix_operators=[], qualifier=kernel, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ImageRectangle, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=scales, postfix_operators=[], prefix_operators=[], qualifier=kernel, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=y0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=yy)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=xx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=yy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=xx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type=+=, value=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[]), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=y1, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=y0, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[]), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), 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=kernel.blocks, 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) call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["IntegralKernel: TL = ("], +, binary_operation[member[.x0], +, literal[1]]], +, literal[","]], +, binary_operation[member[.y0], +, literal[1]]], +, literal[") BR=("]], +, member[.x1]], +, literal[","]], +, member[.y1]], +, literal[")"]]]] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%4d "), MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))])], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=w, 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=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=h, 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=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[print] operator[SEP] identifier[IntegralKernel] identifier[kernel] operator[SEP] { Keyword[int] identifier[x0] operator[=] Other[0] , identifier[x1] operator[=] Other[0] , identifier[y0] operator[=] Other[0] , identifier[y1] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[ImageRectangle] identifier[k] operator[:] identifier[kernel] operator[SEP] identifier[blocks] operator[SEP] { Keyword[if] operator[SEP] identifier[k] operator[SEP] identifier[x0] operator[<] identifier[x0] operator[SEP] identifier[x0] operator[=] identifier[k] operator[SEP] identifier[x0] operator[SEP] Keyword[if] operator[SEP] identifier[k] operator[SEP] identifier[y0] operator[<] identifier[y0] operator[SEP] identifier[y0] operator[=] identifier[k] operator[SEP] identifier[y0] operator[SEP] Keyword[if] operator[SEP] identifier[k] operator[SEP] identifier[x1] operator[>] identifier[x1] operator[SEP] identifier[x1] operator[=] identifier[k] operator[SEP] identifier[x1] operator[SEP] Keyword[if] operator[SEP] identifier[k] operator[SEP] identifier[y1] operator[>] identifier[y1] operator[SEP] identifier[y1] operator[=] identifier[k] operator[SEP] identifier[y1] operator[SEP] } Keyword[int] identifier[w] operator[=] identifier[x1] operator[-] identifier[x0] operator[SEP] Keyword[int] identifier[h] operator[=] identifier[y1] operator[-] identifier[y0] operator[SEP] Keyword[int] identifier[sum] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[w] operator[*] identifier[h] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[kernel] operator[SEP] identifier[blocks] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ImageRectangle] identifier[r] operator[=] identifier[kernel] operator[SEP] identifier[blocks] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[value] operator[=] identifier[kernel] operator[SEP] identifier[scales] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] identifier[r] operator[SEP] identifier[y0] operator[SEP] identifier[y] operator[<] identifier[r] operator[SEP] identifier[y1] operator[SEP] identifier[y] operator[++] operator[SEP] { Keyword[int] identifier[yy] operator[=] identifier[y] operator[-] identifier[y0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] identifier[r] operator[SEP] identifier[x0] operator[SEP] identifier[x] operator[<] identifier[r] operator[SEP] identifier[x1] operator[SEP] identifier[x] operator[++] operator[SEP] { Keyword[int] identifier[xx] operator[=] identifier[x] operator[-] identifier[x0] operator[SEP] identifier[sum] operator[SEP] identifier[yy] operator[*] identifier[w] operator[+] identifier[xx] operator[SEP] operator[+=] identifier[value] operator[SEP] } } } identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] operator[SEP] identifier[x0] operator[+] Other[1] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[y0] operator[+] Other[1] operator[SEP] operator[+] literal[String] operator[+] identifier[x1] operator[+] literal[String] operator[+] identifier[y1] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[h] operator[SEP] identifier[y] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[w] operator[SEP] identifier[x] operator[++] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[sum] operator[SEP] identifier[y] operator[*] identifier[w] operator[+] identifier[x] operator[SEP] operator[SEP] operator[SEP] } identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP] } }
public void onItemBind(int position, T item) { if (onItemBind != null) { variableId = VAR_INVALID; layoutRes = LAYOUT_NONE; onItemBind.onItemBind(this, position, item); if (variableId == VAR_INVALID) { throw new IllegalStateException("variableId not set in onItemBind()"); } if (layoutRes == LAYOUT_NONE) { throw new IllegalStateException("layoutRes not set in onItemBind()"); } } }
class class_name[name] begin[{] method[onItemBind, return_type[void], modifier[public], parameter[position, item]] begin[{] if[binary_operation[member[.onItemBind], !=, literal[null]]] begin[{] assign[member[.variableId], member[.VAR_INVALID]] assign[member[.layoutRes], member[.LAYOUT_NONE]] call[onItemBind.onItemBind, parameter[THIS[], member[.position], member[.item]]] if[binary_operation[member[.variableId], ==, member[.VAR_INVALID]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="variableId not set in onItemBind()")], 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[}] if[binary_operation[member[.layoutRes], ==, member[.LAYOUT_NONE]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="layoutRes not set in onItemBind()")], 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[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[onItemBind] operator[SEP] Keyword[int] identifier[position] , identifier[T] identifier[item] operator[SEP] { Keyword[if] operator[SEP] identifier[onItemBind] operator[!=] Other[null] operator[SEP] { identifier[variableId] operator[=] identifier[VAR_INVALID] operator[SEP] identifier[layoutRes] operator[=] identifier[LAYOUT_NONE] operator[SEP] identifier[onItemBind] operator[SEP] identifier[onItemBind] operator[SEP] Keyword[this] , identifier[position] , identifier[item] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[variableId] operator[==] identifier[VAR_INVALID] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[layoutRes] operator[==] identifier[LAYOUT_NONE] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } }
public static Element drawCross(SVGPlot svgp, Projection2D proj, NumberVector mid, double radius) { final double[] v_mid = mid.toArray(); final long[] dims = proj.getVisibleDimensions2D(); SVGPath path = new SVGPath(); for(int dim = BitsUtil.nextSetBit(dims, 0); dim >= 0; dim = BitsUtil.nextSetBit(dims, dim + 1)) { v_mid[dim] += radius; double[] p1 = proj.fastProjectDataToRenderSpace(v_mid); v_mid[dim] -= radius * 2; double[] p2 = proj.fastProjectDataToRenderSpace(v_mid); v_mid[dim] += radius; path.moveTo(p1[0], p1[1]).drawTo(p2[0], p2[1]).close(); } return path.makeElement(svgp); }
class class_name[name] begin[{] method[drawCross, return_type[type[Element]], modifier[public static], parameter[svgp, proj, mid, radius]] begin[{] local_variable[type[double], v_mid] local_variable[type[long], dims] local_variable[type[SVGPath], path] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=v_mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=+=, value=MemberReference(member=radius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=v_mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fastProjectDataToRenderSpace, postfix_operators=[], prefix_operators=[], qualifier=proj, selectors=[], type_arguments=None), name=p1)], modifiers=set(), type=BasicType(dimensions=[None], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=v_mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=-=, value=BinaryOperation(operandl=MemberReference(member=radius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=v_mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fastProjectDataToRenderSpace, postfix_operators=[], prefix_operators=[], qualifier=proj, selectors=[], type_arguments=None), name=p2)], modifiers=set(), type=BasicType(dimensions=[None], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=v_mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=+=, value=MemberReference(member=radius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=p1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=p1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=moveTo, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[MethodInvocation(arguments=[MemberReference(member=p2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=p2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=drawTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=close, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[MemberReference(member=dims, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=nextSetBit, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None), name=dim)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dims, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=nextSetBit, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None))]), label=None) return[call[path.makeElement, parameter[member[.svgp]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Element] identifier[drawCross] operator[SEP] identifier[SVGPlot] identifier[svgp] , identifier[Projection2D] identifier[proj] , identifier[NumberVector] identifier[mid] , Keyword[double] identifier[radius] operator[SEP] { Keyword[final] Keyword[double] operator[SEP] operator[SEP] identifier[v_mid] operator[=] identifier[mid] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[dims] operator[=] identifier[proj] operator[SEP] identifier[getVisibleDimensions2D] operator[SEP] operator[SEP] operator[SEP] identifier[SVGPath] identifier[path] operator[=] Keyword[new] identifier[SVGPath] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[dim] operator[=] identifier[BitsUtil] operator[SEP] identifier[nextSetBit] operator[SEP] identifier[dims] , Other[0] operator[SEP] operator[SEP] identifier[dim] operator[>=] Other[0] operator[SEP] identifier[dim] operator[=] identifier[BitsUtil] operator[SEP] identifier[nextSetBit] operator[SEP] identifier[dims] , identifier[dim] operator[+] Other[1] operator[SEP] operator[SEP] { identifier[v_mid] operator[SEP] identifier[dim] operator[SEP] operator[+=] identifier[radius] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[p1] operator[=] identifier[proj] operator[SEP] identifier[fastProjectDataToRenderSpace] operator[SEP] identifier[v_mid] operator[SEP] operator[SEP] identifier[v_mid] operator[SEP] identifier[dim] operator[SEP] operator[-=] identifier[radius] operator[*] Other[2] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[p2] operator[=] identifier[proj] operator[SEP] identifier[fastProjectDataToRenderSpace] operator[SEP] identifier[v_mid] operator[SEP] operator[SEP] identifier[v_mid] operator[SEP] identifier[dim] operator[SEP] operator[+=] identifier[radius] operator[SEP] identifier[path] operator[SEP] identifier[moveTo] operator[SEP] identifier[p1] operator[SEP] Other[0] operator[SEP] , identifier[p1] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[drawTo] operator[SEP] identifier[p2] operator[SEP] Other[0] operator[SEP] , identifier[p2] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[path] operator[SEP] identifier[makeElement] operator[SEP] identifier[svgp] operator[SEP] operator[SEP] }
public ConsulResponse<List<CatalogService>> getService(@SuppressWarnings("SameParameterValue") final String serviceName) { return getService(serviceName, null, null, RequestOptions.BLANK); }
class class_name[name] begin[{] method[getService, return_type[type[ConsulResponse]], modifier[public], parameter[serviceName]] begin[{] return[call[.getService, parameter[member[.serviceName], literal[null], literal[null], member[RequestOptions.BLANK]]]] end[}] END[}]
Keyword[public] identifier[ConsulResponse] operator[<] identifier[List] operator[<] identifier[CatalogService] operator[>] operator[>] identifier[getService] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[serviceName] operator[SEP] { Keyword[return] identifier[getService] operator[SEP] identifier[serviceName] , Other[null] , Other[null] , identifier[RequestOptions] operator[SEP] identifier[BLANK] operator[SEP] operator[SEP] }
private void sendRequest(Object request, ContextualFuture future) { if (open && connection.open) { long requestId = ++this.requestId; futures.put(requestId, future); connection.handleRequest(requestId, request); } else { future.context.executor().execute(() -> future.completeExceptionally(new ConnectException("connection closed"))); } if (request instanceof ReferenceCounted) { ((ReferenceCounted<?>) request).release(); } }
class class_name[name] begin[{] method[sendRequest, return_type[void], modifier[private], parameter[request, future]] begin[{] if[binary_operation[member[.open], &&, member[connection.open]]] begin[{] local_variable[type[long], requestId] call[futures.put, parameter[member[.requestId], member[.future]]] call[connection.handleRequest, parameter[member[.requestId], member[.request]]] else begin[{] call[future.context.executor, parameter[]] end[}] if[binary_operation[member[.request], instanceof, type[ReferenceCounted]]] begin[{] Cast(expression=MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ReferenceCounted, sub_type=None)) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[sendRequest] operator[SEP] identifier[Object] identifier[request] , identifier[ContextualFuture] identifier[future] operator[SEP] { Keyword[if] operator[SEP] identifier[open] operator[&&] identifier[connection] operator[SEP] identifier[open] operator[SEP] { Keyword[long] identifier[requestId] operator[=] operator[++] Keyword[this] operator[SEP] identifier[requestId] operator[SEP] identifier[futures] operator[SEP] identifier[put] operator[SEP] identifier[requestId] , identifier[future] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[handleRequest] operator[SEP] identifier[requestId] , identifier[request] operator[SEP] operator[SEP] } Keyword[else] { identifier[future] operator[SEP] identifier[context] operator[SEP] identifier[executor] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[future] operator[SEP] identifier[completeExceptionally] operator[SEP] Keyword[new] identifier[ConnectException] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[request] Keyword[instanceof] identifier[ReferenceCounted] operator[SEP] { operator[SEP] operator[SEP] identifier[ReferenceCounted] operator[<] operator[?] operator[>] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP] } }
public static int getInteger(String pStr, int defval) { if (isEmpty(pStr)) return defval; try { return Integer.parseInt(pStr); } catch (NumberFormatException nm) { return defval; } }
class class_name[name] begin[{] method[getInteger, return_type[type[int]], modifier[public static], parameter[pStr, defval]] begin[{] if[call[.isEmpty, parameter[member[.pStr]]]] begin[{] return[member[.defval]] else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=pStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=defval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nm, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[getInteger] operator[SEP] identifier[String] identifier[pStr] , Keyword[int] identifier[defval] operator[SEP] { Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] identifier[pStr] operator[SEP] operator[SEP] Keyword[return] identifier[defval] operator[SEP] Keyword[try] { Keyword[return] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[pStr] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[nm] operator[SEP] { Keyword[return] identifier[defval] operator[SEP] } }
public void marshall(CreateConnectorDefinitionRequest createConnectorDefinitionRequest, ProtocolMarshaller protocolMarshaller) { if (createConnectorDefinitionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createConnectorDefinitionRequest.getAmznClientToken(), AMZNCLIENTTOKEN_BINDING); protocolMarshaller.marshall(createConnectorDefinitionRequest.getInitialVersion(), INITIALVERSION_BINDING); protocolMarshaller.marshall(createConnectorDefinitionRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createConnectorDefinitionRequest.getTags(), TAGS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[createConnectorDefinitionRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.createConnectorDefinitionRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAmznClientToken, postfix_operators=[], prefix_operators=[], qualifier=createConnectorDefinitionRequest, selectors=[], type_arguments=None), MemberReference(member=AMZNCLIENTTOKEN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInitialVersion, postfix_operators=[], prefix_operators=[], qualifier=createConnectorDefinitionRequest, selectors=[], type_arguments=None), MemberReference(member=INITIALVERSION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=createConnectorDefinitionRequest, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTags, postfix_operators=[], prefix_operators=[], qualifier=createConnectorDefinitionRequest, selectors=[], type_arguments=None), MemberReference(member=TAGS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[CreateConnectorDefinitionRequest] identifier[createConnectorDefinitionRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createConnectorDefinitionRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createConnectorDefinitionRequest] operator[SEP] identifier[getAmznClientToken] operator[SEP] operator[SEP] , identifier[AMZNCLIENTTOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createConnectorDefinitionRequest] operator[SEP] identifier[getInitialVersion] operator[SEP] operator[SEP] , identifier[INITIALVERSION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createConnectorDefinitionRequest] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createConnectorDefinitionRequest] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] , identifier[TAGS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public boolean step7() { Target target = new ImageTarget(new File("image7.png")); target.setMinScore(DEFAULT_MINSCORE); ScreenRegion loc = screenRegion.find(target); if (loc != null){ mouse.click(loc.getCenter()); keyboard.type("something to type"); return true; }else{ return false; } }
class class_name[name] begin[{] method[step7, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[Target], target] call[target.setMinScore, parameter[member[.DEFAULT_MINSCORE]]] local_variable[type[ScreenRegion], loc] if[binary_operation[member[.loc], !=, literal[null]]] begin[{] call[mouse.click, parameter[call[loc.getCenter, parameter[]]]] call[keyboard.type, parameter[literal["something to type"]]] return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[step7] operator[SEP] operator[SEP] { identifier[Target] identifier[target] operator[=] Keyword[new] identifier[ImageTarget] operator[SEP] Keyword[new] identifier[File] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[target] operator[SEP] identifier[setMinScore] operator[SEP] identifier[DEFAULT_MINSCORE] operator[SEP] operator[SEP] identifier[ScreenRegion] identifier[loc] operator[=] identifier[screenRegion] operator[SEP] identifier[find] operator[SEP] identifier[target] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[loc] operator[!=] Other[null] operator[SEP] { identifier[mouse] operator[SEP] identifier[click] operator[SEP] identifier[loc] operator[SEP] identifier[getCenter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[keyboard] operator[SEP] identifier[type] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
@Override public final int get(int codePoint) { int value; int ix; if (codePoint >= 0) { if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) { // Ordinary BMP code point, excluding leading surrogates. // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index. // 32 bit data is stored in the index array itself. ix = index[codePoint >> UTRIE2_SHIFT_2]; ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK); value = data32[ix]; return value; } if (codePoint <= 0xffff) { // Lead Surrogate Code Point. A Separate index section is stored for // lead surrogate code units and code points. // The main index has the code unit data. // For this function, we need the code point data. // Note: this expression could be refactored for slightly improved efficiency, but // surrogate code points will be so rare in practice that it's not worth it. ix = index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)]; ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK); value = data32[ix]; return value; } if (codePoint < highStart) { // Supplemental code point, use two-level lookup. ix = (UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH) + (codePoint >> UTRIE2_SHIFT_1); ix = index[ix]; ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK; ix = index[ix]; ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK); value = data32[ix]; return value; } if (codePoint <= 0x10ffff) { value = data32[highValueIndex]; return value; } } // Fall through. The code point is outside of the legal range of 0..0x10ffff. return errorValue; }
class class_name[name] begin[{] method[get, return_type[type[int]], modifier[final public], parameter[codePoint]] begin[{] local_variable[type[int], value] local_variable[type[int], ix] if[binary_operation[member[.codePoint], >=, literal[0]]] begin[{] if[binary_operation[binary_operation[member[.codePoint], <, literal[0x0d800]], ||, binary_operation[binary_operation[member[.codePoint], >, literal[0x0dbff]], &&, binary_operation[member[.codePoint], <=, literal[0x0ffff]]]]] begin[{] assign[member[.ix], member[.index]] assign[member[.ix], binary_operation[binary_operation[member[.ix], <<, member[.UTRIE2_INDEX_SHIFT]], +, binary_operation[member[.codePoint], &, member[.UTRIE2_DATA_MASK]]]] assign[member[.value], member[.data32]] return[member[.value]] else begin[{] None end[}] if[binary_operation[member[.codePoint], <=, literal[0xffff]]] begin[{] assign[member[.ix], member[.index]] assign[member[.ix], binary_operation[binary_operation[member[.ix], <<, member[.UTRIE2_INDEX_SHIFT]], +, binary_operation[member[.codePoint], &, member[.UTRIE2_DATA_MASK]]]] assign[member[.value], member[.data32]] return[member[.value]] else begin[{] None end[}] if[binary_operation[member[.codePoint], <, member[.highStart]]] begin[{] assign[member[.ix], binary_operation[binary_operation[member[.UTRIE2_INDEX_1_OFFSET], -, member[.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH]], +, binary_operation[member[.codePoint], >>, member[.UTRIE2_SHIFT_1]]]] assign[member[.ix], member[.index]] assign[member[.ix], binary_operation[binary_operation[member[.codePoint], >>, member[.UTRIE2_SHIFT_2]], &, member[.UTRIE2_INDEX_2_MASK]]] assign[member[.ix], member[.index]] assign[member[.ix], binary_operation[binary_operation[member[.ix], <<, member[.UTRIE2_INDEX_SHIFT]], +, binary_operation[member[.codePoint], &, member[.UTRIE2_DATA_MASK]]]] assign[member[.value], member[.data32]] return[member[.value]] else begin[{] None end[}] if[binary_operation[member[.codePoint], <=, literal[0x10ffff]]] begin[{] assign[member[.value], member[.data32]] return[member[.value]] else begin[{] None end[}] else begin[{] None end[}] return[member[.errorValue]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[int] identifier[get] operator[SEP] Keyword[int] identifier[codePoint] operator[SEP] { Keyword[int] identifier[value] operator[SEP] Keyword[int] identifier[ix] operator[SEP] Keyword[if] operator[SEP] identifier[codePoint] operator[>=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[codePoint] operator[<] literal[Integer] operator[||] operator[SEP] identifier[codePoint] operator[>] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[SEP] { identifier[ix] operator[=] identifier[index] operator[SEP] identifier[codePoint] operator[>] operator[>] identifier[UTRIE2_SHIFT_2] operator[SEP] operator[SEP] identifier[ix] operator[=] operator[SEP] identifier[ix] operator[<<] identifier[UTRIE2_INDEX_SHIFT] operator[SEP] operator[+] operator[SEP] identifier[codePoint] operator[&] identifier[UTRIE2_DATA_MASK] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[data32] operator[SEP] identifier[ix] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP] } Keyword[if] operator[SEP] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] { identifier[ix] operator[=] identifier[index] operator[SEP] identifier[UTRIE2_LSCP_INDEX_2_OFFSET] operator[+] operator[SEP] operator[SEP] identifier[codePoint] operator[-] literal[Integer] operator[SEP] operator[>] operator[>] identifier[UTRIE2_SHIFT_2] operator[SEP] operator[SEP] operator[SEP] identifier[ix] operator[=] operator[SEP] identifier[ix] operator[<<] identifier[UTRIE2_INDEX_SHIFT] operator[SEP] operator[+] operator[SEP] identifier[codePoint] operator[&] identifier[UTRIE2_DATA_MASK] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[data32] operator[SEP] identifier[ix] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP] } Keyword[if] operator[SEP] identifier[codePoint] operator[<] identifier[highStart] operator[SEP] { identifier[ix] operator[=] operator[SEP] identifier[UTRIE2_INDEX_1_OFFSET] operator[-] identifier[UTRIE2_OMITTED_BMP_INDEX_1_LENGTH] operator[SEP] operator[+] operator[SEP] identifier[codePoint] operator[>] operator[>] identifier[UTRIE2_SHIFT_1] operator[SEP] operator[SEP] identifier[ix] operator[=] identifier[index] operator[SEP] identifier[ix] operator[SEP] operator[SEP] identifier[ix] operator[+=] operator[SEP] identifier[codePoint] operator[>] operator[>] identifier[UTRIE2_SHIFT_2] operator[SEP] operator[&] identifier[UTRIE2_INDEX_2_MASK] operator[SEP] identifier[ix] operator[=] identifier[index] operator[SEP] identifier[ix] operator[SEP] operator[SEP] identifier[ix] operator[=] operator[SEP] identifier[ix] operator[<<] identifier[UTRIE2_INDEX_SHIFT] operator[SEP] operator[+] operator[SEP] identifier[codePoint] operator[&] identifier[UTRIE2_DATA_MASK] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[data32] operator[SEP] identifier[ix] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP] } Keyword[if] operator[SEP] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] { identifier[value] operator[=] identifier[data32] operator[SEP] identifier[highValueIndex] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP] } } Keyword[return] identifier[errorValue] operator[SEP] }
@RequestMapping(value = "information/{entityType}/{id}", method = RequestMethod.GET) public Resources<EntityInformation> getInformation(@PathVariable ProjectEntityType entityType, @PathVariable ID id) { // Gets the entity ProjectEntity entity = getEntity(entityType, id); // List of informations to return List<EntityInformation> informations = extensionManager.getExtensions(EntityInformationExtension.class).stream() .map(x -> x.getInformation(entity)) .filter(Optional::isPresent) .map(Optional::get) .collect(Collectors.toList()); // OK return Resources.of( informations, uri(MvcUriComponentsBuilder.on(getClass()).getInformation(entityType, id)) ); }
class class_name[name] begin[{] method[getInformation, return_type[type[Resources]], modifier[public], parameter[entityType, id]] begin[{] local_variable[type[ProjectEntity], entity] local_variable[type[List], informations] return[call[Resources.of, parameter[member[.informations], call[.uri, parameter[call[MvcUriComponentsBuilder.on, parameter[call[.getClass, parameter[]]]]]]]]] end[}] END[}]
annotation[@] identifier[RequestMapping] operator[SEP] identifier[value] operator[=] literal[String] , identifier[method] operator[=] identifier[RequestMethod] operator[SEP] identifier[GET] operator[SEP] Keyword[public] identifier[Resources] operator[<] identifier[EntityInformation] operator[>] identifier[getInformation] operator[SEP] annotation[@] identifier[PathVariable] identifier[ProjectEntityType] identifier[entityType] , annotation[@] identifier[PathVariable] identifier[ID] identifier[id] operator[SEP] { identifier[ProjectEntity] identifier[entity] operator[=] identifier[getEntity] operator[SEP] identifier[entityType] , identifier[id] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[EntityInformation] operator[>] identifier[informations] operator[=] identifier[extensionManager] operator[SEP] identifier[getExtensions] operator[SEP] identifier[EntityInformationExtension] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[x] operator[->] identifier[x] operator[SEP] identifier[getInformation] operator[SEP] identifier[entity] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[Optional] operator[::] identifier[isPresent] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Optional] operator[::] identifier[get] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Resources] operator[SEP] identifier[of] operator[SEP] identifier[informations] , identifier[uri] operator[SEP] identifier[MvcUriComponentsBuilder] operator[SEP] identifier[on] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getInformation] operator[SEP] identifier[entityType] , identifier[id] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private static <K, V> CacheStream<Entry<K, V>> cacheStreamCast(CacheStream stream) { return stream; }
class class_name[name] begin[{] method[cacheStreamCast, return_type[type[CacheStream]], modifier[private static], parameter[stream]] begin[{] return[member[.stream]] end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[CacheStream] operator[<] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[cacheStreamCast] operator[SEP] identifier[CacheStream] identifier[stream] operator[SEP] { Keyword[return] identifier[stream] operator[SEP] }
protected int getRetryInterval() throws ActivityException { try { String v = getAttributeValueSmart(PROP_RETRY_INTERVAL); return StringHelper.getInteger(v, 600); } catch (PropertyException ex) { throw new ActivityException(ex.getMessage(), ex); } }
class class_name[name] begin[{] method[getRetryInterval, return_type[type[int]], modifier[protected], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=PROP_RETRY_INTERVAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttributeValueSmart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=600)], member=getInteger, postfix_operators=[], prefix_operators=[], qualifier=StringHelper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), 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=ActivityException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['PropertyException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[int] identifier[getRetryInterval] operator[SEP] operator[SEP] Keyword[throws] identifier[ActivityException] { Keyword[try] { identifier[String] identifier[v] operator[=] identifier[getAttributeValueSmart] operator[SEP] identifier[PROP_RETRY_INTERVAL] operator[SEP] operator[SEP] Keyword[return] identifier[StringHelper] operator[SEP] identifier[getInteger] operator[SEP] identifier[v] , Other[600] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[PropertyException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[ActivityException] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") public <T> T continueWith(final Object currentInstance, final String methodName, final Class<T> target) { Class currentClass = currentInstance.getClass(); Method method; try { method = currentClass.getDeclaredMethod(methodName); } catch (NoSuchMethodException e) { throw new PathrefException("Not a getter: " + methodName, e); } if (!ClassUtil.isBeanPropertyGetter(method)) { throw new PathrefException("Not a getter: " + methodName); } String getterName = ClassUtil.getBeanPropertyGetterName(method); append(getterName); if (ClassUtil.isTypeOf(target, List.class)) { final Class componentType = ClassUtil.getComponentType(method.getGenericReturnType(), currentClass, 0); if (componentType == null) { throw new PathrefException("Unknown component name for: " + methodName); } return (T) new ArrayList() { @Override public Object get(final int index) { if (index >= 0) { append("[" + index + "]"); } return new Pathref<>(componentType, Pathref.this).to(); } }; } try { return new Pathref<>(target, this).to(); } catch (Exception ex) { return null; } }
class class_name[name] begin[{] method[continueWith, return_type[type[T]], modifier[public], parameter[currentInstance, methodName, target]] begin[{] local_variable[type[Class], currentClass] local_variable[type[Method], method] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDeclaredMethod, postfix_operators=[], prefix_operators=[], qualifier=currentClass, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not a getter: "), operandr=MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PathrefException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None) if[call[ClassUtil.isBeanPropertyGetter, parameter[member[.method]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not a getter: "), operandr=MemberReference(member=methodName, 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=PathrefException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], getterName] call[.append, parameter[member[.getterName]]] if[call[ClassUtil.isTypeOf, parameter[member[.target], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=List, sub_type=None))]]] begin[{] local_variable[type[Class], componentType] if[binary_operation[member[.componentType], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown component name for: "), operandr=MemberReference(member=methodName, 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=PathrefException, sub_type=None)), label=None) else begin[{] None end[}] return[Cast(expression=ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, 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=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="["), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=componentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=Pathref, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=to, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[], dimensions=None, name=Pathref, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=get, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=index, type=BasicType(dimensions=[], name=int), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_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=ArrayList, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=to, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[], dimensions=None, name=Pathref, sub_type=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[continueWith] operator[SEP] Keyword[final] identifier[Object] identifier[currentInstance] , Keyword[final] identifier[String] identifier[methodName] , Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[target] operator[SEP] { identifier[Class] identifier[currentClass] operator[=] identifier[currentInstance] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[Method] identifier[method] operator[SEP] Keyword[try] { identifier[method] operator[=] identifier[currentClass] operator[SEP] identifier[getDeclaredMethod] operator[SEP] identifier[methodName] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[PathrefException] operator[SEP] literal[String] operator[+] identifier[methodName] , identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[ClassUtil] operator[SEP] identifier[isBeanPropertyGetter] operator[SEP] identifier[method] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[PathrefException] operator[SEP] literal[String] operator[+] identifier[methodName] operator[SEP] operator[SEP] } identifier[String] identifier[getterName] operator[=] identifier[ClassUtil] operator[SEP] identifier[getBeanPropertyGetterName] operator[SEP] identifier[method] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getterName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ClassUtil] operator[SEP] identifier[isTypeOf] operator[SEP] identifier[target] , identifier[List] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[final] identifier[Class] identifier[componentType] operator[=] identifier[ClassUtil] operator[SEP] identifier[getComponentType] operator[SEP] identifier[method] operator[SEP] identifier[getGenericReturnType] operator[SEP] operator[SEP] , identifier[currentClass] , Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[componentType] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[PathrefException] operator[SEP] literal[String] operator[+] identifier[methodName] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[T] operator[SEP] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[get] operator[SEP] Keyword[final] Keyword[int] identifier[index] operator[SEP] { Keyword[if] operator[SEP] identifier[index] operator[>=] Other[0] operator[SEP] { identifier[append] operator[SEP] literal[String] operator[+] identifier[index] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Pathref] operator[<] operator[>] operator[SEP] identifier[componentType] , identifier[Pathref] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[to] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] } Keyword[try] { Keyword[return] Keyword[new] identifier[Pathref] operator[<] operator[>] operator[SEP] identifier[target] , Keyword[this] operator[SEP] operator[SEP] identifier[to] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[return] Other[null] operator[SEP] } }
public ListTagsForResourceResult withResourceTags(Tag... resourceTags) { if (this.resourceTags == null) { setResourceTags(new com.amazonaws.internal.SdkInternalList<Tag>(resourceTags.length)); } for (Tag ele : resourceTags) { this.resourceTags.add(ele); } return this; }
class class_name[name] begin[{] method[withResourceTags, return_type[type[ListTagsForResourceResult]], modifier[public], parameter[resourceTags]] begin[{] if[binary_operation[THIS[member[None.resourceTags]], ==, literal[null]]] begin[{] call[.setResourceTags, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=resourceTags, selectors=[])], 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=Tag, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=resourceTags, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=resourceTags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Tag, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ListTagsForResourceResult] identifier[withResourceTags] operator[SEP] identifier[Tag] operator[...] identifier[resourceTags] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[resourceTags] operator[==] Other[null] operator[SEP] { identifier[setResourceTags] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[Tag] operator[>] operator[SEP] identifier[resourceTags] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Tag] identifier[ele] operator[:] identifier[resourceTags] operator[SEP] { Keyword[this] operator[SEP] identifier[resourceTags] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override public double probability(double x0, double x1) throws NumberIsTooLargeException { if (x0 > x1) { throw new NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT, x0, x1, true); } final double denom = standardDeviation * SQRT2; final double v0 = (x0 - mean) / denom; final double v1 = (x1 - mean) / denom; return 0.5 * Erf.erf(v0, v1); }
class class_name[name] begin[{] method[probability, return_type[type[double]], modifier[public], parameter[x0, x1]] begin[{] if[binary_operation[member[.x0], >, member[.x1]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT, postfix_operators=[], prefix_operators=[], qualifier=LocalizedFormats, selectors=[]), MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NumberIsTooLargeException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[double], denom] local_variable[type[double], v0] local_variable[type[double], v1] return[binary_operation[literal[0.5], *, call[Erf.erf, parameter[member[.v0], member[.v1]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[double] identifier[probability] operator[SEP] Keyword[double] identifier[x0] , Keyword[double] identifier[x1] operator[SEP] Keyword[throws] identifier[NumberIsTooLargeException] { Keyword[if] operator[SEP] identifier[x0] operator[>] identifier[x1] operator[SEP] { Keyword[throw] Keyword[new] identifier[NumberIsTooLargeException] operator[SEP] identifier[LocalizedFormats] operator[SEP] identifier[LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT] , identifier[x0] , identifier[x1] , literal[boolean] operator[SEP] operator[SEP] } Keyword[final] Keyword[double] identifier[denom] operator[=] identifier[standardDeviation] operator[*] identifier[SQRT2] operator[SEP] Keyword[final] Keyword[double] identifier[v0] operator[=] operator[SEP] identifier[x0] operator[-] identifier[mean] operator[SEP] operator[/] identifier[denom] operator[SEP] Keyword[final] Keyword[double] identifier[v1] operator[=] operator[SEP] identifier[x1] operator[-] identifier[mean] operator[SEP] operator[/] identifier[denom] operator[SEP] Keyword[return] literal[Float] operator[*] identifier[Erf] operator[SEP] identifier[erf] operator[SEP] identifier[v0] , identifier[v1] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public Collection<V> getValues(Object src) { ArrayList<V> values = new ArrayList<V>(); if( src instanceof String ) { String[] words = ((String)src).split(","); if( words.length < 1 ) { values.add(getValue(src)); } else { for( String word : words ) { values.add(getValue(word)); } } return values; } else if( src instanceof Collection ) { for( Object ob : (Collection<Object>)src ) { values.add(getValue(ob)); } return values; } throw new InvalidAttributeException("Invalid attribute: " + src); }
class class_name[name] begin[{] method[getValues, return_type[type[Collection]], modifier[public], parameter[src]] begin[{] local_variable[type[ArrayList], values] if[binary_operation[member[.src], instanceof, type[String]]] begin[{] local_variable[type[String], words] if[binary_operation[member[words.length], <, literal[1]]] begin[{] call[values.add, parameter[call[.getValue, parameter[member[.src]]]]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=words, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=word)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] return[member[.values]] else begin[{] if[binary_operation[member[.src], instanceof, type[Collection]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ob, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Collection, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ob)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[member[.values]] else begin[{] None end[}] end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid attribute: "), operandr=MemberReference(member=src, 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=InvalidAttributeException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Collection] operator[<] identifier[V] operator[>] identifier[getValues] operator[SEP] identifier[Object] identifier[src] operator[SEP] { identifier[ArrayList] operator[<] identifier[V] operator[>] identifier[values] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[V] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[src] Keyword[instanceof] identifier[String] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[words] operator[=] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[src] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[words] operator[SEP] identifier[length] operator[<] Other[1] operator[SEP] { identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[getValue] operator[SEP] identifier[src] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] identifier[String] identifier[word] operator[:] identifier[words] operator[SEP] { identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[getValue] operator[SEP] identifier[word] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[values] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[src] Keyword[instanceof] identifier[Collection] operator[SEP] { Keyword[for] operator[SEP] identifier[Object] identifier[ob] operator[:] operator[SEP] identifier[Collection] operator[<] identifier[Object] operator[>] operator[SEP] identifier[src] operator[SEP] { identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[getValue] operator[SEP] identifier[ob] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[values] operator[SEP] } Keyword[throw] Keyword[new] identifier[InvalidAttributeException] operator[SEP] literal[String] operator[+] identifier[src] operator[SEP] operator[SEP] }
public final int decodeValues(int index, TypedArrayDecoder tad, InputProblemReporter rep) throws XMLStreamException { if (index < 0 || index >= mAttrCount) { throwIndex(index); } // Char[] faster than String... and no need to trim here: return decodeValues(tad, rep, mValueBuilder.getCharBuffer(), mAttributes[index].mValueStartOffset, getValueStartOffset(index+1)); }
class class_name[name] begin[{] method[decodeValues, return_type[type[int]], modifier[final public], parameter[index, tad, rep]] begin[{] if[binary_operation[binary_operation[member[.index], <, literal[0]], ||, binary_operation[member[.index], >=, member[.mAttrCount]]]] begin[{] call[.throwIndex, parameter[member[.index]]] else begin[{] None end[}] return[call[.decodeValues, parameter[member[.tad], member[.rep], call[mValueBuilder.getCharBuffer, parameter[]], member[.mAttributes], call[.getValueStartOffset, parameter[binary_operation[member[.index], +, literal[1]]]]]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[int] identifier[decodeValues] operator[SEP] Keyword[int] identifier[index] , identifier[TypedArrayDecoder] identifier[tad] , identifier[InputProblemReporter] identifier[rep] operator[SEP] Keyword[throws] identifier[XMLStreamException] { Keyword[if] operator[SEP] identifier[index] operator[<] Other[0] operator[||] identifier[index] operator[>=] identifier[mAttrCount] operator[SEP] { identifier[throwIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] } Keyword[return] identifier[decodeValues] operator[SEP] identifier[tad] , identifier[rep] , identifier[mValueBuilder] operator[SEP] identifier[getCharBuffer] operator[SEP] operator[SEP] , identifier[mAttributes] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[mValueStartOffset] , identifier[getValueStartOffset] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] }