code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
int getChoiceField(int accessor) { int result = 0; try { if (jmfPart.isPresent(accessor)) result = jmfPart.getInt(accessor); } catch (JMFException e) { FFDCFilter.processException(e, "getChoiceField", "185", this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "getChoiceField failed: " + e); } return result; }
class class_name[name] begin[{] method[getChoiceField, return_type[type[int]], modifier[default], parameter[accessor]] begin[{] local_variable[type[int], result] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=accessor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPresent, postfix_operators=[], prefix_operators=[], qualifier=jmfPart, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=accessor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=jmfPart, selectors=[], type_arguments=None)), label=None))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getChoiceField"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="185"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getChoiceField failed: "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JMFException']))], finally_block=None, label=None, resources=None) return[member[.result]] end[}] END[}]
Keyword[int] identifier[getChoiceField] operator[SEP] Keyword[int] identifier[accessor] operator[SEP] { Keyword[int] identifier[result] operator[=] Other[0] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[jmfPart] operator[SEP] identifier[isPresent] operator[SEP] identifier[accessor] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[jmfPart] operator[SEP] identifier[getInt] operator[SEP] identifier[accessor] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[JMFException] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] 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[SibTr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
private DescribeTagsResponseType describeTags() { DescribeTagsResponseType ret = new DescribeTagsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); TagSetType tagsSet = new TagSetType(); for (MockTags mockVpc : mockTagsController.describeTags()) { for (String resourceId : mockVpc.getResourcesSet()) { TagSetItemType tagItem = new TagSetItemType(); tagItem.setResourceId(resourceId); tagItem.setKey(mockVpc.getTagSet().keySet() .toArray(new String[mockVpc.getTagSet().size()])[0]); tagItem.setValue(mockVpc.getTagSet().values() .toArray(new String[mockVpc.getTagSet().size()])[0]); tagsSet.getItem().add(tagItem); } } ret.setTagSet(tagsSet); return ret; }
class class_name[name] begin[{] method[describeTags, return_type[type[DescribeTagsResponseType]], modifier[private], parameter[]] begin[{] local_variable[type[DescribeTagsResponseType], ret] call[ret.setRequestId, parameter[call[UUID.randomUUID, parameter[]]]] local_variable[type[TagSetType], tagsSet] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[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=TagSetItemType, sub_type=None)), name=tagItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TagSetItemType, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setResourceId, postfix_operators=[], prefix_operators=[], qualifier=tagItem, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTagSet, postfix_operators=[], prefix_operators=[], qualifier=mockVpc, selectors=[MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=getTagSet, postfix_operators=[], prefix_operators=[], qualifier=mockVpc, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None)], member=setKey, postfix_operators=[], prefix_operators=[], qualifier=tagItem, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTagSet, postfix_operators=[], prefix_operators=[], qualifier=mockVpc, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=getTagSet, postfix_operators=[], prefix_operators=[], qualifier=mockVpc, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=tagItem, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getItem, postfix_operators=[], prefix_operators=[], qualifier=tagsSet, selectors=[MethodInvocation(arguments=[MemberReference(member=tagItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getResourcesSet, postfix_operators=[], prefix_operators=[], qualifier=mockVpc, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=resourceId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=describeTags, postfix_operators=[], prefix_operators=[], qualifier=mockTagsController, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=mockVpc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MockTags, sub_type=None))), label=None) call[ret.setTagSet, parameter[member[.tagsSet]]] return[member[.ret]] end[}] END[}]
Keyword[private] identifier[DescribeTagsResponseType] identifier[describeTags] operator[SEP] operator[SEP] { identifier[DescribeTagsResponseType] identifier[ret] operator[=] Keyword[new] identifier[DescribeTagsResponseType] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[setRequestId] operator[SEP] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[TagSetType] identifier[tagsSet] operator[=] Keyword[new] identifier[TagSetType] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[MockTags] identifier[mockVpc] operator[:] identifier[mockTagsController] operator[SEP] identifier[describeTags] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[resourceId] operator[:] identifier[mockVpc] operator[SEP] identifier[getResourcesSet] operator[SEP] operator[SEP] operator[SEP] { identifier[TagSetItemType] identifier[tagItem] operator[=] Keyword[new] identifier[TagSetItemType] operator[SEP] operator[SEP] operator[SEP] identifier[tagItem] operator[SEP] identifier[setResourceId] operator[SEP] identifier[resourceId] operator[SEP] operator[SEP] identifier[tagItem] operator[SEP] identifier[setKey] operator[SEP] identifier[mockVpc] operator[SEP] identifier[getTagSet] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[mockVpc] operator[SEP] identifier[getTagSet] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[tagItem] operator[SEP] identifier[setValue] operator[SEP] identifier[mockVpc] operator[SEP] identifier[getTagSet] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[mockVpc] operator[SEP] identifier[getTagSet] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[tagsSet] operator[SEP] identifier[getItem] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[tagItem] operator[SEP] operator[SEP] } } identifier[ret] operator[SEP] identifier[setTagSet] operator[SEP] identifier[tagsSet] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
public static String createURLTitle(final String title) { String baseTitle = title; // Remove XML Elements from the Title. baseTitle = baseTitle.replaceAll("</(.*?)>", "").replaceAll("<(.*?)>", ""); // Check if the title starts with an invalid sequence final Matcher invalidSequenceMatcher = STARTS_WITH_INVALID_SEQUENCE_RE.matcher(baseTitle); if (invalidSequenceMatcher.find()) { baseTitle = invalidSequenceMatcher.group("EverythingElse"); } // Start by removing any prefixed numbers (you can't start an xref id with numbers) final Matcher matcher = STARTS_WITH_NUMBER_RE.matcher(baseTitle); if (matcher.find()) { final String numbers = matcher.group("Numbers"); final String everythingElse = matcher.group("EverythingElse"); if (numbers != null && everythingElse != null) { final NumberFormat formatter = new RuleBasedNumberFormat(RuleBasedNumberFormat.SPELLOUT); final String numbersSpeltOut = formatter.format(Integer.parseInt(numbers)); baseTitle = numbersSpeltOut + everythingElse; // Capitalize the first character if (baseTitle.length() > 0) { baseTitle = baseTitle.substring(0, 1).toUpperCase() + baseTitle.substring(1, baseTitle.length()); } } } // Escape the title final String escapedTitle = DocBookUtilities.escapeTitle(baseTitle); // We don't want only numeric fixed urls, as that is completely meaningless. if (escapedTitle.matches("^\\d+$")) { return ""; } else { return escapedTitle; } }
class class_name[name] begin[{] method[createURLTitle, return_type[type[String]], modifier[public static], parameter[title]] begin[{] local_variable[type[String], baseTitle] assign[member[.baseTitle], call[baseTitle.replaceAll, parameter[literal["</(.*?)>"], literal[""]]]] local_variable[type[Matcher], invalidSequenceMatcher] if[call[invalidSequenceMatcher.find, parameter[]]] begin[{] assign[member[.baseTitle], call[invalidSequenceMatcher.group, parameter[literal["EverythingElse"]]]] else begin[{] None end[}] local_variable[type[Matcher], matcher] if[call[matcher.find, parameter[]]] begin[{] local_variable[type[String], numbers] local_variable[type[String], everythingElse] if[binary_operation[binary_operation[member[.numbers], !=, literal[null]], &&, binary_operation[member[.everythingElse], !=, literal[null]]]] begin[{] local_variable[type[NumberFormat], formatter] local_variable[type[String], numbersSpeltOut] assign[member[.baseTitle], binary_operation[member[.numbersSpeltOut], +, member[.everythingElse]]] if[binary_operation[call[baseTitle.length, parameter[]], >, literal[0]]] begin[{] assign[member[.baseTitle], binary_operation[call[baseTitle.substring, parameter[literal[0], literal[1]]], +, call[baseTitle.substring, parameter[literal[1], call[baseTitle.length, parameter[]]]]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[String], escapedTitle] if[call[escapedTitle.matches, parameter[literal["^\\d+$"]]]] begin[{] return[literal[""]] else begin[{] return[member[.escapedTitle]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[createURLTitle] operator[SEP] Keyword[final] identifier[String] identifier[title] operator[SEP] { identifier[String] identifier[baseTitle] operator[=] identifier[title] operator[SEP] identifier[baseTitle] operator[=] identifier[baseTitle] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Matcher] identifier[invalidSequenceMatcher] operator[=] identifier[STARTS_WITH_INVALID_SEQUENCE_RE] operator[SEP] identifier[matcher] operator[SEP] identifier[baseTitle] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[invalidSequenceMatcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[baseTitle] operator[=] identifier[invalidSequenceMatcher] operator[SEP] identifier[group] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[Matcher] identifier[matcher] operator[=] identifier[STARTS_WITH_NUMBER_RE] operator[SEP] identifier[matcher] operator[SEP] identifier[baseTitle] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[numbers] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[everythingElse] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[numbers] operator[!=] Other[null] operator[&&] identifier[everythingElse] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[NumberFormat] identifier[formatter] operator[=] Keyword[new] identifier[RuleBasedNumberFormat] operator[SEP] identifier[RuleBasedNumberFormat] operator[SEP] identifier[SPELLOUT] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[numbersSpeltOut] operator[=] identifier[formatter] operator[SEP] identifier[format] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[numbers] operator[SEP] operator[SEP] operator[SEP] identifier[baseTitle] operator[=] identifier[numbersSpeltOut] operator[+] identifier[everythingElse] operator[SEP] Keyword[if] operator[SEP] identifier[baseTitle] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[baseTitle] operator[=] identifier[baseTitle] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[+] identifier[baseTitle] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[baseTitle] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[final] identifier[String] identifier[escapedTitle] operator[=] identifier[DocBookUtilities] operator[SEP] identifier[escapeTitle] operator[SEP] identifier[baseTitle] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[escapedTitle] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[else] { Keyword[return] identifier[escapedTitle] operator[SEP] } }
protected void gameLoop() throws SlickException { int delta = getDelta(); if (!Display.isVisible() && updateOnlyOnVisible) { try { Thread.sleep(100); } catch (Exception e) {} } else { try { updateAndRender(delta); } catch (SlickException e) { Log.error(e); running = false; return; } } updateFPS(); Display.update(); if (Display.isCloseRequested()) { if (game.closeRequested()) { running = false; } } }
class class_name[name] begin[{] method[gameLoop, return_type[void], modifier[protected], parameter[]] begin[{] local_variable[type[int], delta] if[binary_operation[call[Display.isVisible, parameter[]], &&, member[.updateOnlyOnVisible]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateAndRender, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=running, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SlickException']))], finally_block=None, label=None, resources=None) end[}] call[.updateFPS, parameter[]] call[Display.update, parameter[]] if[call[Display.isCloseRequested, parameter[]]] begin[{] if[call[game.closeRequested, parameter[]]] begin[{] assign[member[.running], literal[false]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[gameLoop] operator[SEP] operator[SEP] Keyword[throws] identifier[SlickException] { Keyword[int] identifier[delta] operator[=] identifier[getDelta] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Display] operator[SEP] identifier[isVisible] operator[SEP] operator[SEP] operator[&&] identifier[updateOnlyOnVisible] operator[SEP] { Keyword[try] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[100] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { } } Keyword[else] { Keyword[try] { identifier[updateAndRender] operator[SEP] identifier[delta] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SlickException] identifier[e] operator[SEP] { identifier[Log] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[running] operator[=] literal[boolean] operator[SEP] Keyword[return] operator[SEP] } } identifier[updateFPS] operator[SEP] operator[SEP] operator[SEP] identifier[Display] operator[SEP] identifier[update] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Display] operator[SEP] identifier[isCloseRequested] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[game] operator[SEP] identifier[closeRequested] operator[SEP] operator[SEP] operator[SEP] { identifier[running] operator[=] literal[boolean] operator[SEP] } } }
@Override public boolean isElementPresent(long timeout) throws WidgetException { final long start = System.currentTimeMillis(); final long end = start + timeout; while (true) { if (isElementPresent()) { return true; } // Putting the condition here will measure the time more accurately. if (System.currentTimeMillis() >= end) { return false; } try { Thread.sleep(250); } catch (InterruptedException e) { } } }
class class_name[name] begin[{] method[isElementPresent, return_type[type[boolean]], modifier[public], parameter[timeout]] begin[{] local_variable[type[long], start] local_variable[type[long], end] while[literal[true]] begin[{] if[call[.isElementPresent, parameter[]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[call[System.currentTimeMillis, parameter[]], >=, member[.end]]] begin[{] return[literal[false]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=250)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isElementPresent] operator[SEP] Keyword[long] identifier[timeout] operator[SEP] Keyword[throws] identifier[WidgetException] { Keyword[final] Keyword[long] identifier[start] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[end] operator[=] identifier[start] operator[+] identifier[timeout] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[isElementPresent] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[>=] identifier[end] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[try] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[250] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { } } }
@Override public DescribeReservedInstancesOfferingsResult describeReservedInstancesOfferings(DescribeReservedInstancesOfferingsRequest request) { request = beforeClientExecution(request); return executeDescribeReservedInstancesOfferings(request); }
class class_name[name] begin[{] method[describeReservedInstancesOfferings, return_type[type[DescribeReservedInstancesOfferingsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDescribeReservedInstancesOfferings, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DescribeReservedInstancesOfferingsResult] identifier[describeReservedInstancesOfferings] operator[SEP] identifier[DescribeReservedInstancesOfferingsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDescribeReservedInstancesOfferings] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
protected static ElementValue extractValue(final String field, final AnnotationEntry entry) { ElementValue result = null; for (final ElementValuePair p : entry.getElementValuePairs()) { if (field.equals(p.getNameString())) { result = p.getValue(); break; } } return result; }
class class_name[name] begin[{] method[extractValue, return_type[type[ElementValue]], modifier[static protected], parameter[field, entry]] begin[{] local_variable[type[ElementValue], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNameString, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], 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=getValue, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getElementValuePairs, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ElementValuePair, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[ElementValue] identifier[extractValue] operator[SEP] Keyword[final] identifier[String] identifier[field] , Keyword[final] identifier[AnnotationEntry] identifier[entry] operator[SEP] { identifier[ElementValue] identifier[result] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[ElementValuePair] identifier[p] operator[:] identifier[entry] operator[SEP] identifier[getElementValuePairs] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[equals] operator[SEP] identifier[p] operator[SEP] identifier[getNameString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[=] identifier[p] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
private void updateSliderState(int touchX, int touchY) { int distanceX = touchX - mCircleCenterX; int distanceY = mCircleCenterY - touchY; //noinspection SuspiciousNameCombination double c = Math.sqrt(Math.pow(distanceX, 2) + Math.pow(distanceY, 2)); mAngle = Math.acos(distanceX / c); if (distanceY < 0) { mAngle = -mAngle; } if (mListener != null) { // notify slider moved listener of the new position which should be in [0..1] range mListener.onSliderMoved((mAngle - mStartAngle) / (2 * Math.PI)); } }
class class_name[name] begin[{] method[updateSliderState, return_type[void], modifier[private], parameter[touchX, touchY]] begin[{] local_variable[type[int], distanceX] local_variable[type[int], distanceY] local_variable[type[double], c] assign[member[.mAngle], call[Math.acos, parameter[binary_operation[member[.distanceX], /, member[.c]]]]] if[binary_operation[member[.distanceY], <, literal[0]]] begin[{] assign[member[.mAngle], member[.mAngle]] else begin[{] None end[}] if[binary_operation[member[.mListener], !=, literal[null]]] begin[{] call[mListener.onSliderMoved, parameter[binary_operation[binary_operation[member[.mAngle], -, member[.mStartAngle]], /, binary_operation[literal[2], *, member[Math.PI]]]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[updateSliderState] operator[SEP] Keyword[int] identifier[touchX] , Keyword[int] identifier[touchY] operator[SEP] { Keyword[int] identifier[distanceX] operator[=] identifier[touchX] operator[-] identifier[mCircleCenterX] operator[SEP] Keyword[int] identifier[distanceY] operator[=] identifier[mCircleCenterY] operator[-] identifier[touchY] operator[SEP] Keyword[double] identifier[c] operator[=] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[distanceX] , Other[2] operator[SEP] operator[+] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[distanceY] , Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[mAngle] operator[=] identifier[Math] operator[SEP] identifier[acos] operator[SEP] identifier[distanceX] operator[/] identifier[c] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[distanceY] operator[<] Other[0] operator[SEP] { identifier[mAngle] operator[=] operator[-] identifier[mAngle] operator[SEP] } Keyword[if] operator[SEP] identifier[mListener] operator[!=] Other[null] operator[SEP] { identifier[mListener] operator[SEP] identifier[onSliderMoved] operator[SEP] operator[SEP] identifier[mAngle] operator[-] identifier[mStartAngle] operator[SEP] operator[/] operator[SEP] Other[2] operator[*] identifier[Math] operator[SEP] identifier[PI] operator[SEP] operator[SEP] operator[SEP] } }
@Override protected ThriftConnection<T> getConnectionInternal(byte[] nodeID) throws ThriftConnectionPoolException { if (nodeID == null) { throw new NullPointerException(); } if (this.pool.getThriftServerCount() == 0) { throw new ThriftConnectionPoolException("当前没有可用的服务器 无法获取连接"); } List<ThriftConnectionPartition<T>> partitions = Collections.unmodifiableList(this.pool.partitions); ThriftConnectionPartition<T> thriftConnectionPartition = null; for (ThriftConnectionPartition<T> tempPartition : partitions) { ThriftServerInfo thriftServerInfo = tempPartition.getThriftServerInfo(); if (Arrays.equals(thriftServerInfo.getServerID(), nodeID)) { thriftConnectionPartition = tempPartition; break; } } if (thriftConnectionPartition == null) { throw new ThriftConnectionPoolException("没有找到对应服务器节点:" + Arrays.toString(nodeID)); } ThriftConnection<T> result = null; try { result = thriftConnectionPartition.poolFreeConnection(this.pool.connectionTimeoutInMs, TimeUnit.MILLISECONDS); if (result == null) { throw new ThriftConnectionPoolException("Timed out waiting for a free available connection."); } } catch (InterruptedException e) { throw new ThriftConnectionPoolException(e); } return result; }
class class_name[name] begin[{] method[getConnectionInternal, return_type[type[ThriftConnection]], modifier[protected], parameter[nodeID]] begin[{] if[binary_operation[member[.nodeID], ==, 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=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.pool]call[None.getThriftServerCount, parameter[]]], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="当前没有可用的服务器 无法获取连接")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ThriftConnectionPoolException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[List], partitions] local_variable[type[ThriftConnectionPartition], thriftConnectionPartition] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getThriftServerInfo, postfix_operators=[], prefix_operators=[], qualifier=tempPartition, selectors=[], type_arguments=None), name=thriftServerInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ThriftServerInfo, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getServerID, postfix_operators=[], prefix_operators=[], qualifier=thriftServerInfo, selectors=[], type_arguments=None), MemberReference(member=nodeID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=thriftConnectionPartition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tempPartition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=partitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tempPartition)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=ThriftConnectionPartition, sub_type=None))), label=None) if[binary_operation[member[.thriftConnectionPartition], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="没有找到对应服务器节点:"), operandr=MethodInvocation(arguments=[MemberReference(member=nodeID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ThriftConnectionPoolException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[ThriftConnection], result] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=pool, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=connectionTimeoutInMs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=MILLISECONDS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[])], member=poolFreeConnection, postfix_operators=[], prefix_operators=[], qualifier=thriftConnectionPartition, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Timed out waiting for a free available connection.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ThriftConnectionPoolException, 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=ThriftConnectionPoolException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[ThriftConnection] operator[<] identifier[T] operator[>] identifier[getConnectionInternal] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[nodeID] operator[SEP] Keyword[throws] identifier[ThriftConnectionPoolException] { Keyword[if] operator[SEP] identifier[nodeID] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[pool] operator[SEP] identifier[getThriftServerCount] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[ThriftConnectionPoolException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[ThriftConnectionPartition] operator[<] identifier[T] operator[>] operator[>] identifier[partitions] operator[=] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] Keyword[this] operator[SEP] identifier[pool] operator[SEP] identifier[partitions] operator[SEP] operator[SEP] identifier[ThriftConnectionPartition] operator[<] identifier[T] operator[>] identifier[thriftConnectionPartition] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[ThriftConnectionPartition] operator[<] identifier[T] operator[>] identifier[tempPartition] operator[:] identifier[partitions] operator[SEP] { identifier[ThriftServerInfo] identifier[thriftServerInfo] operator[=] identifier[tempPartition] operator[SEP] identifier[getThriftServerInfo] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Arrays] operator[SEP] identifier[equals] operator[SEP] identifier[thriftServerInfo] operator[SEP] identifier[getServerID] operator[SEP] operator[SEP] , identifier[nodeID] operator[SEP] operator[SEP] { identifier[thriftConnectionPartition] operator[=] identifier[tempPartition] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[thriftConnectionPartition] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ThriftConnectionPoolException] operator[SEP] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[nodeID] operator[SEP] operator[SEP] operator[SEP] } identifier[ThriftConnection] operator[<] identifier[T] operator[>] identifier[result] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[result] operator[=] identifier[thriftConnectionPartition] operator[SEP] identifier[poolFreeConnection] operator[SEP] Keyword[this] operator[SEP] identifier[pool] operator[SEP] identifier[connectionTimeoutInMs] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ThriftConnectionPoolException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ThriftConnectionPoolException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public void translateToHotdeployErrorIfPossible(Error e) { // to notice reboot timing if (!ManagedHotdeploy.isHotdeploy()) { return; } final String msg = e.getMessage(); if (msg == null) { return; } // only frequent patterns if (e instanceof NoSuchFieldError) { if (isNoSuchFieldOfHtmlPath(msg)) { throwRebootAfterFreeGenError(e); } } if (e instanceof NoSuchMethodError) { if (isNoSuchMethodOfMessages(msg) || isNoSuchMethodOfConfig(msg)) { throwRebootAfterFreeGenError(e); } if (isNoSuchMethodOfDBFlute(msg)) { throwRebootAfterGenerateError(e); } } }
class class_name[name] begin[{] method[translateToHotdeployErrorIfPossible, return_type[void], modifier[public], parameter[e]] begin[{] if[call[ManagedHotdeploy.isHotdeploy, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[String], msg] if[binary_operation[member[.msg], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[member[.e], instanceof, type[NoSuchFieldError]]] begin[{] if[call[.isNoSuchFieldOfHtmlPath, parameter[member[.msg]]]] begin[{] call[.throwRebootAfterFreeGenError, parameter[member[.e]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.e], instanceof, type[NoSuchMethodError]]] begin[{] if[binary_operation[call[.isNoSuchMethodOfMessages, parameter[member[.msg]]], ||, call[.isNoSuchMethodOfConfig, parameter[member[.msg]]]]] begin[{] call[.throwRebootAfterFreeGenError, parameter[member[.e]]] else begin[{] None end[}] if[call[.isNoSuchMethodOfDBFlute, parameter[member[.msg]]]] begin[{] call[.throwRebootAfterGenerateError, parameter[member[.e]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[translateToHotdeployErrorIfPossible] operator[SEP] identifier[Error] identifier[e] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[ManagedHotdeploy] operator[SEP] identifier[isHotdeploy] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[final] identifier[String] identifier[msg] operator[=] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msg] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[NoSuchFieldError] operator[SEP] { Keyword[if] operator[SEP] identifier[isNoSuchFieldOfHtmlPath] operator[SEP] identifier[msg] operator[SEP] operator[SEP] { identifier[throwRebootAfterFreeGenError] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[NoSuchMethodError] operator[SEP] { Keyword[if] operator[SEP] identifier[isNoSuchMethodOfMessages] operator[SEP] identifier[msg] operator[SEP] operator[||] identifier[isNoSuchMethodOfConfig] operator[SEP] identifier[msg] operator[SEP] operator[SEP] { identifier[throwRebootAfterFreeGenError] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isNoSuchMethodOfDBFlute] operator[SEP] identifier[msg] operator[SEP] operator[SEP] { identifier[throwRebootAfterGenerateError] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } }
public void shape(char[] text, int start, int count) { checkParams(text, start, count); if (isContextual()) { if (rangeSet == null) { shapeContextually(text, start, count, key); } else { shapeContextually(text, start, count, shapingRange); } } else { shapeNonContextually(text, start, count); } }
class class_name[name] begin[{] method[shape, return_type[void], modifier[public], parameter[text, start, count]] begin[{] call[.checkParams, parameter[member[.text], member[.start], member[.count]]] if[call[.isContextual, parameter[]]] begin[{] if[binary_operation[member[.rangeSet], ==, literal[null]]] begin[{] call[.shapeContextually, parameter[member[.text], member[.start], member[.count], member[.key]]] else begin[{] call[.shapeContextually, parameter[member[.text], member[.start], member[.count], member[.shapingRange]]] end[}] else begin[{] call[.shapeNonContextually, parameter[member[.text], member[.start], member[.count]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[shape] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[text] , Keyword[int] identifier[start] , Keyword[int] identifier[count] operator[SEP] { identifier[checkParams] operator[SEP] identifier[text] , identifier[start] , identifier[count] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isContextual] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[rangeSet] operator[==] Other[null] operator[SEP] { identifier[shapeContextually] operator[SEP] identifier[text] , identifier[start] , identifier[count] , identifier[key] operator[SEP] operator[SEP] } Keyword[else] { identifier[shapeContextually] operator[SEP] identifier[text] , identifier[start] , identifier[count] , identifier[shapingRange] operator[SEP] operator[SEP] } } Keyword[else] { identifier[shapeNonContextually] operator[SEP] identifier[text] , identifier[start] , identifier[count] operator[SEP] operator[SEP] } }
@Nonnull public static List<Path> list(@Nonnull final Path dir) throws IOException { final List<Path> contents = new ArrayList<>(); try (final DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) { for (final Path entry : stream) { contents.add(entry); } } catch (DirectoryIteratorException ex) { // I/O error encounted during the iteration, the cause is an IOException throw ex.getCause(); } return contents; }
class class_name[name] begin[{] method[list, return_type[type[List]], modifier[public static], parameter[dir]] begin[{] local_variable[type[List], contents] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=contents, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['DirectoryIteratorException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=stream, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))], dimensions=[], name=DirectoryStream, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newDirectoryStream, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None))]) return[member[.contents]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Path] operator[>] identifier[list] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[Path] identifier[dir] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] identifier[List] operator[<] identifier[Path] operator[>] identifier[contents] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] Keyword[final] identifier[DirectoryStream] operator[<] identifier[Path] operator[>] identifier[stream] operator[=] identifier[Files] operator[SEP] identifier[newDirectoryStream] operator[SEP] identifier[dir] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[Path] identifier[entry] operator[:] identifier[stream] operator[SEP] { identifier[contents] operator[SEP] identifier[add] operator[SEP] identifier[entry] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[DirectoryIteratorException] identifier[ex] operator[SEP] { Keyword[throw] identifier[ex] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[contents] operator[SEP] }
private K max3(K a, K b, K c) { return max2(a, max2(b, c)); }
class class_name[name] begin[{] method[max3, return_type[type[K]], modifier[private], parameter[a, b, c]] begin[{] return[call[.max2, parameter[member[.a], call[.max2, parameter[member[.b], member[.c]]]]]] end[}] END[}]
Keyword[private] identifier[K] identifier[max3] operator[SEP] identifier[K] identifier[a] , identifier[K] identifier[b] , identifier[K] identifier[c] operator[SEP] { Keyword[return] identifier[max2] operator[SEP] identifier[a] , identifier[max2] operator[SEP] identifier[b] , identifier[c] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isLafAqua() { ensureValidCache(); if (cachedIsLafAqua == null) { cachedIsLafAqua = Boolean.valueOf(computeIsLafAqua()); } return cachedIsLafAqua.booleanValue(); }
class class_name[name] begin[{] method[isLafAqua, return_type[type[boolean]], modifier[public static], parameter[]] begin[{] call[.ensureValidCache, parameter[]] if[binary_operation[member[.cachedIsLafAqua], ==, literal[null]]] begin[{] assign[member[.cachedIsLafAqua], call[Boolean.valueOf, parameter[call[.computeIsLafAqua, parameter[]]]]] else begin[{] None end[}] return[call[cachedIsLafAqua.booleanValue, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isLafAqua] operator[SEP] operator[SEP] { identifier[ensureValidCache] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cachedIsLafAqua] operator[==] Other[null] operator[SEP] { identifier[cachedIsLafAqua] operator[=] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[computeIsLafAqua] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[cachedIsLafAqua] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] }
private static List<Entry<String, String>> formget( Bootstrap bootstrap, String host, int port, String get, URI uriSimple) throws Exception { // XXX /formget // No use of HttpPostRequestEncoder since not a POST Channel channel = bootstrap.connect(host, port).sync().channel(); // Prepare the HTTP request. QueryStringEncoder encoder = new QueryStringEncoder(get); // add Form attribute encoder.addParam("getform", "GET"); encoder.addParam("info", "first value"); encoder.addParam("secondinfo", "secondvalue ���&"); // not the big one since it is not compatible with GET size // encoder.addParam("thirdinfo", textArea); encoder.addParam("thirdinfo", "third value\r\ntest second line\r\n\r\nnew line\r\n"); encoder.addParam("Send", "Send"); URI uriGet = new URI(encoder.toString()); HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uriGet.toASCIIString()); HttpHeaders headers = request.headers(); headers.set(HttpHeaderNames.HOST, host); headers.set(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE); headers.set(HttpHeaderNames.ACCEPT_ENCODING, HttpHeaderValues.GZIP + "," + HttpHeaderValues.DEFLATE); headers.set(HttpHeaderNames.ACCEPT_CHARSET, "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); headers.set(HttpHeaderNames.ACCEPT_LANGUAGE, "fr"); headers.set(HttpHeaderNames.REFERER, uriSimple.toString()); headers.set(HttpHeaderNames.USER_AGENT, "Netty Simple Http Client side"); headers.set(HttpHeaderNames.ACCEPT, "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); //connection will not close but needed // headers.set("Connection","keep-alive"); // headers.set("Keep-Alive","300"); headers.set( HttpHeaderNames.COOKIE, ClientCookieEncoder.STRICT.encode( new DefaultCookie("my-cookie", "foo"), new DefaultCookie("another-cookie", "bar")) ); // send request channel.writeAndFlush(request); // Wait for the server to close the connection. channel.closeFuture().sync(); // convert headers to list return headers.entries(); }
class class_name[name] begin[{] method[formget, return_type[type[List]], modifier[private static], parameter[bootstrap, host, port, get, uriSimple]] begin[{] local_variable[type[Channel], channel] local_variable[type[QueryStringEncoder], encoder] call[encoder.addParam, parameter[literal["getform"], literal["GET"]]] call[encoder.addParam, parameter[literal["info"], literal["first value"]]] call[encoder.addParam, parameter[literal["secondinfo"], literal["secondvalue ���&"]]] call[encoder.addParam, parameter[literal["thirdinfo"], literal["third value\r\ntest second line\r\n\r\nnew line\r\n"]]] call[encoder.addParam, parameter[literal["Send"], literal["Send"]]] local_variable[type[URI], uriGet] local_variable[type[HttpRequest], request] local_variable[type[HttpHeaders], headers] call[headers.set, parameter[member[HttpHeaderNames.HOST], member[.host]]] call[headers.set, parameter[member[HttpHeaderNames.CONNECTION], member[HttpHeaderValues.CLOSE]]] call[headers.set, parameter[member[HttpHeaderNames.ACCEPT_ENCODING], binary_operation[binary_operation[member[HttpHeaderValues.GZIP], +, literal[","]], +, member[HttpHeaderValues.DEFLATE]]]] call[headers.set, parameter[member[HttpHeaderNames.ACCEPT_CHARSET], literal["ISO-8859-1,utf-8;q=0.7,*;q=0.7"]]] call[headers.set, parameter[member[HttpHeaderNames.ACCEPT_LANGUAGE], literal["fr"]]] call[headers.set, parameter[member[HttpHeaderNames.REFERER], call[uriSimple.toString, parameter[]]]] call[headers.set, parameter[member[HttpHeaderNames.USER_AGENT], literal["Netty Simple Http Client side"]]] call[headers.set, parameter[member[HttpHeaderNames.ACCEPT], literal["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"]]] call[headers.set, parameter[member[HttpHeaderNames.COOKIE], call[ClientCookieEncoder.STRICT.encode, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="my-cookie"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="foo")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultCookie, sub_type=None)), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="another-cookie"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bar")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultCookie, sub_type=None))]]]] call[channel.writeAndFlush, parameter[member[.request]]] call[channel.closeFuture, parameter[]] return[call[headers.entries, parameter[]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] operator[>] identifier[formget] operator[SEP] identifier[Bootstrap] identifier[bootstrap] , identifier[String] identifier[host] , Keyword[int] identifier[port] , identifier[String] identifier[get] , identifier[URI] identifier[uriSimple] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Channel] identifier[channel] operator[=] identifier[bootstrap] operator[SEP] identifier[connect] operator[SEP] identifier[host] , identifier[port] operator[SEP] operator[SEP] identifier[sync] operator[SEP] operator[SEP] operator[SEP] identifier[channel] operator[SEP] operator[SEP] operator[SEP] identifier[QueryStringEncoder] identifier[encoder] operator[=] Keyword[new] identifier[QueryStringEncoder] operator[SEP] identifier[get] operator[SEP] operator[SEP] identifier[encoder] operator[SEP] identifier[addParam] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[encoder] operator[SEP] identifier[addParam] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[encoder] operator[SEP] identifier[addParam] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[encoder] operator[SEP] identifier[addParam] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[encoder] operator[SEP] identifier[addParam] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[URI] identifier[uriGet] operator[=] Keyword[new] identifier[URI] operator[SEP] identifier[encoder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[HttpRequest] identifier[request] operator[=] Keyword[new] identifier[DefaultHttpRequest] operator[SEP] identifier[HttpVersion] operator[SEP] identifier[HTTP_1_1] , identifier[HttpMethod] operator[SEP] identifier[GET] , identifier[uriGet] operator[SEP] identifier[toASCIIString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[HttpHeaders] identifier[headers] operator[=] identifier[request] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[set] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[HOST] , identifier[host] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[set] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[CONNECTION] , identifier[HttpHeaderValues] operator[SEP] identifier[CLOSE] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[set] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[ACCEPT_ENCODING] , identifier[HttpHeaderValues] operator[SEP] identifier[GZIP] operator[+] literal[String] operator[+] identifier[HttpHeaderValues] operator[SEP] identifier[DEFLATE] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[set] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[ACCEPT_CHARSET] , literal[String] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[set] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[ACCEPT_LANGUAGE] , literal[String] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[set] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[REFERER] , identifier[uriSimple] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[set] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[USER_AGENT] , literal[String] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[set] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[ACCEPT] , literal[String] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[set] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[COOKIE] , identifier[ClientCookieEncoder] operator[SEP] identifier[STRICT] operator[SEP] identifier[encode] operator[SEP] Keyword[new] identifier[DefaultCookie] operator[SEP] literal[String] , literal[String] operator[SEP] , Keyword[new] identifier[DefaultCookie] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[channel] operator[SEP] identifier[writeAndFlush] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[channel] operator[SEP] identifier[closeFuture] operator[SEP] operator[SEP] operator[SEP] identifier[sync] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[headers] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] }
public static List<Link> getAllLinksForRelation(HalResource hal, String relation) { List<Link> links = Lists.newArrayList(hal.getLinks(relation)); List<Link> embeddedLinks = hal.getEmbedded().values().stream() .flatMap(embedded -> getAllLinksForRelation(embedded, relation).stream()) .collect(Collectors.toList()); links.addAll(embeddedLinks); return links; }
class class_name[name] begin[{] method[getAllLinksForRelation, return_type[type[List]], modifier[public static], parameter[hal, relation]] begin[{] local_variable[type[List], links] local_variable[type[List], embeddedLinks] call[links.addAll, parameter[member[.embeddedLinks]]] return[member[.links]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Link] operator[>] identifier[getAllLinksForRelation] operator[SEP] identifier[HalResource] identifier[hal] , identifier[String] identifier[relation] operator[SEP] { identifier[List] operator[<] identifier[Link] operator[>] identifier[links] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] identifier[hal] operator[SEP] identifier[getLinks] operator[SEP] identifier[relation] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Link] operator[>] identifier[embeddedLinks] operator[=] identifier[hal] operator[SEP] identifier[getEmbedded] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] identifier[embedded] operator[->] identifier[getAllLinksForRelation] operator[SEP] identifier[embedded] , identifier[relation] operator[SEP] operator[SEP] identifier[stream] 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] identifier[links] operator[SEP] identifier[addAll] operator[SEP] identifier[embeddedLinks] operator[SEP] operator[SEP] Keyword[return] identifier[links] operator[SEP] }
void executeCommand() throws CertificateException { String exceptionMessage; Throwable cause = null; try { if (logger.isLoggable(Level.FINE)) { logger.fine("Executing keytool command: " + this.toString()); } Process proc = Runtime.getRuntime().exec(cmd.toArray(new String[cmd.size()])); if (logger.isLoggable(Level.FINE)) { logger.fine("Waiting for keytool command process to complete..."); } int exitCode = proc.waitFor(); if (exitCode == 0) { if (logger.isLoggable(Level.FINE)) { logger.fine("keytool command process completed successfully"); } return; } else { if (logger.isLoggable(Level.FINE)) { logger.fine("keytool command process failed to complete successfully (exit code: " + exitCode + ")"); } exceptionMessage = getProcErrorOutput(proc); } } catch (IOException e) { if (logger.isLoggable(Level.FINE)) { logger.fine("keytool command process execution resulted in IOException: " + e.getMessage()); } exceptionMessage = e.getLocalizedMessage(); cause = e; } catch (InterruptedException e) { if (logger.isLoggable(Level.FINE)) { logger.fine("InterruptedException while waiting for keytool command process result: " + e.getMessage()); } exceptionMessage = e.getLocalizedMessage(); cause = e; } if (cause != null) { throw new CertificateException(exceptionMessage, cause); } else { throw new CertificateException(exceptionMessage); } }
class class_name[name] begin[{] method[executeCommand, return_type[void], modifier[default], parameter[]] begin[{] local_variable[type[String], exceptionMessage] local_variable[type[Throwable], cause] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Executing keytool command: "), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+)], member=fine, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRuntime, postfix_operators=[], prefix_operators=[], qualifier=Runtime, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=cmd, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=cmd, selectors=[], type_arguments=None)], member=exec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=proc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Process, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Waiting for keytool command process to complete...")], member=fine, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=waitFor, postfix_operators=[], prefix_operators=[], qualifier=proc, selectors=[], type_arguments=None), name=exitCode)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=exitCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), 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="keytool command process failed to complete successfully (exit code: "), operandr=MemberReference(member=exitCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], member=fine, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=exceptionMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=proc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProcErrorOutput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="keytool command process completed successfully")], member=fine, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=None, label=None)]))], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="keytool command process execution resulted in IOException: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=fine, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=exceptionMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException'])), CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="InterruptedException while waiting for keytool command process result: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=fine, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=exceptionMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.cause], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=exceptionMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cause, 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=CertificateException, sub_type=None)), label=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=exceptionMessage, 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=CertificateException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[void] identifier[executeCommand] operator[SEP] operator[SEP] Keyword[throws] identifier[CertificateException] { identifier[String] identifier[exceptionMessage] operator[SEP] identifier[Throwable] identifier[cause] operator[=] Other[null] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Process] identifier[proc] operator[=] identifier[Runtime] operator[SEP] identifier[getRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[exec] operator[SEP] identifier[cmd] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[cmd] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[exitCode] operator[=] identifier[proc] operator[SEP] identifier[waitFor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[exitCode] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[exitCode] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[exceptionMessage] operator[=] identifier[getProcErrorOutput] operator[SEP] identifier[proc] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[exceptionMessage] operator[=] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] operator[SEP] identifier[cause] operator[=] identifier[e] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[exceptionMessage] operator[=] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] operator[SEP] identifier[cause] operator[=] identifier[e] operator[SEP] } Keyword[if] operator[SEP] identifier[cause] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[CertificateException] operator[SEP] identifier[exceptionMessage] , identifier[cause] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[CertificateException] operator[SEP] identifier[exceptionMessage] operator[SEP] operator[SEP] } }
public static boolean containsIgnoreCase(final String string, final String[] strings) { if (null == strings) { return false; } return Arrays.stream(strings).anyMatch(str -> StringUtils.equalsIgnoreCase(string, str)); }
class class_name[name] begin[{] method[containsIgnoreCase, return_type[type[boolean]], modifier[public static], parameter[string, strings]] begin[{] if[binary_operation[literal[null], ==, member[.strings]]] begin[{] return[literal[false]] else begin[{] None end[}] return[call[Arrays.stream, parameter[member[.strings]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[containsIgnoreCase] operator[SEP] Keyword[final] identifier[String] identifier[string] , Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[strings] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[strings] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[strings] operator[SEP] operator[SEP] identifier[anyMatch] operator[SEP] identifier[str] operator[->] identifier[StringUtils] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[string] , identifier[str] operator[SEP] operator[SEP] operator[SEP] }
private Object readResponse(Type returnType, InputStream input, String id) throws Throwable { ReadContext context = ReadContext.getReadContext(input, mapper); ObjectNode jsonObject = getValidResponse(id, context); notifyAnswerListener(jsonObject); handleErrorResponse(jsonObject); if (hasResult(jsonObject)) { if (isReturnTypeInvalid(returnType)) { return null; } return constructResponseObject(returnType, jsonObject); } // no return type return null; }
class class_name[name] begin[{] method[readResponse, return_type[type[Object]], modifier[private], parameter[returnType, input, id]] begin[{] local_variable[type[ReadContext], context] local_variable[type[ObjectNode], jsonObject] call[.notifyAnswerListener, parameter[member[.jsonObject]]] call[.handleErrorResponse, parameter[member[.jsonObject]]] if[call[.hasResult, parameter[member[.jsonObject]]]] begin[{] if[call[.isReturnTypeInvalid, parameter[member[.returnType]]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[.constructResponseObject, parameter[member[.returnType], member[.jsonObject]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] identifier[Object] identifier[readResponse] operator[SEP] identifier[Type] identifier[returnType] , identifier[InputStream] identifier[input] , identifier[String] identifier[id] operator[SEP] Keyword[throws] identifier[Throwable] { identifier[ReadContext] identifier[context] operator[=] identifier[ReadContext] operator[SEP] identifier[getReadContext] operator[SEP] identifier[input] , identifier[mapper] operator[SEP] operator[SEP] identifier[ObjectNode] identifier[jsonObject] operator[=] identifier[getValidResponse] operator[SEP] identifier[id] , identifier[context] operator[SEP] operator[SEP] identifier[notifyAnswerListener] operator[SEP] identifier[jsonObject] operator[SEP] operator[SEP] identifier[handleErrorResponse] operator[SEP] identifier[jsonObject] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasResult] operator[SEP] identifier[jsonObject] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isReturnTypeInvalid] operator[SEP] identifier[returnType] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[constructResponseObject] operator[SEP] identifier[returnType] , identifier[jsonObject] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public final static Method getAttributeSetter(Class cls, String attr, Class type) throws NoSuchMethodException { StringBuffer buf = new StringBuffer(attr.length() + 3); buf.append("set"); if(Character.isLowerCase(attr.charAt(0))) { buf.append(Character.toUpperCase(attr.charAt(0))) .append(attr.substring(1)); } else { buf.append(attr); } return cls.getMethod(buf.toString(), new Class[]{type}); }
class class_name[name] begin[{] method[getAttributeSetter, return_type[type[Method]], modifier[final public static], parameter[cls, attr, type]] begin[{] local_variable[type[StringBuffer], buf] call[buf.append, parameter[literal["set"]]] if[call[Character.isLowerCase, parameter[call[attr.charAt, parameter[literal[0]]]]]] begin[{] call[buf.append, parameter[call[Character.toUpperCase, parameter[call[attr.charAt, parameter[literal[0]]]]]]] else begin[{] call[buf.append, parameter[member[.attr]]] end[}] return[call[cls.getMethod, parameter[call[buf.toString, parameter[]], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[static] identifier[Method] identifier[getAttributeSetter] operator[SEP] identifier[Class] identifier[cls] , identifier[String] identifier[attr] , identifier[Class] identifier[type] operator[SEP] Keyword[throws] identifier[NoSuchMethodException] { identifier[StringBuffer] identifier[buf] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[attr] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[3] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isLowerCase] operator[SEP] identifier[attr] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[attr] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[attr] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[attr] operator[SEP] operator[SEP] } Keyword[return] identifier[cls] operator[SEP] identifier[getMethod] operator[SEP] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[type] } operator[SEP] operator[SEP] }
private <M extends PMessage<M, F>, F extends PField> Pair<M, Set<String>> checkAndParseInternal(@Nonnull Path configFile, @Nullable M parent, String... includeStack) throws ProvidenceConfigException { try { // So we map actual loaded files by the absolute canonical location. String canonicalFile = readCanonicalPath(configFile).toString(); List<String> stackList = new ArrayList<>(); Collections.addAll(stackList, includeStack); if (Arrays.binarySearch(includeStack, canonicalFile) >= 0) { stackList.add(canonicalFile); throw new ProvidenceConfigException("Circular includes detected: " + String.join( " -> ", stackList.stream() .map(p -> new File(p).getName()) .collect(Collectors.toList()))); } stackList.add(canonicalFile); return parseConfigRecursively(configFile, parent, stackList.toArray(new String[0])); } catch (IOException e) { if (e instanceof ProvidenceConfigException) { ProvidenceConfigException pce = (ProvidenceConfigException) e; if (pce.getFile() == null) { pce.setFile(configFile.getFileName() .toString()); } throw pce; } if (e instanceof TokenizerException) { TokenizerException te = (TokenizerException) e; if (te.getFile() == null) { te.setFile(configFile.getFileName() .toString()); } throw new ProvidenceConfigException(te); } throw new ProvidenceConfigException(e, e.getMessage()).setFile(configFile.getFileName() .toString()); } }
class class_name[name] begin[{] method[checkAndParseInternal, return_type[type[Pair]], modifier[private], parameter[configFile, parent, includeStack]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=configFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readCanonicalPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=canonicalFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, 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=[], dimensions=None, name=ArrayList, sub_type=None)), name=stackList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stackList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=includeStack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=includeStack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=canonicalFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=binarySearch, postfix_operators=[], prefix_operators=[], qualifier=Arrays, 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=[MemberReference(member=canonicalFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=stackList, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Circular includes detected: "), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" -> "), MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=stackList, selectors=[MethodInvocation(arguments=[LambdaExpression(body=ClassCreator(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), parameters=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toList, postfix_operators=[], prefix_operators=[], qualifier=Collectors, selectors=[], type_arguments=None)], member=collect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=join, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProvidenceConfigException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=canonicalFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=stackList, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=configFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, 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=String, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=stackList, selectors=[], type_arguments=None)], member=parseConfigRecursively, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ProvidenceConfigException, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ProvidenceConfigException, sub_type=None)), name=pce)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProvidenceConfigException, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=pce, 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=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFileName, postfix_operators=[], prefix_operators=[], qualifier=configFile, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setFile, postfix_operators=[], prefix_operators=[], qualifier=pce, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=MemberReference(member=pce, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=TokenizerException, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TokenizerException, sub_type=None)), name=te)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TokenizerException, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=te, 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=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFileName, postfix_operators=[], prefix_operators=[], qualifier=configFile, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setFile, postfix_operators=[], prefix_operators=[], qualifier=te, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=te, 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=ProvidenceConfigException, sub_type=None)), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFileName, postfix_operators=[], prefix_operators=[], qualifier=configFile, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ProvidenceConfigException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] operator[<] identifier[M] Keyword[extends] identifier[PMessage] operator[<] identifier[M] , identifier[F] operator[>] , identifier[F] Keyword[extends] identifier[PField] operator[>] identifier[Pair] operator[<] identifier[M] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[checkAndParseInternal] operator[SEP] annotation[@] identifier[Nonnull] identifier[Path] identifier[configFile] , annotation[@] identifier[Nullable] identifier[M] identifier[parent] , identifier[String] operator[...] identifier[includeStack] operator[SEP] Keyword[throws] identifier[ProvidenceConfigException] { Keyword[try] { identifier[String] identifier[canonicalFile] operator[=] identifier[readCanonicalPath] operator[SEP] identifier[configFile] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[stackList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[addAll] operator[SEP] identifier[stackList] , identifier[includeStack] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Arrays] operator[SEP] identifier[binarySearch] operator[SEP] identifier[includeStack] , identifier[canonicalFile] operator[SEP] operator[>=] Other[0] operator[SEP] { identifier[stackList] operator[SEP] identifier[add] operator[SEP] identifier[canonicalFile] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ProvidenceConfigException] operator[SEP] literal[String] operator[+] identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[stackList] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[p] operator[->] Keyword[new] identifier[File] operator[SEP] identifier[p] operator[SEP] operator[SEP] identifier[getName] 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] operator[SEP] operator[SEP] } identifier[stackList] operator[SEP] identifier[add] operator[SEP] identifier[canonicalFile] operator[SEP] operator[SEP] Keyword[return] identifier[parseConfigRecursively] operator[SEP] identifier[configFile] , identifier[parent] , identifier[stackList] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[ProvidenceConfigException] operator[SEP] { identifier[ProvidenceConfigException] identifier[pce] operator[=] operator[SEP] identifier[ProvidenceConfigException] operator[SEP] identifier[e] operator[SEP] Keyword[if] operator[SEP] identifier[pce] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[pce] operator[SEP] identifier[setFile] operator[SEP] identifier[configFile] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] identifier[pce] operator[SEP] } Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[TokenizerException] operator[SEP] { identifier[TokenizerException] identifier[te] operator[=] operator[SEP] identifier[TokenizerException] operator[SEP] identifier[e] operator[SEP] Keyword[if] operator[SEP] identifier[te] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[te] operator[SEP] identifier[setFile] operator[SEP] identifier[configFile] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[ProvidenceConfigException] operator[SEP] identifier[te] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[ProvidenceConfigException] operator[SEP] identifier[e] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setFile] operator[SEP] identifier[configFile] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public long getUInt32(int index) throws IOException { validateIndex(index, 4); if (_isMotorolaByteOrder) { // Motorola - MSB first (big endian) return (((long)getByte(index )) << 24 & 0xFF000000L) | (((long)getByte(index + 1)) << 16 & 0xFF0000L) | (((long)getByte(index + 2)) << 8 & 0xFF00L) | (((long)getByte(index + 3)) & 0xFFL); } else { // Intel ordering - LSB first (little endian) return (((long)getByte(index + 3)) << 24 & 0xFF000000L) | (((long)getByte(index + 2)) << 16 & 0xFF0000L) | (((long)getByte(index + 1)) << 8 & 0xFF00L) | (((long)getByte(index )) & 0xFFL); } }
class class_name[name] begin[{] method[getUInt32, return_type[type[long]], modifier[public], parameter[index]] begin[{] call[.validateIndex, parameter[member[.index], literal[4]]] if[member[._isMotorolaByteOrder]] begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[Cast(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), <<, literal[24]], &, literal[0xFF000000L]], |, binary_operation[binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), <<, literal[16]], &, literal[0xFF0000L]]], |, binary_operation[binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), <<, literal[8]], &, literal[0xFF00L]]], |, binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+)], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), &, literal[0xFFL]]]] else begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+)], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), <<, literal[24]], &, literal[0xFF000000L]], |, binary_operation[binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), <<, literal[16]], &, literal[0xFF0000L]]], |, binary_operation[binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), <<, literal[8]], &, literal[0xFF00L]]], |, binary_operation[Cast(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), &, literal[0xFFL]]]] end[}] end[}] END[}]
Keyword[public] Keyword[long] identifier[getUInt32] operator[SEP] Keyword[int] identifier[index] operator[SEP] Keyword[throws] identifier[IOException] { identifier[validateIndex] operator[SEP] identifier[index] , Other[4] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_isMotorolaByteOrder] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[<<] Other[24] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] operator[<<] Other[16] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[+] Other[2] operator[SEP] operator[SEP] operator[<<] Other[8] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[+] Other[3] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[+] Other[3] operator[SEP] operator[SEP] operator[<<] Other[24] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[+] Other[2] operator[SEP] operator[SEP] operator[<<] Other[16] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] operator[<<] Other[8] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] } }
public static double calculateScaledResidual(double[][] A, double[][] X, double[][] B){ DoubleMatrix2D AMatrix = DoubleFactory2D.dense.make(A); DoubleMatrix2D XMatrix = DoubleFactory2D.dense.make(X); DoubleMatrix2D BMatrix = DoubleFactory2D.dense.make(B); return calculateScaledResidual(AMatrix, XMatrix, BMatrix); }
class class_name[name] begin[{] method[calculateScaledResidual, return_type[type[double]], modifier[public static], parameter[A, X, B]] begin[{] local_variable[type[DoubleMatrix2D], AMatrix] local_variable[type[DoubleMatrix2D], XMatrix] local_variable[type[DoubleMatrix2D], BMatrix] return[call[.calculateScaledResidual, parameter[member[.AMatrix], member[.XMatrix], member[.BMatrix]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[calculateScaledResidual] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[A] , Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[X] , Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[B] operator[SEP] { identifier[DoubleMatrix2D] identifier[AMatrix] operator[=] identifier[DoubleFactory2D] operator[SEP] identifier[dense] operator[SEP] identifier[make] operator[SEP] identifier[A] operator[SEP] operator[SEP] identifier[DoubleMatrix2D] identifier[XMatrix] operator[=] identifier[DoubleFactory2D] operator[SEP] identifier[dense] operator[SEP] identifier[make] operator[SEP] identifier[X] operator[SEP] operator[SEP] identifier[DoubleMatrix2D] identifier[BMatrix] operator[=] identifier[DoubleFactory2D] operator[SEP] identifier[dense] operator[SEP] identifier[make] operator[SEP] identifier[B] operator[SEP] operator[SEP] Keyword[return] identifier[calculateScaledResidual] operator[SEP] identifier[AMatrix] , identifier[XMatrix] , identifier[BMatrix] operator[SEP] operator[SEP] }
public static MozuUrl getChildCategoriesUrl(Integer categoryId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/{categoryId}/children?responseFields={responseFields}"); formatter.formatUrl("categoryId", categoryId); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
class class_name[name] begin[{] method[getChildCategoriesUrl, return_type[type[MozuUrl]], modifier[public static], parameter[categoryId, responseFields]] begin[{] local_variable[type[UrlFormatter], formatter] call[formatter.formatUrl, parameter[literal["categoryId"], member[.categoryId]]] call[formatter.formatUrl, parameter[literal["responseFields"], member[.responseFields]]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getResourceUrl, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None), MemberReference(member=TENANT_POD, postfix_operators=[], prefix_operators=[], qualifier=MozuUrl.UrlLocation, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MozuUrl, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[MozuUrl] identifier[getChildCategoriesUrl] operator[SEP] identifier[Integer] identifier[categoryId] , identifier[String] identifier[responseFields] operator[SEP] { identifier[UrlFormatter] identifier[formatter] operator[=] Keyword[new] identifier[UrlFormatter] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[categoryId] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[responseFields] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[MozuUrl] operator[SEP] identifier[formatter] operator[SEP] identifier[getResourceUrl] operator[SEP] operator[SEP] , identifier[MozuUrl] operator[SEP] identifier[UrlLocation] operator[SEP] identifier[TENANT_POD] operator[SEP] operator[SEP] }
public ModuleInfoList filter(final ModuleInfoFilter filter) { final ModuleInfoList moduleInfoFiltered = new ModuleInfoList(); for (final ModuleInfo resource : this) { if (filter.accept(resource)) { moduleInfoFiltered.add(resource); } } return moduleInfoFiltered; }
class class_name[name] begin[{] method[filter, return_type[type[ModuleInfoList]], modifier[public], parameter[filter]] begin[{] local_variable[type[ModuleInfoList], moduleInfoFiltered] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=moduleInfoFiltered, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=resource)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ModuleInfo, sub_type=None))), label=None) return[member[.moduleInfoFiltered]] end[}] END[}]
Keyword[public] identifier[ModuleInfoList] identifier[filter] operator[SEP] Keyword[final] identifier[ModuleInfoFilter] identifier[filter] operator[SEP] { Keyword[final] identifier[ModuleInfoList] identifier[moduleInfoFiltered] operator[=] Keyword[new] identifier[ModuleInfoList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[ModuleInfo] identifier[resource] operator[:] Keyword[this] operator[SEP] { Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[accept] operator[SEP] identifier[resource] operator[SEP] operator[SEP] { identifier[moduleInfoFiltered] operator[SEP] identifier[add] operator[SEP] identifier[resource] operator[SEP] operator[SEP] } } Keyword[return] identifier[moduleInfoFiltered] operator[SEP] }
public JFreeChartRender setStyle(int style) { switch (style) { case JFreeChartRender.STYLE_THESIS: return this.setBaseShapesVisible(true). setBaseShapesFilled(false). setBaseLinesVisible(false). setLegendItemFont(new Font("Dialog", Font.PLAIN, 9)). setBackgroundPaint(Color.white). setGridPaint(Color.gray). setInsertLast(false). removeLegend(); case JFreeChartRender.STYLE_THESIS_LEGEND: return this.setBaseShapesVisible(true). setBaseShapesFilled(false). setBaseLinesVisible(false). setLegendItemFont(new Font("Dialog", Font.PLAIN, 9)). setBackgroundPaint(Color.white). setGridPaint(Color.gray). setInsertLast(false); default: return this; } }
class class_name[name] begin[{] method[setStyle, return_type[type[JFreeChartRender]], modifier[public], parameter[style]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=STYLE_THESIS, postfix_operators=[], prefix_operators=[], qualifier=JFreeChartRender, selectors=[])], statements=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setBaseShapesVisible, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setBaseShapesFilled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setBaseLinesVisible, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Dialog"), MemberReference(member=PLAIN, postfix_operators=[], prefix_operators=[], qualifier=Font, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=9)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Font, sub_type=None))], member=setLegendItemFont, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=white, postfix_operators=[], prefix_operators=[], qualifier=Color, selectors=[])], member=setBackgroundPaint, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=gray, postfix_operators=[], prefix_operators=[], qualifier=Color, selectors=[])], member=setGridPaint, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setInsertLast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=removeLegend, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), SwitchStatementCase(case=[MemberReference(member=STYLE_THESIS_LEGEND, postfix_operators=[], prefix_operators=[], qualifier=JFreeChartRender, selectors=[])], statements=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setBaseShapesVisible, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setBaseShapesFilled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setBaseLinesVisible, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Dialog"), MemberReference(member=PLAIN, postfix_operators=[], prefix_operators=[], qualifier=Font, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=9)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Font, sub_type=None))], member=setLegendItemFont, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=white, postfix_operators=[], prefix_operators=[], qualifier=Color, selectors=[])], member=setBackgroundPaint, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=gray, postfix_operators=[], prefix_operators=[], qualifier=Color, selectors=[])], member=setGridPaint, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setInsertLast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), label=None)])], expression=MemberReference(member=style, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] identifier[JFreeChartRender] identifier[setStyle] operator[SEP] Keyword[int] identifier[style] operator[SEP] { Keyword[switch] operator[SEP] identifier[style] operator[SEP] { Keyword[case] identifier[JFreeChartRender] operator[SEP] identifier[STYLE_THESIS] operator[:] Keyword[return] Keyword[this] operator[SEP] identifier[setBaseShapesVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[setBaseShapesFilled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[setBaseLinesVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[setLegendItemFont] operator[SEP] Keyword[new] identifier[Font] operator[SEP] literal[String] , identifier[Font] operator[SEP] identifier[PLAIN] , Other[9] operator[SEP] operator[SEP] operator[SEP] identifier[setBackgroundPaint] operator[SEP] identifier[Color] operator[SEP] identifier[white] operator[SEP] operator[SEP] identifier[setGridPaint] operator[SEP] identifier[Color] operator[SEP] identifier[gray] operator[SEP] operator[SEP] identifier[setInsertLast] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[removeLegend] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[JFreeChartRender] operator[SEP] identifier[STYLE_THESIS_LEGEND] operator[:] Keyword[return] Keyword[this] operator[SEP] identifier[setBaseShapesVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[setBaseShapesFilled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[setBaseLinesVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[setLegendItemFont] operator[SEP] Keyword[new] identifier[Font] operator[SEP] literal[String] , identifier[Font] operator[SEP] identifier[PLAIN] , Other[9] operator[SEP] operator[SEP] operator[SEP] identifier[setBackgroundPaint] operator[SEP] identifier[Color] operator[SEP] identifier[white] operator[SEP] operator[SEP] identifier[setGridPaint] operator[SEP] identifier[Color] operator[SEP] identifier[gray] operator[SEP] operator[SEP] identifier[setInsertLast] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[return] Keyword[this] operator[SEP] } }
public void removeAllTopicAcls() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "removeAllTopicAcls"); ArrayList topicAclList = null; try { // Remove from the HashMap, with synch, there may be other accessors synchronized(_targets) { // Build a list of the existing ACLs topicAclList = new ArrayList(_targets.size()); Iterator itr = _targets.keySet().iterator(); while (itr.hasNext()) { Object key = itr.next(); if (key instanceof TopicAcl) { topicAclList.add(key); } } // Now remove the ACLs from the targets Map Iterator aclIter = topicAclList.iterator(); while (aclIter.hasNext()) { Object key = aclIter.next(); removeTarget(key); } } } catch (MatchingException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeAllTopicAcls", "1:2188:1.117.1.11", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "removeAllTopicAcls", "SICoreException"); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.matching.MessageProcessorMatching", "1:2199:1.117.1.11", e }); throw new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.matching.MessageProcessorMatching", "1:2207:1.117.1.11", e }, null), e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "removeAllTopicAcls"); }
class class_name[name] begin[{] method[removeAllTopicAcls, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["removeAllTopicAcls"]]] else begin[{] None end[}] local_variable[type[ArrayList], topicAclList] TryStatement(block=[SynchronizedStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=topicAclList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_targets, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=_targets, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=itr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=itr, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=TopicAcl, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=topicAclList, selectors=[], type_arguments=None), label=None)]))]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=itr, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=topicAclList, selectors=[], type_arguments=None), name=aclIter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=aclIter, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeTarget, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=aclIter, selectors=[], type_arguments=None), label=None)], label=None, lock=MemberReference(member=_targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeAllTopicAcls"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:2188:1.117.1.11"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="removeAllTopicAcls"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SICoreException")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTERNAL_MESSAGING_ERROR_CWSIP0002"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.matching.MessageProcessorMatching"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:2199:1.117.1.11"), MemberReference(member=e, 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=error, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTERNAL_MESSAGING_ERROR_CWSIP0002"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.matching.MessageProcessorMatching"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:2207:1.117.1.11"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None), 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=SIErrorException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MatchingException']))], finally_block=None, label=None, resources=None) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["removeAllTopicAcls"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[removeAllTopicAcls] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[ArrayList] identifier[topicAclList] operator[=] Other[null] operator[SEP] Keyword[try] { Keyword[synchronized] operator[SEP] identifier[_targets] operator[SEP] { identifier[topicAclList] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] identifier[_targets] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] identifier[itr] operator[=] identifier[_targets] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itr] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[key] operator[=] identifier[itr] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] Keyword[instanceof] identifier[TopicAcl] operator[SEP] { identifier[topicAclList] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP] } } identifier[Iterator] identifier[aclIter] operator[=] identifier[topicAclList] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[aclIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[key] operator[=] identifier[aclIter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[removeTarget] operator[SEP] identifier[key] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[MatchingException] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] , literal[String] , identifier[e] } operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SIErrorException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] , literal[String] , identifier[e] } , Other[null] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public static PropertyBuilder getInstance(Context context, ClassDoc classDoc, PropertyWriter writer) { return new PropertyBuilder(context, classDoc, writer); }
class class_name[name] begin[{] method[getInstance, return_type[type[PropertyBuilder]], modifier[public static], parameter[context, classDoc, writer]] begin[{] return[ClassCreator(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classDoc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writer, 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=PropertyBuilder, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[PropertyBuilder] identifier[getInstance] operator[SEP] identifier[Context] identifier[context] , identifier[ClassDoc] identifier[classDoc] , identifier[PropertyWriter] identifier[writer] operator[SEP] { Keyword[return] Keyword[new] identifier[PropertyBuilder] operator[SEP] identifier[context] , identifier[classDoc] , identifier[writer] operator[SEP] operator[SEP] }
public static boolean startDefaultHandlers(HttpServerExchange httpServerExchange) { // check if defaultHandlers is empty if(defaultHandlers != null && defaultHandlers.size() > 0) { httpServerExchange.putAttachment(CHAIN_ID, "defaultHandlers"); httpServerExchange.putAttachment(CHAIN_SEQ, 0); return true; } return false; }
class class_name[name] begin[{] method[startDefaultHandlers, return_type[type[boolean]], modifier[public static], parameter[httpServerExchange]] begin[{] if[binary_operation[binary_operation[member[.defaultHandlers], !=, literal[null]], &&, binary_operation[call[defaultHandlers.size, parameter[]], >, literal[0]]]] begin[{] call[httpServerExchange.putAttachment, parameter[member[.CHAIN_ID], literal["defaultHandlers"]]] call[httpServerExchange.putAttachment, parameter[member[.CHAIN_SEQ], literal[0]]] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[startDefaultHandlers] operator[SEP] identifier[HttpServerExchange] identifier[httpServerExchange] operator[SEP] { Keyword[if] operator[SEP] identifier[defaultHandlers] operator[!=] Other[null] operator[&&] identifier[defaultHandlers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[httpServerExchange] operator[SEP] identifier[putAttachment] operator[SEP] identifier[CHAIN_ID] , literal[String] operator[SEP] operator[SEP] identifier[httpServerExchange] operator[SEP] identifier[putAttachment] operator[SEP] identifier[CHAIN_SEQ] , Other[0] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static void unescapeXml(final String text, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } if (text == null) { return; } if (text.indexOf('&') < 0) { // Fail fast, avoid more complex (and less JIT-table) method to execute if not needed writer.write(text); return; } // The chosen symbols (1.0 or 1.1) don't really matter, as both contain the same CERs XmlEscapeUtil.unescape(new InternalStringReader(text), writer, XmlEscapeSymbols.XML11_SYMBOLS); }
class class_name[name] begin[{] method[unescapeXml, return_type[void], modifier[public static], parameter[text, writer]] begin[{] if[binary_operation[member[.writer], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Argument 'writer' 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[.text], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[call[text.indexOf, parameter[literal['&']]], <, literal[0]]] begin[{] call[writer.write, parameter[member[.text]]] return[None] else begin[{] None end[}] call[XmlEscapeUtil.unescape, parameter[ClassCreator(arguments=[MemberReference(member=text, 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=InternalStringReader, sub_type=None)), member[.writer], member[XmlEscapeSymbols.XML11_SYMBOLS]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[unescapeXml] operator[SEP] Keyword[final] identifier[String] identifier[text] , Keyword[final] identifier[Writer] identifier[writer] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[writer] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[text] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[text] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[<] Other[0] operator[SEP] { identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[text] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[XmlEscapeUtil] operator[SEP] identifier[unescape] operator[SEP] Keyword[new] identifier[InternalStringReader] operator[SEP] identifier[text] operator[SEP] , identifier[writer] , identifier[XmlEscapeSymbols] operator[SEP] identifier[XML11_SYMBOLS] operator[SEP] operator[SEP] }
static public boolean isJaninoAvailable() { ClassLoader classLoader = EnvUtil.class.getClassLoader(); try { Class<?> bindingClass = classLoader.loadClass("org.codehaus.janino.ScriptEvaluator"); return bindingClass != null; } catch (ClassNotFoundException e) { return false; } }
class class_name[name] begin[{] method[isJaninoAvailable, return_type[type[boolean]], modifier[public static], parameter[]] begin[{] local_variable[type[ClassLoader], classLoader] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.codehaus.janino.ScriptEvaluator")], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=classLoader, selectors=[], type_arguments=None), name=bindingClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=bindingClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), 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=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[static] Keyword[public] Keyword[boolean] identifier[isJaninoAvailable] operator[SEP] operator[SEP] { identifier[ClassLoader] identifier[classLoader] operator[=] identifier[EnvUtil] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Class] operator[<] operator[?] operator[>] identifier[bindingClass] operator[=] identifier[classLoader] operator[SEP] identifier[loadClass] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[bindingClass] operator[!=] Other[null] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } }
public static synchronized <T> IExpectationSetters<T> expectNew(Class<T> type, Class<?>[] parameterTypes, Object... arguments) throws Exception { return doExpectNew(type, new DefaultMockStrategy(), parameterTypes, arguments); }
class class_name[name] begin[{] method[expectNew, return_type[type[IExpectationSetters]], modifier[synchronized public static], parameter[type, parameterTypes, arguments]] begin[{] return[call[.doExpectNew, parameter[member[.type], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultMockStrategy, sub_type=None)), member[.parameterTypes], member[.arguments]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[synchronized] operator[<] identifier[T] operator[>] identifier[IExpectationSetters] operator[<] identifier[T] operator[>] identifier[expectNew] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] , identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[parameterTypes] , identifier[Object] operator[...] identifier[arguments] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[return] identifier[doExpectNew] operator[SEP] identifier[type] , Keyword[new] identifier[DefaultMockStrategy] operator[SEP] operator[SEP] , identifier[parameterTypes] , identifier[arguments] operator[SEP] operator[SEP] }
public static void deleteChildren(ZooKeeper zookeeper, String path, boolean deleteSelf) throws InterruptedException, KeeperException { PathUtils.validatePath(path); List<String> children = zookeeper.getChildren(path, null); for ( String child : children ) { String fullPath = makePath(path, child); deleteChildren(zookeeper, fullPath, true); } if ( deleteSelf ) { try { zookeeper.delete(path, -1); } catch ( KeeperException.NotEmptyException e ) { //someone has created a new child since we checked ... delete again. deleteChildren(zookeeper, path, true); } catch ( KeeperException.NoNodeException e ) { // ignore... someone else has deleted the node it since we checked } } }
class class_name[name] begin[{] method[deleteChildren, return_type[void], modifier[public static], parameter[zookeeper, path, deleteSelf]] begin[{] call[PathUtils.validatePath, parameter[member[.path]]] local_variable[type[List], children] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=makePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=fullPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zookeeper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fullPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=deleteChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=children, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[member[.deleteSelf]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=delete, postfix_operators=[], prefix_operators=[], qualifier=zookeeper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zookeeper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=deleteChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['KeeperException.NotEmptyException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['KeeperException.NoNodeException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[deleteChildren] operator[SEP] identifier[ZooKeeper] identifier[zookeeper] , identifier[String] identifier[path] , Keyword[boolean] identifier[deleteSelf] operator[SEP] Keyword[throws] identifier[InterruptedException] , identifier[KeeperException] { identifier[PathUtils] operator[SEP] identifier[validatePath] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[children] operator[=] identifier[zookeeper] operator[SEP] identifier[getChildren] operator[SEP] identifier[path] , Other[null] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[child] operator[:] identifier[children] operator[SEP] { identifier[String] identifier[fullPath] operator[=] identifier[makePath] operator[SEP] identifier[path] , identifier[child] operator[SEP] operator[SEP] identifier[deleteChildren] operator[SEP] identifier[zookeeper] , identifier[fullPath] , literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[deleteSelf] operator[SEP] { Keyword[try] { identifier[zookeeper] operator[SEP] identifier[delete] operator[SEP] identifier[path] , operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[KeeperException] operator[SEP] identifier[NotEmptyException] identifier[e] operator[SEP] { identifier[deleteChildren] operator[SEP] identifier[zookeeper] , identifier[path] , literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[KeeperException] operator[SEP] identifier[NoNodeException] identifier[e] operator[SEP] { } } }
public Router get(@NotNull final String pattern, @NotNull final IMiddleware... handlers) { addPattern("GET", pattern, handlers, getBindings); return this; }
class class_name[name] begin[{] method[get, return_type[type[Router]], modifier[public], parameter[pattern, handlers]] begin[{] call[.addPattern, parameter[literal["GET"], member[.pattern], member[.handlers], member[.getBindings]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Router] identifier[get] operator[SEP] annotation[@] identifier[NotNull] Keyword[final] identifier[String] identifier[pattern] , annotation[@] identifier[NotNull] Keyword[final] identifier[IMiddleware] operator[...] identifier[handlers] operator[SEP] { identifier[addPattern] operator[SEP] literal[String] , identifier[pattern] , identifier[handlers] , identifier[getBindings] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static String encodeDateTime(DateTimeField field) { Date date = ((DateTimeField)field).getDateTime(); if (date == null) return null; if (field instanceof TimeField) return timeFormat.format(date); else if (field instanceof DateField) return dateFormat.format(date); else // if (field instanceof DateTimeField) return dateTimeFormat.format(date); }
class class_name[name] begin[{] method[encodeDateTime, return_type[type[String]], modifier[public static], parameter[field]] begin[{] local_variable[type[Date], date] if[binary_operation[member[.date], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[member[.field], instanceof, type[TimeField]]] begin[{] return[call[timeFormat.format, parameter[member[.date]]]] else begin[{] if[binary_operation[member[.field], instanceof, type[DateField]]] begin[{] return[call[dateFormat.format, parameter[member[.date]]]] else begin[{] return[call[dateTimeFormat.format, parameter[member[.date]]]] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[encodeDateTime] operator[SEP] identifier[DateTimeField] identifier[field] operator[SEP] { identifier[Date] identifier[date] operator[=] operator[SEP] operator[SEP] identifier[DateTimeField] operator[SEP] identifier[field] operator[SEP] operator[SEP] identifier[getDateTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[date] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[field] Keyword[instanceof] identifier[TimeField] operator[SEP] Keyword[return] identifier[timeFormat] operator[SEP] identifier[format] operator[SEP] identifier[date] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[field] Keyword[instanceof] identifier[DateField] operator[SEP] Keyword[return] identifier[dateFormat] operator[SEP] identifier[format] operator[SEP] identifier[date] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[dateTimeFormat] operator[SEP] identifier[format] operator[SEP] identifier[date] operator[SEP] operator[SEP] }
public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FUNC_ARGS: return is_set_func_args(); case REQUEST_ID: return is_set_request_id(); } throw new IllegalStateException(); }
class class_name[name] begin[{] method[isSet, return_type[type[boolean]], modifier[public], parameter[field]] begin[{] if[binary_operation[member[.field], ==, 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[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=['FUNC_ARGS'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=is_set_func_args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['REQUEST_ID'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=is_set_request_id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) ThrowStatement(expression=ClassCreator(arguments=[], 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) end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isSet] operator[SEP] identifier[_Fields] identifier[field] operator[SEP] { Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[field] operator[SEP] { Keyword[case] identifier[FUNC_ARGS] operator[:] Keyword[return] identifier[is_set_func_args] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[REQUEST_ID] operator[:] Keyword[return] identifier[is_set_request_id] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP] }
public synchronized void cancel() { // If the packet collector has already been cancelled, do nothing. if (cancelled) { return; } cancelled = true; connection.removeStanzaCollector(this); notifyAll(); if (collectorToReset != null) { collectorToReset.cancel(); } }
class class_name[name] begin[{] method[cancel, return_type[void], modifier[synchronized public], parameter[]] begin[{] if[member[.cancelled]] begin[{] return[None] else begin[{] None end[}] assign[member[.cancelled], literal[true]] call[connection.removeStanzaCollector, parameter[THIS[]]] call[.notifyAll, parameter[]] if[binary_operation[member[.collectorToReset], !=, literal[null]]] begin[{] call[collectorToReset.cancel, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[cancel] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[cancelled] operator[SEP] { Keyword[return] operator[SEP] } identifier[cancelled] operator[=] literal[boolean] operator[SEP] identifier[connection] operator[SEP] identifier[removeStanzaCollector] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[notifyAll] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[collectorToReset] operator[!=] Other[null] operator[SEP] { identifier[collectorToReset] operator[SEP] identifier[cancel] operator[SEP] operator[SEP] operator[SEP] } }
public EngineDefaults withCacheNodeTypeSpecificParameters(CacheNodeTypeSpecificParameter... cacheNodeTypeSpecificParameters) { if (this.cacheNodeTypeSpecificParameters == null) { setCacheNodeTypeSpecificParameters(new com.amazonaws.internal.SdkInternalList<CacheNodeTypeSpecificParameter>( cacheNodeTypeSpecificParameters.length)); } for (CacheNodeTypeSpecificParameter ele : cacheNodeTypeSpecificParameters) { this.cacheNodeTypeSpecificParameters.add(ele); } return this; }
class class_name[name] begin[{] method[withCacheNodeTypeSpecificParameters, return_type[type[EngineDefaults]], modifier[public], parameter[cacheNodeTypeSpecificParameters]] begin[{] if[binary_operation[THIS[member[None.cacheNodeTypeSpecificParameters]], ==, literal[null]]] begin[{] call[.setCacheNodeTypeSpecificParameters, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=cacheNodeTypeSpecificParameters, 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=CacheNodeTypeSpecificParameter, 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=cacheNodeTypeSpecificParameters, 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=cacheNodeTypeSpecificParameters, 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=CacheNodeTypeSpecificParameter, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[EngineDefaults] identifier[withCacheNodeTypeSpecificParameters] operator[SEP] identifier[CacheNodeTypeSpecificParameter] operator[...] identifier[cacheNodeTypeSpecificParameters] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[cacheNodeTypeSpecificParameters] operator[==] Other[null] operator[SEP] { identifier[setCacheNodeTypeSpecificParameters] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[CacheNodeTypeSpecificParameter] operator[>] operator[SEP] identifier[cacheNodeTypeSpecificParameters] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[CacheNodeTypeSpecificParameter] identifier[ele] operator[:] identifier[cacheNodeTypeSpecificParameters] operator[SEP] { Keyword[this] operator[SEP] identifier[cacheNodeTypeSpecificParameters] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public FsSettings readAsYaml(String jobname) throws IOException { return FsSettingsParser.fromYaml(readFile(jobname, SETTINGS_YAML)); }
class class_name[name] begin[{] method[readAsYaml, return_type[type[FsSettings]], modifier[public], parameter[jobname]] begin[{] return[call[FsSettingsParser.fromYaml, parameter[call[.readFile, parameter[member[.jobname], member[.SETTINGS_YAML]]]]]] end[}] END[}]
Keyword[public] identifier[FsSettings] identifier[readAsYaml] operator[SEP] identifier[String] identifier[jobname] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[FsSettingsParser] operator[SEP] identifier[fromYaml] operator[SEP] identifier[readFile] operator[SEP] identifier[jobname] , identifier[SETTINGS_YAML] operator[SEP] operator[SEP] operator[SEP] }
private Duration getRangeDurationWholeDay(ProjectCalendar projectCalendar, TimescaleUnits rangeUnits, DateRange range, List<TimephasedWork> assignments, int startIndex) { // option 1: // Our date range starts before the start of the TRA at the start index. // We can guarantee that we don't need to look at any earlier TRA blocks so just start here // option 2: // Our date range starts at the same point as the first TRA: do nothing... // option 3: // Our date range starts somewhere inside the first TRA... // if it's option 1 just set the start date to the start of the TRA block // for everything else we just use the start date of our date range. // start counting forwards one day at a time until we reach the end of // the date range, or until we reach the end of the block. // if we have not reached the end of the range, move to the next block and // see if the date range overlaps it. if it does not overlap, then we're // done. // if it does overlap, then move to the next block and repeat int totalDays = 0; double totalWork = 0; TimephasedWork assignment = assignments.get(startIndex); boolean done = false; do { // // Select the correct start date // long startDate = range.getStart().getTime(); long assignmentStart = assignment.getStart().getTime(); if (startDate < assignmentStart) { startDate = assignmentStart; } long rangeEndDate = range.getEnd().getTime(); long traEndDate = assignment.getFinish().getTime(); Calendar cal = DateHelper.popCalendar(startDate); Date calendarDate = cal.getTime(); // // Start counting forwards // while (startDate < rangeEndDate && startDate < traEndDate) { if (projectCalendar == null || projectCalendar.isWorkingDate(calendarDate)) { ++totalDays; } cal.add(Calendar.DAY_OF_YEAR, 1); startDate = cal.getTimeInMillis(); calendarDate = cal.getTime(); } DateHelper.pushCalendar(cal); // // If we still haven't reached the end of our range // check to see if the next TRA can be used. // done = true; totalWork += (assignment.getAmountPerDay().getDuration() * totalDays); if (startDate < rangeEndDate) { ++startIndex; if (startIndex < assignments.size()) { assignment = assignments.get(startIndex); totalDays = 0; done = false; } } } while (!done); return Duration.getInstance(totalWork, assignment.getAmountPerDay().getUnits()); }
class class_name[name] begin[{] method[getRangeDurationWholeDay, return_type[type[Duration]], modifier[private], parameter[projectCalendar, rangeUnits, range, assignments, startIndex]] begin[{] local_variable[type[int], totalDays] local_variable[type[double], totalWork] local_variable[type[TimephasedWork], assignment] local_variable[type[boolean], done] do[member[.done]] begin[{] local_variable[type[long], startDate] local_variable[type[long], assignmentStart] if[binary_operation[member[.startDate], <, member[.assignmentStart]]] begin[{] assign[member[.startDate], member[.assignmentStart]] else begin[{] None end[}] local_variable[type[long], rangeEndDate] local_variable[type[long], traEndDate] local_variable[type[Calendar], cal] local_variable[type[Date], calendarDate] while[binary_operation[binary_operation[member[.startDate], <, member[.rangeEndDate]], &&, binary_operation[member[.startDate], <, member[.traEndDate]]]] begin[{] if[binary_operation[binary_operation[member[.projectCalendar], ==, literal[null]], ||, call[projectCalendar.isWorkingDate, parameter[member[.calendarDate]]]]] begin[{] member[.totalDays] else begin[{] None end[}] call[cal.add, parameter[member[Calendar.DAY_OF_YEAR], literal[1]]] assign[member[.startDate], call[cal.getTimeInMillis, parameter[]]] assign[member[.calendarDate], call[cal.getTime, parameter[]]] end[}] call[DateHelper.pushCalendar, parameter[member[.cal]]] assign[member[.done], literal[true]] assign[member[.totalWork], binary_operation[call[assignment.getAmountPerDay, parameter[]], *, member[.totalDays]]] if[binary_operation[member[.startDate], <, member[.rangeEndDate]]] begin[{] member[.startIndex] if[binary_operation[member[.startIndex], <, call[assignments.size, parameter[]]]] begin[{] assign[member[.assignment], call[assignments.get, parameter[member[.startIndex]]]] assign[member[.totalDays], literal[0]] assign[member[.done], literal[false]] else begin[{] None end[}] else begin[{] None end[}] end[}] return[call[Duration.getInstance, parameter[member[.totalWork], call[assignment.getAmountPerDay, parameter[]]]]] end[}] END[}]
Keyword[private] identifier[Duration] identifier[getRangeDurationWholeDay] operator[SEP] identifier[ProjectCalendar] identifier[projectCalendar] , identifier[TimescaleUnits] identifier[rangeUnits] , identifier[DateRange] identifier[range] , identifier[List] operator[<] identifier[TimephasedWork] operator[>] identifier[assignments] , Keyword[int] identifier[startIndex] operator[SEP] { Keyword[int] identifier[totalDays] operator[=] Other[0] operator[SEP] Keyword[double] identifier[totalWork] operator[=] Other[0] operator[SEP] identifier[TimephasedWork] identifier[assignment] operator[=] identifier[assignments] operator[SEP] identifier[get] operator[SEP] identifier[startIndex] operator[SEP] operator[SEP] Keyword[boolean] identifier[done] operator[=] literal[boolean] operator[SEP] Keyword[do] { Keyword[long] identifier[startDate] operator[=] identifier[range] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[assignmentStart] operator[=] identifier[assignment] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startDate] operator[<] identifier[assignmentStart] operator[SEP] { identifier[startDate] operator[=] identifier[assignmentStart] operator[SEP] } Keyword[long] identifier[rangeEndDate] operator[=] identifier[range] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[traEndDate] operator[=] identifier[assignment] operator[SEP] identifier[getFinish] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[Calendar] identifier[cal] operator[=] identifier[DateHelper] operator[SEP] identifier[popCalendar] operator[SEP] identifier[startDate] operator[SEP] operator[SEP] identifier[Date] identifier[calendarDate] operator[=] identifier[cal] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[startDate] operator[<] identifier[rangeEndDate] operator[&&] identifier[startDate] operator[<] identifier[traEndDate] operator[SEP] { Keyword[if] operator[SEP] identifier[projectCalendar] operator[==] Other[null] operator[||] identifier[projectCalendar] operator[SEP] identifier[isWorkingDate] operator[SEP] identifier[calendarDate] operator[SEP] operator[SEP] { operator[++] identifier[totalDays] operator[SEP] } identifier[cal] operator[SEP] identifier[add] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_YEAR] , Other[1] operator[SEP] operator[SEP] identifier[startDate] operator[=] identifier[cal] operator[SEP] identifier[getTimeInMillis] operator[SEP] operator[SEP] operator[SEP] identifier[calendarDate] operator[=] identifier[cal] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] } identifier[DateHelper] operator[SEP] identifier[pushCalendar] operator[SEP] identifier[cal] operator[SEP] operator[SEP] identifier[done] operator[=] literal[boolean] operator[SEP] identifier[totalWork] operator[+=] operator[SEP] identifier[assignment] operator[SEP] identifier[getAmountPerDay] operator[SEP] operator[SEP] operator[SEP] identifier[getDuration] operator[SEP] operator[SEP] operator[*] identifier[totalDays] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startDate] operator[<] identifier[rangeEndDate] operator[SEP] { operator[++] identifier[startIndex] operator[SEP] Keyword[if] operator[SEP] identifier[startIndex] operator[<] identifier[assignments] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[assignment] operator[=] identifier[assignments] operator[SEP] identifier[get] operator[SEP] identifier[startIndex] operator[SEP] operator[SEP] identifier[totalDays] operator[=] Other[0] operator[SEP] identifier[done] operator[=] literal[boolean] operator[SEP] } } } Keyword[while] operator[SEP] operator[!] identifier[done] operator[SEP] operator[SEP] Keyword[return] identifier[Duration] operator[SEP] identifier[getInstance] operator[SEP] identifier[totalWork] , identifier[assignment] operator[SEP] identifier[getAmountPerDay] operator[SEP] operator[SEP] operator[SEP] identifier[getUnits] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected void performDismiss(@NonNull final View view, final int position) { mDismissedViews.add(view); mDismissedPositions.add(position); ValueAnimator animator = ValueAnimator.ofInt(view.getHeight(), 1).setDuration(mDismissAnimationTime); animator.addUpdateListener(new DismissAnimatorUpdateListener(view)); animator.addListener(new DismissAnimatorListener()); animator.start(); mActiveDismissCount++; }
class class_name[name] begin[{] method[performDismiss, return_type[void], modifier[protected], parameter[view, position]] begin[{] call[mDismissedViews.add, parameter[member[.view]]] call[mDismissedPositions.add, parameter[member[.position]]] local_variable[type[ValueAnimator], animator] call[animator.addUpdateListener, parameter[ClassCreator(arguments=[MemberReference(member=view, 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=DismissAnimatorUpdateListener, sub_type=None))]] call[animator.addListener, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DismissAnimatorListener, sub_type=None))]] call[animator.start, parameter[]] member[.mActiveDismissCount] end[}] END[}]
Keyword[protected] Keyword[void] identifier[performDismiss] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[View] identifier[view] , Keyword[final] Keyword[int] identifier[position] operator[SEP] { identifier[mDismissedViews] operator[SEP] identifier[add] operator[SEP] identifier[view] operator[SEP] operator[SEP] identifier[mDismissedPositions] operator[SEP] identifier[add] operator[SEP] identifier[position] operator[SEP] operator[SEP] identifier[ValueAnimator] identifier[animator] operator[=] identifier[ValueAnimator] operator[SEP] identifier[ofInt] operator[SEP] identifier[view] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] , Other[1] operator[SEP] operator[SEP] identifier[setDuration] operator[SEP] identifier[mDismissAnimationTime] operator[SEP] operator[SEP] identifier[animator] operator[SEP] identifier[addUpdateListener] operator[SEP] Keyword[new] identifier[DismissAnimatorUpdateListener] operator[SEP] identifier[view] operator[SEP] operator[SEP] operator[SEP] identifier[animator] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[DismissAnimatorListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[animator] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[mActiveDismissCount] operator[++] operator[SEP] }
public Observable<DeletedKeyBundle> getDeletedKeyAsync(String vaultBaseUrl, String keyName) { return getDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName).map(new Func1<ServiceResponse<DeletedKeyBundle>, DeletedKeyBundle>() { @Override public DeletedKeyBundle call(ServiceResponse<DeletedKeyBundle> response) { return response.body(); } }); }
class class_name[name] begin[{] method[getDeletedKeyAsync, return_type[type[Observable]], modifier[public], parameter[vaultBaseUrl, keyName]] begin[{] return[call[.getDeletedKeyWithServiceResponseAsync, parameter[member[.vaultBaseUrl], member[.keyName]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[DeletedKeyBundle] operator[>] identifier[getDeletedKeyAsync] operator[SEP] identifier[String] identifier[vaultBaseUrl] , identifier[String] identifier[keyName] operator[SEP] { Keyword[return] identifier[getDeletedKeyWithServiceResponseAsync] operator[SEP] identifier[vaultBaseUrl] , identifier[keyName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[DeletedKeyBundle] operator[>] , identifier[DeletedKeyBundle] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[DeletedKeyBundle] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[DeletedKeyBundle] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public Map<String, String> results(OutputVariable outputVariable, TimeUnit timeUnit, boolean includeTimes) { if (engine == null) { throw new RuntimeException("[benchmark error] engine not set for benchmark"); } double[] runtimes = new double[times.size()]; for (int i = 0; i < times.size(); ++i) { runtimes[i] = times.get(i); } Map<String, String> result = new LinkedHashMap<String, String>(); result.put("library", FuzzyLite.LIBRARY); result.put("name", name); result.put("inputs", String.valueOf(engine.numberOfInputVariables())); result.put("outputs", String.valueOf(engine.numberOfOutputVariables())); result.put("ruleBlocks", String.valueOf(engine.numberOfRuleBlocks())); int rules = 0; for (RuleBlock ruleBlock : engine.getRuleBlocks()) { rules += ruleBlock.numberOfRules(); } result.put("rules", String.valueOf(rules)); result.put("runs", String.valueOf(times.size())); result.put("evaluations", String.valueOf(expected.size())); if (canComputeErrors()) { List<String> names = new LinkedList<String>(); double meanRange = 0.0; double rmse = Math.sqrt(meanSquaredError()); double nrmse = 0.0; double weights = 0.0; for (OutputVariable y : engine.getOutputVariables()) { if (outputVariable == null || outputVariable == y) { names.add(y.getName()); meanRange += y.range(); nrmse += Math.sqrt(meanSquaredError(y)) * 1.0 / y.range(); weights += 1.0 / y.range(); } } meanRange /= names.size(); nrmse /= weights; result.put("outputVariable", Op.join(names, ",")); result.put("range", Op.str(meanRange)); result.put("tolerance", String.format("%6.3e", getTolerance())); result.put("errors", String.valueOf(allErrors(outputVariable))); result.put("nfErrors", String.valueOf(nonFiniteErrors(outputVariable))); result.put("accErrors", String.valueOf(accuracyErrors(outputVariable))); result.put("rmse", String.format("%6.6e", rmse)); result.put("nrmse", String.format("%6.6e", nrmse)); } result.put("units", timeUnit.name().toLowerCase()); result.put("sum(t)", String.valueOf( convert(Op.sum(runtimes), TimeUnit.NanoSeconds, timeUnit))); result.put("mean(t)", String.valueOf( convert(Op.mean(runtimes), TimeUnit.NanoSeconds, timeUnit))); result.put("sd(t)", String.valueOf( convert(Op.standardDeviation(runtimes), TimeUnit.NanoSeconds, timeUnit))); if (includeTimes) { for (int i = 0; i < runtimes.length; ++i) { result.put("t" + (i + 1), String.valueOf( convert(runtimes[i], TimeUnit.NanoSeconds, timeUnit))); } } return result; }
class class_name[name] begin[{] method[results, return_type[type[Map]], modifier[public], parameter[outputVariable, timeUnit, includeTimes]] begin[{] if[binary_operation[member[.engine], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[benchmark error] engine not set for benchmark")], 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) else begin[{] None end[}] local_variable[type[double], runtimes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=runtimes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=times, 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=times, 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) local_variable[type[Map], result] call[result.put, parameter[literal["library"], member[FuzzyLite.LIBRARY]]] call[result.put, parameter[literal["name"], member[.name]]] call[result.put, parameter[literal["inputs"], call[String.valueOf, parameter[call[engine.numberOfInputVariables, parameter[]]]]]] call[result.put, parameter[literal["outputs"], call[String.valueOf, parameter[call[engine.numberOfOutputVariables, parameter[]]]]]] call[result.put, parameter[literal["ruleBlocks"], call[String.valueOf, parameter[call[engine.numberOfRuleBlocks, parameter[]]]]]] local_variable[type[int], rules] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=numberOfRules, postfix_operators=[], prefix_operators=[], qualifier=ruleBlock, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getRuleBlocks, postfix_operators=[], prefix_operators=[], qualifier=engine, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ruleBlock)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RuleBlock, sub_type=None))), label=None) call[result.put, parameter[literal["rules"], call[String.valueOf, parameter[member[.rules]]]]] call[result.put, parameter[literal["runs"], call[String.valueOf, parameter[call[times.size, parameter[]]]]]] call[result.put, parameter[literal["evaluations"], call[String.valueOf, parameter[call[expected.size, parameter[]]]]]] if[call[.canComputeErrors, parameter[]]] begin[{] local_variable[type[List], names] local_variable[type[double], meanRange] local_variable[type[double], rmse] local_variable[type[double], nrmse] local_variable[type[double], weights] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=outputVariable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=outputVariable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=y, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=meanRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=range, postfix_operators=[], prefix_operators=[], qualifier=y, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nrmse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=meanSquaredError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=sqrt, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operator=*), operandr=MethodInvocation(arguments=[], member=range, postfix_operators=[], prefix_operators=[], qualifier=y, selectors=[], type_arguments=None), operator=/)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=weights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operandr=MethodInvocation(arguments=[], member=range, postfix_operators=[], prefix_operators=[], qualifier=y, selectors=[], type_arguments=None), operator=/)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getOutputVariables, postfix_operators=[], prefix_operators=[], qualifier=engine, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=y)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OutputVariable, sub_type=None))), label=None) assign[member[.meanRange], call[names.size, parameter[]]] assign[member[.nrmse], member[.weights]] call[result.put, parameter[literal["outputVariable"], call[Op.join, parameter[member[.names], literal[","]]]]] call[result.put, parameter[literal["range"], call[Op.str, parameter[member[.meanRange]]]]] call[result.put, parameter[literal["tolerance"], call[String.format, parameter[literal["%6.3e"], call[.getTolerance, parameter[]]]]]] call[result.put, parameter[literal["errors"], call[String.valueOf, parameter[call[.allErrors, parameter[member[.outputVariable]]]]]]] call[result.put, parameter[literal["nfErrors"], call[String.valueOf, parameter[call[.nonFiniteErrors, parameter[member[.outputVariable]]]]]]] call[result.put, parameter[literal["accErrors"], call[String.valueOf, parameter[call[.accuracyErrors, parameter[member[.outputVariable]]]]]]] call[result.put, parameter[literal["rmse"], call[String.format, parameter[literal["%6.6e"], member[.rmse]]]]] call[result.put, parameter[literal["nrmse"], call[String.format, parameter[literal["%6.6e"], member[.nrmse]]]]] else begin[{] None end[}] call[result.put, parameter[literal["units"], call[timeUnit.name, parameter[]]]] call[result.put, parameter[literal["sum(t)"], call[String.valueOf, parameter[call[.convert, parameter[call[Op.sum, parameter[member[.runtimes]]], member[TimeUnit.NanoSeconds], member[.timeUnit]]]]]]] call[result.put, parameter[literal["mean(t)"], call[String.valueOf, parameter[call[.convert, parameter[call[Op.mean, parameter[member[.runtimes]]], member[TimeUnit.NanoSeconds], member[.timeUnit]]]]]]] call[result.put, parameter[literal["sd(t)"], call[String.valueOf, parameter[call[.convert, parameter[call[Op.standardDeviation, parameter[member[.runtimes]]], member[TimeUnit.NanoSeconds], member[.timeUnit]]]]]]] if[member[.includeTimes]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="t"), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=+), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=runtimes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=NanoSeconds, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[]), MemberReference(member=timeUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=runtimes, 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) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[results] operator[SEP] identifier[OutputVariable] identifier[outputVariable] , identifier[TimeUnit] identifier[timeUnit] , Keyword[boolean] identifier[includeTimes] operator[SEP] { Keyword[if] operator[SEP] identifier[engine] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[double] operator[SEP] operator[SEP] identifier[runtimes] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[times] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[times] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[runtimes] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[times] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[FuzzyLite] operator[SEP] identifier[LIBRARY] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[engine] operator[SEP] identifier[numberOfInputVariables] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[engine] operator[SEP] identifier[numberOfOutputVariables] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[engine] operator[SEP] identifier[numberOfRuleBlocks] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[rules] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[RuleBlock] identifier[ruleBlock] operator[:] identifier[engine] operator[SEP] identifier[getRuleBlocks] operator[SEP] operator[SEP] operator[SEP] { identifier[rules] operator[+=] identifier[ruleBlock] operator[SEP] identifier[numberOfRules] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[rules] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[times] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[expected] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[canComputeErrors] operator[SEP] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[names] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[meanRange] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[rmse] operator[=] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[meanSquaredError] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[nrmse] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[weights] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] identifier[OutputVariable] identifier[y] operator[:] identifier[engine] operator[SEP] identifier[getOutputVariables] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[outputVariable] operator[==] Other[null] operator[||] identifier[outputVariable] operator[==] identifier[y] operator[SEP] { identifier[names] operator[SEP] identifier[add] operator[SEP] identifier[y] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[meanRange] operator[+=] identifier[y] operator[SEP] identifier[range] operator[SEP] operator[SEP] operator[SEP] identifier[nrmse] operator[+=] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[meanSquaredError] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[*] literal[Float] operator[/] identifier[y] operator[SEP] identifier[range] operator[SEP] operator[SEP] operator[SEP] identifier[weights] operator[+=] literal[Float] operator[/] identifier[y] operator[SEP] identifier[range] operator[SEP] operator[SEP] operator[SEP] } } identifier[meanRange] operator[/=] identifier[names] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[nrmse] operator[/=] identifier[weights] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Op] operator[SEP] identifier[join] operator[SEP] identifier[names] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Op] operator[SEP] identifier[str] operator[SEP] identifier[meanRange] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[getTolerance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[allErrors] operator[SEP] identifier[outputVariable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[nonFiniteErrors] operator[SEP] identifier[outputVariable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[accuracyErrors] operator[SEP] identifier[outputVariable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[rmse] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[nrmse] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[timeUnit] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[convert] operator[SEP] identifier[Op] operator[SEP] identifier[sum] operator[SEP] identifier[runtimes] operator[SEP] , identifier[TimeUnit] operator[SEP] identifier[NanoSeconds] , identifier[timeUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[convert] operator[SEP] identifier[Op] operator[SEP] identifier[mean] operator[SEP] identifier[runtimes] operator[SEP] , identifier[TimeUnit] operator[SEP] identifier[NanoSeconds] , identifier[timeUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[convert] operator[SEP] identifier[Op] operator[SEP] identifier[standardDeviation] operator[SEP] identifier[runtimes] operator[SEP] , identifier[TimeUnit] operator[SEP] identifier[NanoSeconds] , identifier[timeUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[includeTimes] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[runtimes] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[result] operator[SEP] identifier[put] operator[SEP] literal[String] operator[+] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[convert] operator[SEP] identifier[runtimes] operator[SEP] identifier[i] operator[SEP] , identifier[TimeUnit] operator[SEP] identifier[NanoSeconds] , identifier[timeUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public Record queryForRecord(String sql, Map<String, Object> params) { return queryForRecord(sql, null, params); }
class class_name[name] begin[{] method[queryForRecord, return_type[type[Record]], modifier[public], parameter[sql, params]] begin[{] return[call[.queryForRecord, parameter[member[.sql], literal[null], member[.params]]]] end[}] END[}]
Keyword[public] identifier[Record] identifier[queryForRecord] operator[SEP] identifier[String] identifier[sql] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[params] operator[SEP] { Keyword[return] identifier[queryForRecord] operator[SEP] identifier[sql] , Other[null] , identifier[params] operator[SEP] operator[SEP] }
public void updateSQLXML(final String columnLabel, final java.sql.SQLXML xmlObject) throws SQLException { throw SQLExceptionMapper.getFeatureNotSupportedException("SQLXML not supported"); }
class class_name[name] begin[{] method[updateSQLXML, return_type[void], modifier[public], parameter[columnLabel, xmlObject]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SQLXML not supported")], member=getFeatureNotSupportedException, postfix_operators=[], prefix_operators=[], qualifier=SQLExceptionMapper, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[updateSQLXML] operator[SEP] Keyword[final] identifier[String] identifier[columnLabel] , Keyword[final] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[SQLXML] identifier[xmlObject] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[throw] identifier[SQLExceptionMapper] operator[SEP] identifier[getFeatureNotSupportedException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public void log(Marker marker, String fqcn, int level, String message, Object[] argArray, Throwable t) { setMDCMarker( marker ); switch(level) { case(TRACE_INT): if( m_delegate.isTraceEnabled() ) { FormattingTuple tuple = MessageFormatter.arrayFormat( message, argArray ); m_delegate.trace( tuple.getMessage(), t, fqcn ); } break; case(DEBUG_INT): if( m_delegate.isDebugEnabled() ) { FormattingTuple tuple = MessageFormatter.arrayFormat( message, argArray ); m_delegate.debug( tuple.getMessage(), t, fqcn ); } break; case(INFO_INT): if( m_delegate.isInfoEnabled() ) { FormattingTuple tuple = MessageFormatter.arrayFormat( message, argArray ); m_delegate.inform( tuple.getMessage(), t, fqcn ); } break; case(WARN_INT): if( m_delegate.isWarnEnabled() ) { FormattingTuple tuple = MessageFormatter.arrayFormat( message, argArray ); m_delegate.warn( tuple.getMessage(), t, fqcn ); } break; case(ERROR_INT): if( m_delegate.isErrorEnabled() ) { FormattingTuple tuple = MessageFormatter.arrayFormat( message, argArray ); m_delegate.error( tuple.getMessage(), t, fqcn ); } break; default: break; } resetMDCMarker(); }
class class_name[name] begin[{] method[log, return_type[void], modifier[public], parameter[marker, fqcn, level, message, argArray, t]] begin[{] call[.setMDCMarker, parameter[member[.marker]]] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=TRACE_INT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=m_delegate, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arrayFormat, postfix_operators=[], prefix_operators=[], qualifier=MessageFormatter, selectors=[], type_arguments=None), name=tuple)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FormattingTuple, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=tuple, selectors=[], type_arguments=None), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fqcn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=m_delegate, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=DEBUG_INT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=m_delegate, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arrayFormat, postfix_operators=[], prefix_operators=[], qualifier=MessageFormatter, selectors=[], type_arguments=None), name=tuple)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FormattingTuple, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=tuple, selectors=[], type_arguments=None), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fqcn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=m_delegate, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=INFO_INT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isInfoEnabled, postfix_operators=[], prefix_operators=[], qualifier=m_delegate, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arrayFormat, postfix_operators=[], prefix_operators=[], qualifier=MessageFormatter, selectors=[], type_arguments=None), name=tuple)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FormattingTuple, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=tuple, selectors=[], type_arguments=None), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fqcn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=inform, postfix_operators=[], prefix_operators=[], qualifier=m_delegate, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=WARN_INT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isWarnEnabled, postfix_operators=[], prefix_operators=[], qualifier=m_delegate, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arrayFormat, postfix_operators=[], prefix_operators=[], qualifier=MessageFormatter, selectors=[], type_arguments=None), name=tuple)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FormattingTuple, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=tuple, selectors=[], type_arguments=None), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fqcn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=m_delegate, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=ERROR_INT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, postfix_operators=[], prefix_operators=[], qualifier=m_delegate, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arrayFormat, postfix_operators=[], prefix_operators=[], qualifier=MessageFormatter, selectors=[], type_arguments=None), name=tuple)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FormattingTuple, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=tuple, selectors=[], type_arguments=None), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fqcn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=m_delegate, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) call[.resetMDCMarker, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[log] operator[SEP] identifier[Marker] identifier[marker] , identifier[String] identifier[fqcn] , Keyword[int] identifier[level] , identifier[String] identifier[message] , identifier[Object] operator[SEP] operator[SEP] identifier[argArray] , identifier[Throwable] identifier[t] operator[SEP] { identifier[setMDCMarker] operator[SEP] identifier[marker] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[level] operator[SEP] { Keyword[case] operator[SEP] identifier[TRACE_INT] operator[SEP] operator[:] Keyword[if] operator[SEP] identifier[m_delegate] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[FormattingTuple] identifier[tuple] operator[=] identifier[MessageFormatter] operator[SEP] identifier[arrayFormat] operator[SEP] identifier[message] , identifier[argArray] operator[SEP] operator[SEP] identifier[m_delegate] operator[SEP] identifier[trace] operator[SEP] identifier[tuple] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[t] , identifier[fqcn] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] operator[SEP] identifier[DEBUG_INT] operator[SEP] operator[:] Keyword[if] operator[SEP] identifier[m_delegate] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[FormattingTuple] identifier[tuple] operator[=] identifier[MessageFormatter] operator[SEP] identifier[arrayFormat] operator[SEP] identifier[message] , identifier[argArray] operator[SEP] operator[SEP] identifier[m_delegate] operator[SEP] identifier[debug] operator[SEP] identifier[tuple] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[t] , identifier[fqcn] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] operator[SEP] identifier[INFO_INT] operator[SEP] operator[:] Keyword[if] operator[SEP] identifier[m_delegate] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[FormattingTuple] identifier[tuple] operator[=] identifier[MessageFormatter] operator[SEP] identifier[arrayFormat] operator[SEP] identifier[message] , identifier[argArray] operator[SEP] operator[SEP] identifier[m_delegate] operator[SEP] identifier[inform] operator[SEP] identifier[tuple] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[t] , identifier[fqcn] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] operator[SEP] identifier[WARN_INT] operator[SEP] operator[:] Keyword[if] operator[SEP] identifier[m_delegate] operator[SEP] identifier[isWarnEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[FormattingTuple] identifier[tuple] operator[=] identifier[MessageFormatter] operator[SEP] identifier[arrayFormat] operator[SEP] identifier[message] , identifier[argArray] operator[SEP] operator[SEP] identifier[m_delegate] operator[SEP] identifier[warn] operator[SEP] identifier[tuple] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[t] , identifier[fqcn] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] operator[SEP] identifier[ERROR_INT] operator[SEP] operator[:] Keyword[if] operator[SEP] identifier[m_delegate] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[FormattingTuple] identifier[tuple] operator[=] identifier[MessageFormatter] operator[SEP] identifier[arrayFormat] operator[SEP] identifier[message] , identifier[argArray] operator[SEP] operator[SEP] identifier[m_delegate] operator[SEP] identifier[error] operator[SEP] identifier[tuple] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[t] , identifier[fqcn] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP] } identifier[resetMDCMarker] operator[SEP] operator[SEP] operator[SEP] }
public static BadRequest of(Throwable cause) { if (_localizedErrorMsg()) { return of(cause, defaultMessage(BAD_REQUEST)); } else { touchPayload().cause(cause); return _INSTANCE; } }
class class_name[name] begin[{] method[of, return_type[type[BadRequest]], modifier[public static], parameter[cause]] begin[{] if[call[._localizedErrorMsg, parameter[]]] begin[{] return[call[.of, parameter[member[.cause], call[.defaultMessage, parameter[member[.BAD_REQUEST]]]]]] else begin[{] call[.touchPayload, parameter[]] return[member[._INSTANCE]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[BadRequest] identifier[of] operator[SEP] identifier[Throwable] identifier[cause] operator[SEP] { Keyword[if] operator[SEP] identifier[_localizedErrorMsg] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[of] operator[SEP] identifier[cause] , identifier[defaultMessage] operator[SEP] identifier[BAD_REQUEST] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[touchPayload] operator[SEP] operator[SEP] operator[SEP] identifier[cause] operator[SEP] identifier[cause] operator[SEP] operator[SEP] Keyword[return] identifier[_INSTANCE] operator[SEP] } }
public static NameNotFoundException nameNotFoundException(final String name, final Name contextName) { return NamingLogger.ROOT_LOGGER.nameNotFoundInContext(name, contextName); }
class class_name[name] begin[{] method[nameNotFoundException, return_type[type[NameNotFoundException]], modifier[public static], parameter[name, contextName]] begin[{] return[call[NamingLogger.ROOT_LOGGER.nameNotFoundInContext, parameter[member[.name], member[.contextName]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[NameNotFoundException] identifier[nameNotFoundException] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[Name] identifier[contextName] operator[SEP] { Keyword[return] identifier[NamingLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[nameNotFoundInContext] operator[SEP] identifier[name] , identifier[contextName] operator[SEP] operator[SEP] }
public List<Tag> list() { String url = WxEndpoint.get("url.tag.list"); String response = wxClient.get(url); TagList tagList = JsonMapper.defaultMapper().fromJson(response, TagList.class); return tagList.getTags(); }
class class_name[name] begin[{] method[list, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[String], url] local_variable[type[String], response] local_variable[type[TagList], tagList] return[call[tagList.getTags, parameter[]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Tag] operator[>] identifier[list] operator[SEP] operator[SEP] { identifier[String] identifier[url] operator[=] identifier[WxEndpoint] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[response] operator[=] identifier[wxClient] operator[SEP] identifier[get] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[TagList] identifier[tagList] operator[=] identifier[JsonMapper] operator[SEP] identifier[defaultMapper] operator[SEP] operator[SEP] operator[SEP] identifier[fromJson] operator[SEP] identifier[response] , identifier[TagList] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[tagList] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] operator[SEP] }
@Override public ConsumerManager chooseConsumerManager(SIBUuid12 gatheringTargetUuid, SIBUuid8 fixedMEUuid, HashSet<SIBUuid8> scopedMEs) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "chooseConsumerManager", new Object[] { gatheringTargetUuid, fixedMEUuid, scopedMEs }); ConsumerManager consumerManager = null; consumerManager = _ptoPRealization.chooseConsumerManager(definition, isReceiveAllowed(), gatheringTargetUuid, fixedMEUuid, scopedMEs); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "chooseConsumerManager", consumerManager); return consumerManager; }
class class_name[name] begin[{] method[chooseConsumerManager, return_type[type[ConsumerManager]], modifier[public], parameter[gatheringTargetUuid, fixedMEUuid, scopedMEs]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["chooseConsumerManager"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=gatheringTargetUuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fixedMEUuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scopedMEs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] local_variable[type[ConsumerManager], consumerManager] assign[member[.consumerManager], call[_ptoPRealization.chooseConsumerManager, parameter[member[.definition], call[.isReceiveAllowed, parameter[]], member[.gatheringTargetUuid], member[.fixedMEUuid], member[.scopedMEs]]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["chooseConsumerManager"], member[.consumerManager]]] else begin[{] None end[}] return[member[.consumerManager]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ConsumerManager] identifier[chooseConsumerManager] operator[SEP] identifier[SIBUuid12] identifier[gatheringTargetUuid] , identifier[SIBUuid8] identifier[fixedMEUuid] , identifier[HashSet] operator[<] identifier[SIBUuid8] operator[>] identifier[scopedMEs] operator[SEP] Keyword[throws] identifier[SIResourceException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[gatheringTargetUuid] , identifier[fixedMEUuid] , identifier[scopedMEs] } operator[SEP] operator[SEP] identifier[ConsumerManager] identifier[consumerManager] operator[=] Other[null] operator[SEP] identifier[consumerManager] operator[=] identifier[_ptoPRealization] operator[SEP] identifier[chooseConsumerManager] operator[SEP] identifier[definition] , identifier[isReceiveAllowed] operator[SEP] operator[SEP] , identifier[gatheringTargetUuid] , identifier[fixedMEUuid] , identifier[scopedMEs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[consumerManager] operator[SEP] operator[SEP] Keyword[return] identifier[consumerManager] operator[SEP] }
public StreamingJobInner createOrReplace(String resourceGroupName, String jobName, StreamingJobInner streamingJob) { return createOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, streamingJob).toBlocking().last().body(); }
class class_name[name] begin[{] method[createOrReplace, return_type[type[StreamingJobInner]], modifier[public], parameter[resourceGroupName, jobName, streamingJob]] begin[{] return[call[.createOrReplaceWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.jobName], member[.streamingJob]]]] end[}] END[}]
Keyword[public] identifier[StreamingJobInner] identifier[createOrReplace] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[jobName] , identifier[StreamingJobInner] identifier[streamingJob] operator[SEP] { Keyword[return] identifier[createOrReplaceWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[jobName] , identifier[streamingJob] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[last] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public static void depositSecretKey(XMPPConnection connection, SecretkeyElement element) throws InterruptedException, PubSubException.NotALeafNodeException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException, SmackException.FeatureNotSupportedException { if (!OpenPgpManager.serverSupportsSecretKeyBackups(connection)) { throw new SmackException.FeatureNotSupportedException("http://jabber.org/protocol/pubsub#access-whitelist"); } PubSubManager pm = PepManager.getInstanceFor(connection).getPepPubSubManager(); LeafNode secretKeyNode = pm.getOrCreateLeafNode(PEP_NODE_SECRET_KEY); OpenPgpPubSubUtil.changeAccessModelIfNecessary(secretKeyNode, AccessModel.whitelist); secretKeyNode.publish(new PayloadItem<>(element)); }
class class_name[name] begin[{] method[depositSecretKey, return_type[void], modifier[public static], parameter[connection, element]] begin[{] if[call[OpenPgpManager.serverSupportsSecretKeyBackups, parameter[member[.connection]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="http://jabber.org/protocol/pubsub#access-whitelist")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SmackException, sub_type=ReferenceType(arguments=None, dimensions=None, name=FeatureNotSupportedException, sub_type=None))), label=None) else begin[{] None end[}] local_variable[type[PubSubManager], pm] local_variable[type[LeafNode], secretKeyNode] call[OpenPgpPubSubUtil.changeAccessModelIfNecessary, parameter[member[.secretKeyNode], member[AccessModel.whitelist]]] call[secretKeyNode.publish, parameter[ClassCreator(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=PayloadItem, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[depositSecretKey] operator[SEP] identifier[XMPPConnection] identifier[connection] , identifier[SecretkeyElement] identifier[element] operator[SEP] Keyword[throws] identifier[InterruptedException] , identifier[PubSubException] operator[SEP] identifier[NotALeafNodeException] , identifier[XMPPException] operator[SEP] identifier[XMPPErrorException] , identifier[SmackException] operator[SEP] identifier[NotConnectedException] , identifier[SmackException] operator[SEP] identifier[NoResponseException] , identifier[SmackException] operator[SEP] identifier[FeatureNotSupportedException] { Keyword[if] operator[SEP] operator[!] identifier[OpenPgpManager] operator[SEP] identifier[serverSupportsSecretKeyBackups] operator[SEP] identifier[connection] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[SmackException] operator[SEP] identifier[FeatureNotSupportedException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[PubSubManager] identifier[pm] operator[=] identifier[PepManager] operator[SEP] identifier[getInstanceFor] operator[SEP] identifier[connection] operator[SEP] operator[SEP] identifier[getPepPubSubManager] operator[SEP] operator[SEP] operator[SEP] identifier[LeafNode] identifier[secretKeyNode] operator[=] identifier[pm] operator[SEP] identifier[getOrCreateLeafNode] operator[SEP] identifier[PEP_NODE_SECRET_KEY] operator[SEP] operator[SEP] identifier[OpenPgpPubSubUtil] operator[SEP] identifier[changeAccessModelIfNecessary] operator[SEP] identifier[secretKeyNode] , identifier[AccessModel] operator[SEP] identifier[whitelist] operator[SEP] operator[SEP] identifier[secretKeyNode] operator[SEP] identifier[publish] operator[SEP] Keyword[new] identifier[PayloadItem] operator[<] operator[>] operator[SEP] identifier[element] operator[SEP] operator[SEP] operator[SEP] }
public boolean hasNamedPolicy(String ptype, List<String> params) { return model.hasPolicy("p", ptype, params); }
class class_name[name] begin[{] method[hasNamedPolicy, return_type[type[boolean]], modifier[public], parameter[ptype, params]] begin[{] return[call[model.hasPolicy, parameter[literal["p"], member[.ptype], member[.params]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[hasNamedPolicy] operator[SEP] identifier[String] identifier[ptype] , identifier[List] operator[<] identifier[String] operator[>] identifier[params] operator[SEP] { Keyword[return] identifier[model] operator[SEP] identifier[hasPolicy] operator[SEP] literal[String] , identifier[ptype] , identifier[params] operator[SEP] operator[SEP] }
public String[] getInputsForFunction(DifferentialFunction function) { if (!incomingArgsReverse.containsKey(function.getOwnName())) throw new ND4JIllegalStateException("Illegal function instance id found " + function.getOwnName()); return incomingArgsReverse.get(function.getOwnName()); }
class class_name[name] begin[{] method[getInputsForFunction, return_type[type[String]], modifier[public], parameter[function]] begin[{] if[call[incomingArgsReverse.containsKey, parameter[call[function.getOwnName, parameter[]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Illegal function instance id found "), operandr=MethodInvocation(arguments=[], member=getOwnName, postfix_operators=[], prefix_operators=[], qualifier=function, selectors=[], type_arguments=None), operator=+)], 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[}] return[call[incomingArgsReverse.get, parameter[call[function.getOwnName, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[getInputsForFunction] operator[SEP] identifier[DifferentialFunction] identifier[function] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[incomingArgsReverse] operator[SEP] identifier[containsKey] operator[SEP] identifier[function] operator[SEP] identifier[getOwnName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ND4JIllegalStateException] operator[SEP] literal[String] operator[+] identifier[function] operator[SEP] identifier[getOwnName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[incomingArgsReverse] operator[SEP] identifier[get] operator[SEP] identifier[function] operator[SEP] identifier[getOwnName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public boolean canRetry(RetryContext context) { Throwable t = context.getLastThrowable(); return (t == null || retryForException(t)) && context.getRetryCount() < this.maxAttempts; }
class class_name[name] begin[{] method[canRetry, return_type[type[boolean]], modifier[public], parameter[context]] begin[{] local_variable[type[Throwable], t] return[binary_operation[binary_operation[binary_operation[member[.t], ==, literal[null]], ||, call[.retryForException, parameter[member[.t]]]], &&, binary_operation[call[context.getRetryCount, parameter[]], <, THIS[member[None.maxAttempts]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[canRetry] operator[SEP] identifier[RetryContext] identifier[context] operator[SEP] { identifier[Throwable] identifier[t] operator[=] identifier[context] operator[SEP] identifier[getLastThrowable] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[t] operator[==] Other[null] operator[||] identifier[retryForException] operator[SEP] identifier[t] operator[SEP] operator[SEP] operator[&&] identifier[context] operator[SEP] identifier[getRetryCount] operator[SEP] operator[SEP] operator[<] Keyword[this] operator[SEP] identifier[maxAttempts] operator[SEP] }
public CreateUserPoolClientRequest withExplicitAuthFlows(String... explicitAuthFlows) { if (this.explicitAuthFlows == null) { setExplicitAuthFlows(new java.util.ArrayList<String>(explicitAuthFlows.length)); } for (String ele : explicitAuthFlows) { this.explicitAuthFlows.add(ele); } return this; }
class class_name[name] begin[{] method[withExplicitAuthFlows, return_type[type[CreateUserPoolClientRequest]], modifier[public], parameter[explicitAuthFlows]] begin[{] if[binary_operation[THIS[member[None.explicitAuthFlows]], ==, literal[null]]] begin[{] call[.setExplicitAuthFlows, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=explicitAuthFlows, 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))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=explicitAuthFlows, 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=explicitAuthFlows, 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=String, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[CreateUserPoolClientRequest] identifier[withExplicitAuthFlows] operator[SEP] identifier[String] operator[...] identifier[explicitAuthFlows] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[explicitAuthFlows] operator[==] Other[null] operator[SEP] { identifier[setExplicitAuthFlows] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[explicitAuthFlows] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[explicitAuthFlows] operator[SEP] { Keyword[this] operator[SEP] identifier[explicitAuthFlows] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public static CommerceDiscountUsageEntry[] findByGroupId_PrevAndNext( long commerceDiscountUsageEntryId, long groupId, OrderByComparator<CommerceDiscountUsageEntry> orderByComparator) throws com.liferay.commerce.discount.exception.NoSuchDiscountUsageEntryException { return getPersistence() .findByGroupId_PrevAndNext(commerceDiscountUsageEntryId, groupId, orderByComparator); }
class class_name[name] begin[{] method[findByGroupId_PrevAndNext, return_type[type[CommerceDiscountUsageEntry]], modifier[public static], parameter[commerceDiscountUsageEntryId, groupId, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommerceDiscountUsageEntry] operator[SEP] operator[SEP] identifier[findByGroupId_PrevAndNext] operator[SEP] Keyword[long] identifier[commerceDiscountUsageEntryId] , Keyword[long] identifier[groupId] , identifier[OrderByComparator] operator[<] identifier[CommerceDiscountUsageEntry] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[discount] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchDiscountUsageEntryException] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByGroupId_PrevAndNext] operator[SEP] identifier[commerceDiscountUsageEntryId] , identifier[groupId] , identifier[orderByComparator] operator[SEP] operator[SEP] }
void defaultGBMs() { Algo algo = Algo.GBM; WorkAllocations.Work work = workAllocations.getAllocation(algo, JobType.ModelBuild); if (work == null) return; Job gbmJob; GBMParameters gbmParameters = new GBMParameters(); setCommonModelBuilderParams(gbmParameters); gbmParameters._score_tree_interval = 5; gbmParameters._histogram_type = SharedTreeParameters.HistogramType.AUTO; gbmParameters._ntrees = 1000; gbmParameters._sample_rate = 0.8; gbmParameters._col_sample_rate = 0.8; gbmParameters._col_sample_rate_per_tree = 0.8; // Default 1: gbmParameters._max_depth = 6; gbmParameters._min_rows = 1; gbmJob = trainModel(null, work, gbmParameters); pollAndUpdateProgress(Stage.ModelTraining, "GBM 1", work, this.job(), gbmJob); // Default 2: gbmParameters._max_depth = 7; gbmParameters._min_rows = 10; gbmJob = trainModel(null, work, gbmParameters); pollAndUpdateProgress(Stage.ModelTraining, "GBM 2", work, this.job(), gbmJob); // Default 3: gbmParameters._max_depth = 8; gbmParameters._min_rows = 10; gbmJob = trainModel(null, work, gbmParameters); pollAndUpdateProgress(Stage.ModelTraining, "GBM 3", work, this.job(), gbmJob); // Default 4: gbmParameters._max_depth = 10; gbmParameters._min_rows = 10; gbmJob = trainModel(null, work, gbmParameters); pollAndUpdateProgress(Stage.ModelTraining, "GBM 4", work, this.job(), gbmJob); // Default 5: gbmParameters._max_depth = 15; gbmParameters._min_rows = 100; gbmJob = trainModel(null, work, gbmParameters); pollAndUpdateProgress(Stage.ModelTraining, "GBM 5", work, this.job(), gbmJob); }
class class_name[name] begin[{] method[defaultGBMs, return_type[void], modifier[default], parameter[]] begin[{] local_variable[type[Algo], algo] local_variable[type[WorkAllocations], work] if[binary_operation[member[.work], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Job], gbmJob] local_variable[type[GBMParameters], gbmParameters] call[.setCommonModelBuilderParams, parameter[member[.gbmParameters]]] assign[member[gbmParameters._score_tree_interval], literal[5]] assign[member[gbmParameters._histogram_type], member[SharedTreeParameters.HistogramType.AUTO]] assign[member[gbmParameters._ntrees], literal[1000]] assign[member[gbmParameters._sample_rate], literal[0.8]] assign[member[gbmParameters._col_sample_rate], literal[0.8]] assign[member[gbmParameters._col_sample_rate_per_tree], literal[0.8]] assign[member[gbmParameters._max_depth], literal[6]] assign[member[gbmParameters._min_rows], literal[1]] assign[member[.gbmJob], call[.trainModel, parameter[literal[null], member[.work], member[.gbmParameters]]]] call[.pollAndUpdateProgress, parameter[member[Stage.ModelTraining], literal["GBM 1"], member[.work], THIS[call[None.job, parameter[]]], member[.gbmJob]]] assign[member[gbmParameters._max_depth], literal[7]] assign[member[gbmParameters._min_rows], literal[10]] assign[member[.gbmJob], call[.trainModel, parameter[literal[null], member[.work], member[.gbmParameters]]]] call[.pollAndUpdateProgress, parameter[member[Stage.ModelTraining], literal["GBM 2"], member[.work], THIS[call[None.job, parameter[]]], member[.gbmJob]]] assign[member[gbmParameters._max_depth], literal[8]] assign[member[gbmParameters._min_rows], literal[10]] assign[member[.gbmJob], call[.trainModel, parameter[literal[null], member[.work], member[.gbmParameters]]]] call[.pollAndUpdateProgress, parameter[member[Stage.ModelTraining], literal["GBM 3"], member[.work], THIS[call[None.job, parameter[]]], member[.gbmJob]]] assign[member[gbmParameters._max_depth], literal[10]] assign[member[gbmParameters._min_rows], literal[10]] assign[member[.gbmJob], call[.trainModel, parameter[literal[null], member[.work], member[.gbmParameters]]]] call[.pollAndUpdateProgress, parameter[member[Stage.ModelTraining], literal["GBM 4"], member[.work], THIS[call[None.job, parameter[]]], member[.gbmJob]]] assign[member[gbmParameters._max_depth], literal[15]] assign[member[gbmParameters._min_rows], literal[100]] assign[member[.gbmJob], call[.trainModel, parameter[literal[null], member[.work], member[.gbmParameters]]]] call[.pollAndUpdateProgress, parameter[member[Stage.ModelTraining], literal["GBM 5"], member[.work], THIS[call[None.job, parameter[]]], member[.gbmJob]]] end[}] END[}]
Keyword[void] identifier[defaultGBMs] operator[SEP] operator[SEP] { identifier[Algo] identifier[algo] operator[=] identifier[Algo] operator[SEP] identifier[GBM] operator[SEP] identifier[WorkAllocations] operator[SEP] identifier[Work] identifier[work] operator[=] identifier[workAllocations] operator[SEP] identifier[getAllocation] operator[SEP] identifier[algo] , identifier[JobType] operator[SEP] identifier[ModelBuild] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[work] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[Job] identifier[gbmJob] operator[SEP] identifier[GBMParameters] identifier[gbmParameters] operator[=] Keyword[new] identifier[GBMParameters] operator[SEP] operator[SEP] operator[SEP] identifier[setCommonModelBuilderParams] operator[SEP] identifier[gbmParameters] operator[SEP] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_score_tree_interval] operator[=] Other[5] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_histogram_type] operator[=] identifier[SharedTreeParameters] operator[SEP] identifier[HistogramType] operator[SEP] identifier[AUTO] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_ntrees] operator[=] Other[1000] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_sample_rate] operator[=] literal[Float] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_col_sample_rate] operator[=] literal[Float] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_col_sample_rate_per_tree] operator[=] literal[Float] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_max_depth] operator[=] Other[6] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_min_rows] operator[=] Other[1] operator[SEP] identifier[gbmJob] operator[=] identifier[trainModel] operator[SEP] Other[null] , identifier[work] , identifier[gbmParameters] operator[SEP] operator[SEP] identifier[pollAndUpdateProgress] operator[SEP] identifier[Stage] operator[SEP] identifier[ModelTraining] , literal[String] , identifier[work] , Keyword[this] operator[SEP] identifier[job] operator[SEP] operator[SEP] , identifier[gbmJob] operator[SEP] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_max_depth] operator[=] Other[7] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_min_rows] operator[=] Other[10] operator[SEP] identifier[gbmJob] operator[=] identifier[trainModel] operator[SEP] Other[null] , identifier[work] , identifier[gbmParameters] operator[SEP] operator[SEP] identifier[pollAndUpdateProgress] operator[SEP] identifier[Stage] operator[SEP] identifier[ModelTraining] , literal[String] , identifier[work] , Keyword[this] operator[SEP] identifier[job] operator[SEP] operator[SEP] , identifier[gbmJob] operator[SEP] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_max_depth] operator[=] Other[8] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_min_rows] operator[=] Other[10] operator[SEP] identifier[gbmJob] operator[=] identifier[trainModel] operator[SEP] Other[null] , identifier[work] , identifier[gbmParameters] operator[SEP] operator[SEP] identifier[pollAndUpdateProgress] operator[SEP] identifier[Stage] operator[SEP] identifier[ModelTraining] , literal[String] , identifier[work] , Keyword[this] operator[SEP] identifier[job] operator[SEP] operator[SEP] , identifier[gbmJob] operator[SEP] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_max_depth] operator[=] Other[10] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_min_rows] operator[=] Other[10] operator[SEP] identifier[gbmJob] operator[=] identifier[trainModel] operator[SEP] Other[null] , identifier[work] , identifier[gbmParameters] operator[SEP] operator[SEP] identifier[pollAndUpdateProgress] operator[SEP] identifier[Stage] operator[SEP] identifier[ModelTraining] , literal[String] , identifier[work] , Keyword[this] operator[SEP] identifier[job] operator[SEP] operator[SEP] , identifier[gbmJob] operator[SEP] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_max_depth] operator[=] Other[15] operator[SEP] identifier[gbmParameters] operator[SEP] identifier[_min_rows] operator[=] Other[100] operator[SEP] identifier[gbmJob] operator[=] identifier[trainModel] operator[SEP] Other[null] , identifier[work] , identifier[gbmParameters] operator[SEP] operator[SEP] identifier[pollAndUpdateProgress] operator[SEP] identifier[Stage] operator[SEP] identifier[ModelTraining] , literal[String] , identifier[work] , Keyword[this] operator[SEP] identifier[job] operator[SEP] operator[SEP] , identifier[gbmJob] operator[SEP] operator[SEP] }
public void addTaskStates(Collection<TaskState> taskStates) { for (TaskState taskState : taskStates) { this.taskStates.put(taskState.getTaskId(), taskState); } }
class class_name[name] begin[{] method[addTaskStates, return_type[void], modifier[public], parameter[taskStates]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=taskStates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTaskId, postfix_operators=[], prefix_operators=[], qualifier=taskState, selectors=[], type_arguments=None), MemberReference(member=taskState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=taskStates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=taskState)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TaskState, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[addTaskStates] operator[SEP] identifier[Collection] operator[<] identifier[TaskState] operator[>] identifier[taskStates] operator[SEP] { Keyword[for] operator[SEP] identifier[TaskState] identifier[taskState] operator[:] identifier[taskStates] operator[SEP] { Keyword[this] operator[SEP] identifier[taskStates] operator[SEP] identifier[put] operator[SEP] identifier[taskState] operator[SEP] identifier[getTaskId] operator[SEP] operator[SEP] , identifier[taskState] operator[SEP] operator[SEP] } }
@Override public Object getAttribute(String name) { if (isInvalid()) { throw new IllegalStateException("Session is invalid"); } return this.attributes.get(name); }
class class_name[name] begin[{] method[getAttribute, return_type[type[Object]], modifier[public], parameter[name]] begin[{] if[call[.isInvalid, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Session is invalid")], 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[}] return[THIS[member[None.attributes]call[None.get, parameter[member[.name]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[getAttribute] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[isInvalid] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[attributes] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] }
public Observable<Page<SiteInner>> suspendNextAsync(final String nextPageLink) { return suspendNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<SiteInner>>, Page<SiteInner>>() { @Override public Page<SiteInner> call(ServiceResponse<Page<SiteInner>> response) { return response.body(); } }); }
class class_name[name] begin[{] method[suspendNextAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink]] begin[{] return[call[.suspendNextWithServiceResponseAsync, parameter[member[.nextPageLink]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] identifier[suspendNextAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[suspendNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[SiteInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SiteInner] operator[>] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public OvhTask serviceName_datacenter_POST(String serviceName, String commercialRangeName, String vrackName) throws IOException { String qPath = "/dedicatedCloud/{serviceName}/datacenter"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "commercialRangeName", commercialRangeName); addBody(o, "vrackName", vrackName); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhTask.class); }
class class_name[name] begin[{] method[serviceName_datacenter_POST, return_type[type[OvhTask]], modifier[public], parameter[serviceName, commercialRangeName, vrackName]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[HashMap], o] call[.addBody, parameter[member[.o], literal["commercialRangeName"], member[.commercialRangeName]]] call[.addBody, parameter[member[.o], literal["vrackName"], member[.vrackName]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhTask, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhTask] identifier[serviceName_datacenter_POST] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[commercialRangeName] , identifier[String] identifier[vrackName] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[commercialRangeName] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[vrackName] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhTask] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public static LongsColumn create(ColumnarLongs column, ImmutableBitmap nullValueBitmap) { if (nullValueBitmap.isEmpty()) { return new LongsColumn(column); } else { return new LongsColumnWithNulls(column, nullValueBitmap); } }
class class_name[name] begin[{] method[create, return_type[type[LongsColumn]], modifier[public static], parameter[column, nullValueBitmap]] begin[{] if[call[nullValueBitmap.isEmpty, parameter[]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=column, 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=LongsColumn, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nullValueBitmap, 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=LongsColumnWithNulls, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[LongsColumn] identifier[create] operator[SEP] identifier[ColumnarLongs] identifier[column] , identifier[ImmutableBitmap] identifier[nullValueBitmap] operator[SEP] { Keyword[if] operator[SEP] identifier[nullValueBitmap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[LongsColumn] operator[SEP] identifier[column] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[LongsColumnWithNulls] operator[SEP] identifier[column] , identifier[nullValueBitmap] operator[SEP] operator[SEP] } }
public static PropertyValuesHolder ofKeyframe(String propertyName, Keyframe... values) { KeyframeSet keyframeSet = KeyframeSet.ofKeyframe(values); if (keyframeSet instanceof IntKeyframeSet) { return new IntPropertyValuesHolder(propertyName, (IntKeyframeSet) keyframeSet); } else if (keyframeSet instanceof FloatKeyframeSet) { return new FloatPropertyValuesHolder(propertyName, (FloatKeyframeSet) keyframeSet); } else { PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName); pvh.mKeyframeSet = keyframeSet; pvh.mValueType = ((Keyframe)values[0]).getType(); return pvh; } }
class class_name[name] begin[{] method[ofKeyframe, return_type[type[PropertyValuesHolder]], modifier[public static], parameter[propertyName, values]] begin[{] local_variable[type[KeyframeSet], keyframeSet] if[binary_operation[member[.keyframeSet], instanceof, type[IntKeyframeSet]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=keyframeSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IntKeyframeSet, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntPropertyValuesHolder, sub_type=None))] else begin[{] if[binary_operation[member[.keyframeSet], instanceof, type[FloatKeyframeSet]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=keyframeSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=FloatKeyframeSet, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FloatPropertyValuesHolder, sub_type=None))] else begin[{] local_variable[type[PropertyValuesHolder], pvh] assign[member[pvh.mKeyframeSet], member[.keyframeSet]] assign[member[pvh.mValueType], Cast(expression=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=Keyframe, sub_type=None))] return[member[.pvh]] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[PropertyValuesHolder] identifier[ofKeyframe] operator[SEP] identifier[String] identifier[propertyName] , identifier[Keyframe] operator[...] identifier[values] operator[SEP] { identifier[KeyframeSet] identifier[keyframeSet] operator[=] identifier[KeyframeSet] operator[SEP] identifier[ofKeyframe] operator[SEP] identifier[values] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keyframeSet] Keyword[instanceof] identifier[IntKeyframeSet] operator[SEP] { Keyword[return] Keyword[new] identifier[IntPropertyValuesHolder] operator[SEP] identifier[propertyName] , operator[SEP] identifier[IntKeyframeSet] operator[SEP] identifier[keyframeSet] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[keyframeSet] Keyword[instanceof] identifier[FloatKeyframeSet] operator[SEP] { Keyword[return] Keyword[new] identifier[FloatPropertyValuesHolder] operator[SEP] identifier[propertyName] , operator[SEP] identifier[FloatKeyframeSet] operator[SEP] identifier[keyframeSet] operator[SEP] operator[SEP] } Keyword[else] { identifier[PropertyValuesHolder] identifier[pvh] operator[=] Keyword[new] identifier[PropertyValuesHolder] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] identifier[pvh] operator[SEP] identifier[mKeyframeSet] operator[=] identifier[keyframeSet] operator[SEP] identifier[pvh] operator[SEP] identifier[mValueType] operator[=] operator[SEP] operator[SEP] identifier[Keyframe] operator[SEP] identifier[values] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[pvh] operator[SEP] } }
public void setPickerDate(JsDate date, Element picker) { try { $(picker).pickadate("picker").set("select", date, () -> { DOM.createFieldSet().setPropertyObject("muted", true); }); } catch (Exception e) { e.printStackTrace(); } }
class class_name[name] begin[{] method[setPickerDate, return_type[void], modifier[public], parameter[date, picker]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=picker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=$, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="picker")], member=pickadate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="select"), MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[], member=createFieldSet, postfix_operators=[], prefix_operators=[], qualifier=DOM, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="muted"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setPropertyObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], parameters=[])], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setPickerDate] operator[SEP] identifier[JsDate] identifier[date] , identifier[Element] identifier[picker] operator[SEP] { Keyword[try] { identifier[$] operator[SEP] identifier[picker] operator[SEP] operator[SEP] identifier[pickadate] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[set] operator[SEP] literal[String] , identifier[date] , operator[SEP] operator[SEP] operator[->] { identifier[DOM] operator[SEP] identifier[createFieldSet] operator[SEP] operator[SEP] operator[SEP] identifier[setPropertyObject] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } }
public void sendSerialMessage(byte[] value) { Buffer buffer = new Buffer(); buffer.write(value); sendMessage(BeanMessageID.SERIAL_DATA, buffer); }
class class_name[name] begin[{] method[sendSerialMessage, return_type[void], modifier[public], parameter[value]] begin[{] local_variable[type[Buffer], buffer] call[buffer.write, parameter[member[.value]]] call[.sendMessage, parameter[member[BeanMessageID.SERIAL_DATA], member[.buffer]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[sendSerialMessage] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[SEP] { identifier[Buffer] identifier[buffer] operator[=] Keyword[new] identifier[Buffer] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[write] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[sendMessage] operator[SEP] identifier[BeanMessageID] operator[SEP] identifier[SERIAL_DATA] , identifier[buffer] operator[SEP] operator[SEP] }
public void setNewSpaceProperties(String spaceId, Map<String, String> spaceProperties, Map<String, AclType> spaceACLs) { // Add ACLs to the properties list spaceProperties.putAll(packACLs(spaceACLs)); boolean success = false; int maxLoops = 6; for (int loops = 0; !success && loops < maxLoops; loops++) { try { doSetSpaceProperties(spaceId, spaceProperties); success = true; } catch (NotFoundException e) { success = false; } } if (!success) { throw new StorageException( "Properties for space " + spaceId + " could not be created. " + "The space cannot be found."); } }
class class_name[name] begin[{] method[setNewSpaceProperties, return_type[void], modifier[public], parameter[spaceId, spaceProperties, spaceACLs]] begin[{] call[spaceProperties.putAll, parameter[call[.packACLs, parameter[member[.spaceACLs]]]]] local_variable[type[boolean], success] local_variable[type[int], maxLoops] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=spaceProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doSetSpaceProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NotFoundException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=success, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=loops, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxLoops, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=loops)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=loops, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[member[.success]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Properties for space "), operandr=MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" could not be created. "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The space cannot be found."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StorageException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setNewSpaceProperties] operator[SEP] identifier[String] identifier[spaceId] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[spaceProperties] , identifier[Map] operator[<] identifier[String] , identifier[AclType] operator[>] identifier[spaceACLs] operator[SEP] { identifier[spaceProperties] operator[SEP] identifier[putAll] operator[SEP] identifier[packACLs] operator[SEP] identifier[spaceACLs] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[success] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[maxLoops] operator[=] Other[6] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[loops] operator[=] Other[0] operator[SEP] operator[!] identifier[success] operator[&&] identifier[loops] operator[<] identifier[maxLoops] operator[SEP] identifier[loops] operator[++] operator[SEP] { Keyword[try] { identifier[doSetSpaceProperties] operator[SEP] identifier[spaceId] , identifier[spaceProperties] operator[SEP] operator[SEP] identifier[success] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[NotFoundException] identifier[e] operator[SEP] { identifier[success] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[success] operator[SEP] { Keyword[throw] Keyword[new] identifier[StorageException] operator[SEP] literal[String] operator[+] identifier[spaceId] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } }
public void indexDocument(String indexName, String mappingName, String id, XContentBuilder document) throws Exception { client.prepareIndex(indexName, mappingName, id).setSource(document).get(); }
class class_name[name] begin[{] method[indexDocument, return_type[void], modifier[public], parameter[indexName, mappingName, id, document]] begin[{] call[client.prepareIndex, parameter[member[.indexName], member[.mappingName], member[.id]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[indexDocument] operator[SEP] identifier[String] identifier[indexName] , identifier[String] identifier[mappingName] , identifier[String] identifier[id] , identifier[XContentBuilder] identifier[document] operator[SEP] Keyword[throws] identifier[Exception] { identifier[client] operator[SEP] identifier[prepareIndex] operator[SEP] identifier[indexName] , identifier[mappingName] , identifier[id] operator[SEP] operator[SEP] identifier[setSource] operator[SEP] identifier[document] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] }
@NotNull public BlockscoreErrorType getErrorType() { if (type == null) { return BlockscoreErrorType.UNKNOWN; } else { return BlockscoreErrorType.toEnum(type); } }
class class_name[name] begin[{] method[getErrorType, return_type[type[BlockscoreErrorType]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.type], ==, literal[null]]] begin[{] return[member[BlockscoreErrorType.UNKNOWN]] else begin[{] return[call[BlockscoreErrorType.toEnum, parameter[member[.type]]]] end[}] end[}] END[}]
annotation[@] identifier[NotNull] Keyword[public] identifier[BlockscoreErrorType] identifier[getErrorType] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[BlockscoreErrorType] operator[SEP] identifier[UNKNOWN] operator[SEP] } Keyword[else] { Keyword[return] identifier[BlockscoreErrorType] operator[SEP] identifier[toEnum] operator[SEP] identifier[type] operator[SEP] operator[SEP] } }
public static void generateLogForContentValues(SQLiteModelMethod method, MethodSpec.Builder methodBuilder) { methodBuilder.addCode("\n// log for content values -- BEGIN\n"); methodBuilder.addStatement("$T<String, Object, $T> _contentValue", Triple.class, KriptonContentValues.ParamType.class); methodBuilder.beginControlFlow("for (int i = 0; i < _contentValues.size(); i++)"); methodBuilder.addStatement("_contentValue = _contentValues.get(i)"); methodBuilder.beginControlFlow("if (_contentValue.value1==null)"); methodBuilder.addStatement("$T.info(\"==> :%s = <null>\", _contentValue.value0)", Logger.class); methodBuilder.nextControlFlow("else"); methodBuilder.addStatement("$T.info(\"==> :%s = '%s' (%s)\", _contentValue.value0, $T.checkSize(_contentValue.value1), _contentValue.value1.getClass().getCanonicalName())", Logger.class, StringUtils.class); methodBuilder.endControlFlow(); methodBuilder.endControlFlow(); methodBuilder.addCode("// log for content values -- END\n"); }
class class_name[name] begin[{] method[generateLogForContentValues, return_type[void], modifier[public static], parameter[method, methodBuilder]] begin[{] call[methodBuilder.addCode, parameter[literal["\n// log for content values -- BEGIN\n"]]] call[methodBuilder.addStatement, parameter[literal["$T<String, Object, $T> _contentValue"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Triple, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=KriptonContentValues, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParamType, sub_type=None))]] call[methodBuilder.beginControlFlow, parameter[literal["for (int i = 0; i < _contentValues.size(); i++)"]]] call[methodBuilder.addStatement, parameter[literal["_contentValue = _contentValues.get(i)"]]] call[methodBuilder.beginControlFlow, parameter[literal["if (_contentValue.value1==null)"]]] call[methodBuilder.addStatement, parameter[literal["$T.info(\"==> :%s = <null>\", _contentValue.value0)"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Logger, sub_type=None))]] call[methodBuilder.nextControlFlow, parameter[literal["else"]]] call[methodBuilder.addStatement, parameter[literal["$T.info(\"==> :%s = '%s' (%s)\", _contentValue.value0, $T.checkSize(_contentValue.value1), _contentValue.value1.getClass().getCanonicalName())"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Logger, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringUtils, sub_type=None))]] call[methodBuilder.endControlFlow, parameter[]] call[methodBuilder.endControlFlow, parameter[]] call[methodBuilder.addCode, parameter[literal["// log for content values -- END\n"]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[generateLogForContentValues] operator[SEP] identifier[SQLiteModelMethod] identifier[method] , identifier[MethodSpec] operator[SEP] identifier[Builder] identifier[methodBuilder] operator[SEP] { identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[addStatement] operator[SEP] literal[String] , identifier[Triple] operator[SEP] Keyword[class] , identifier[KriptonContentValues] operator[SEP] identifier[ParamType] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[beginControlFlow] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[addStatement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[beginControlFlow] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[addStatement] operator[SEP] literal[String] , identifier[Logger] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[nextControlFlow] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[addStatement] operator[SEP] literal[String] , identifier[Logger] operator[SEP] Keyword[class] , identifier[StringUtils] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[endControlFlow] operator[SEP] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[endControlFlow] operator[SEP] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] literal[String] operator[SEP] operator[SEP] }
@POST @Path("/{gavc}" + ServerAPI.GET_DOWNLOAD_URL) public Response updateDownloadUrl(@Auth final DbCredential credential, @PathParam("gavc") final String gavc, @QueryParam(ServerAPI.URL_PARAM) final String downLoadUrl){ if(!credential.getRoles().contains(AvailableRoles.DATA_UPDATER)){ throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build()); } if(LOG.isInfoEnabled()) { LOG.info(String.format("Got an update downloadUrl request [%s] [%s]", gavc, downLoadUrl)); } if(gavc == null || downLoadUrl == null){ return Response.serverError().status(HttpStatus.NOT_ACCEPTABLE_406).build(); } getArtifactHandler().updateDownLoadUrl(gavc, downLoadUrl); return Response.ok("done").build(); }
class class_name[name] begin[{] method[updateDownloadUrl, return_type[type[Response]], modifier[public], parameter[credential, gavc, downLoadUrl]] begin[{] if[call[credential.getRoles, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=UNAUTHORIZED, postfix_operators=[], prefix_operators=[], qualifier=Response.Status, selectors=[])], member=status, postfix_operators=[], prefix_operators=[], qualifier=Response, selectors=[MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WebApplicationException, sub_type=None)), label=None) else begin[{] None end[}] if[call[LOG.isInfoEnabled, parameter[]]] begin[{] call[LOG.info, parameter[call[String.format, parameter[literal["Got an update downloadUrl request [%s] [%s]"], member[.gavc], member[.downLoadUrl]]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.gavc], ==, literal[null]], ||, binary_operation[member[.downLoadUrl], ==, literal[null]]]] begin[{] return[call[Response.serverError, parameter[]]] else begin[{] None end[}] call[.getArtifactHandler, parameter[]] return[call[Response.ok, parameter[literal["done"]]]] end[}] END[}]
annotation[@] identifier[POST] annotation[@] identifier[Path] operator[SEP] literal[String] operator[+] identifier[ServerAPI] operator[SEP] identifier[GET_DOWNLOAD_URL] operator[SEP] Keyword[public] identifier[Response] identifier[updateDownloadUrl] operator[SEP] annotation[@] identifier[Auth] Keyword[final] identifier[DbCredential] identifier[credential] , annotation[@] identifier[PathParam] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[gavc] , annotation[@] identifier[QueryParam] operator[SEP] identifier[ServerAPI] operator[SEP] identifier[URL_PARAM] operator[SEP] Keyword[final] identifier[String] identifier[downLoadUrl] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[credential] operator[SEP] identifier[getRoles] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[AvailableRoles] operator[SEP] identifier[DATA_UPDATER] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[WebApplicationException] operator[SEP] identifier[Response] operator[SEP] identifier[status] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[UNAUTHORIZED] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[gavc] , identifier[downLoadUrl] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[gavc] operator[==] Other[null] operator[||] identifier[downLoadUrl] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Response] operator[SEP] identifier[serverError] operator[SEP] operator[SEP] operator[SEP] identifier[status] operator[SEP] identifier[HttpStatus] operator[SEP] identifier[NOT_ACCEPTABLE_406] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } identifier[getArtifactHandler] operator[SEP] operator[SEP] operator[SEP] identifier[updateDownLoadUrl] operator[SEP] identifier[gavc] , identifier[downLoadUrl] operator[SEP] operator[SEP] Keyword[return] identifier[Response] operator[SEP] identifier[ok] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public SparseDirectedEdgeSet copy(IntSet vertices) { SparseDirectedEdgeSet copy = new SparseDirectedEdgeSet(rootVertex); if (vertices.size() < inEdges.size() && vertices.size() < outEdges.size()) { IntIterator iter = vertices.iterator(); while (iter.hasNext()) { int v = iter.nextInt(); if (inEdges.contains(v)) copy.inEdges.add(v); if (outEdges.contains(v)) copy.inEdges.add(v); } } else { IntIterator iter = inEdges.iterator(); while (iter.hasNext()) { int v = iter.nextInt(); if (vertices.contains(v)) copy.inEdges.add(v); } iter = outEdges.iterator(); while (iter.hasNext()) { int v = iter.nextInt(); if (vertices.contains(v)) copy.outEdges.add(v); } } return copy; }
class class_name[name] begin[{] method[copy, return_type[type[SparseDirectedEdgeSet]], modifier[public], parameter[vertices]] begin[{] local_variable[type[SparseDirectedEdgeSet], copy] if[binary_operation[binary_operation[call[vertices.size, parameter[]], <, call[inEdges.size, parameter[]]], &&, binary_operation[call[vertices.size, parameter[]], <, call[outEdges.size, parameter[]]]]] begin[{] local_variable[type[IntIterator], iter] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[int], v] if[call[inEdges.contains, parameter[member[.v]]]] begin[{] call[copy.inEdges.add, parameter[member[.v]]] else begin[{] None end[}] if[call[outEdges.contains, parameter[member[.v]]]] begin[{] call[copy.inEdges.add, parameter[member[.v]]] else begin[{] None end[}] end[}] else begin[{] local_variable[type[IntIterator], iter] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[int], v] if[call[vertices.contains, parameter[member[.v]]]] begin[{] call[copy.inEdges.add, parameter[member[.v]]] else begin[{] None end[}] end[}] assign[member[.iter], call[outEdges.iterator, parameter[]]] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[int], v] if[call[vertices.contains, parameter[member[.v]]]] begin[{] call[copy.outEdges.add, parameter[member[.v]]] else begin[{] None end[}] end[}] end[}] return[member[.copy]] end[}] END[}]
Keyword[public] identifier[SparseDirectedEdgeSet] identifier[copy] operator[SEP] identifier[IntSet] identifier[vertices] operator[SEP] { identifier[SparseDirectedEdgeSet] identifier[copy] operator[=] Keyword[new] identifier[SparseDirectedEdgeSet] operator[SEP] identifier[rootVertex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vertices] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[inEdges] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[&&] identifier[vertices] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[outEdges] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[IntIterator] identifier[iter] operator[=] identifier[vertices] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[v] operator[=] identifier[iter] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inEdges] operator[SEP] identifier[contains] operator[SEP] identifier[v] operator[SEP] operator[SEP] identifier[copy] operator[SEP] identifier[inEdges] operator[SEP] identifier[add] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[outEdges] operator[SEP] identifier[contains] operator[SEP] identifier[v] operator[SEP] operator[SEP] identifier[copy] operator[SEP] identifier[inEdges] operator[SEP] identifier[add] operator[SEP] identifier[v] operator[SEP] operator[SEP] } } Keyword[else] { identifier[IntIterator] identifier[iter] operator[=] identifier[inEdges] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[v] operator[=] identifier[iter] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vertices] operator[SEP] identifier[contains] operator[SEP] identifier[v] operator[SEP] operator[SEP] identifier[copy] operator[SEP] identifier[inEdges] operator[SEP] identifier[add] operator[SEP] identifier[v] operator[SEP] operator[SEP] } identifier[iter] operator[=] identifier[outEdges] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[v] operator[=] identifier[iter] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vertices] operator[SEP] identifier[contains] operator[SEP] identifier[v] operator[SEP] operator[SEP] identifier[copy] operator[SEP] identifier[outEdges] operator[SEP] identifier[add] operator[SEP] identifier[v] operator[SEP] operator[SEP] } } Keyword[return] identifier[copy] operator[SEP] }
public List<FeatureDao> getFeatureDaosForTileTable(String tileTable) { List<FeatureDao> featureDaos = new ArrayList<FeatureDao>(); List<String> featureTables = getFeatureTablesForTileTable(tileTable); for (String featureTable : featureTables) { if (geoPackage.isFeatureTable(featureTable)) { FeatureDao featureDao = geoPackage.getFeatureDao(featureTable); featureDaos.add(featureDao); } } return featureDaos; }
class class_name[name] begin[{] method[getFeatureDaosForTileTable, return_type[type[List]], modifier[public], parameter[tileTable]] begin[{] local_variable[type[List], featureDaos] local_variable[type[List], featureTables] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=featureTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isFeatureTable, postfix_operators=[], prefix_operators=[], qualifier=geoPackage, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=featureTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFeatureDao, postfix_operators=[], prefix_operators=[], qualifier=geoPackage, selectors=[], type_arguments=None), name=featureDao)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FeatureDao, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=featureDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=featureDaos, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=featureTables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=featureTable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.featureDaos]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[FeatureDao] operator[>] identifier[getFeatureDaosForTileTable] operator[SEP] identifier[String] identifier[tileTable] operator[SEP] { identifier[List] operator[<] identifier[FeatureDao] operator[>] identifier[featureDaos] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[FeatureDao] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[featureTables] operator[=] identifier[getFeatureTablesForTileTable] operator[SEP] identifier[tileTable] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[featureTable] operator[:] identifier[featureTables] operator[SEP] { Keyword[if] operator[SEP] identifier[geoPackage] operator[SEP] identifier[isFeatureTable] operator[SEP] identifier[featureTable] operator[SEP] operator[SEP] { identifier[FeatureDao] identifier[featureDao] operator[=] identifier[geoPackage] operator[SEP] identifier[getFeatureDao] operator[SEP] identifier[featureTable] operator[SEP] operator[SEP] identifier[featureDaos] operator[SEP] identifier[add] operator[SEP] identifier[featureDao] operator[SEP] operator[SEP] } } Keyword[return] identifier[featureDaos] operator[SEP] }
@XmlElementDecl(namespace = "http://www.tibco.com/xmlns/dd", name = "NameValuePairs", substitutionHeadNamespace = "http://www.tibco.com/xmlns/dd", substitutionHeadName = "DeploymentDescriptor") public JAXBElement<NameValuePairs> createNameValuePairs(NameValuePairs value) { return new JAXBElement<NameValuePairs>(_NameValuePairs_QNAME, NameValuePairs.class, null, value); }
class class_name[name] begin[{] method[createNameValuePairs, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_NameValuePairs_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NameValuePairs, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NameValuePairs, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[substitutionHeadNamespace] operator[=] literal[String] , identifier[substitutionHeadName] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[NameValuePairs] operator[>] identifier[createNameValuePairs] operator[SEP] identifier[NameValuePairs] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[NameValuePairs] operator[>] operator[SEP] identifier[_NameValuePairs_QNAME] , identifier[NameValuePairs] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public static EightyPath toRealPath( Path path ) { if( !( path instanceof EightyPath ) ) { throw new IllegalArgumentException( path + " should be EightyPath" ); } EightyPath eightyPath = (EightyPath) path; if ( eightyPath.knownReal() ) { return eightyPath; } return new RealPath( eightyPath ).to(); }
class class_name[name] begin[{] method[toRealPath, return_type[type[EightyPath]], modifier[public static], parameter[path]] begin[{] if[binary_operation[member[.path], instanceof, type[EightyPath]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" should be EightyPath"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[EightyPath], eightyPath] if[call[eightyPath.knownReal, parameter[]]] begin[{] return[member[.eightyPath]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=eightyPath, postfix_operators=[], prefix_operators=[], qualifier=, 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=None, dimensions=None, name=RealPath, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[EightyPath] identifier[toRealPath] operator[SEP] identifier[Path] identifier[path] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[path] Keyword[instanceof] identifier[EightyPath] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[path] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[EightyPath] identifier[eightyPath] operator[=] operator[SEP] identifier[EightyPath] operator[SEP] identifier[path] operator[SEP] Keyword[if] operator[SEP] identifier[eightyPath] operator[SEP] identifier[knownReal] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[eightyPath] operator[SEP] } Keyword[return] Keyword[new] identifier[RealPath] operator[SEP] identifier[eightyPath] operator[SEP] operator[SEP] identifier[to] operator[SEP] operator[SEP] operator[SEP] }
public void setScale(float x, float y, float z) { getTransform().setScale(x, y, z); if (mTransformCache.setScale(x, y, z)) { onTransformChanged(); } }
class class_name[name] begin[{] method[setScale, return_type[void], modifier[public], parameter[x, y, z]] begin[{] call[.getTransform, parameter[]] if[call[mTransformCache.setScale, parameter[member[.x], member[.y], member[.z]]]] begin[{] call[.onTransformChanged, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setScale] operator[SEP] Keyword[float] identifier[x] , Keyword[float] identifier[y] , Keyword[float] identifier[z] operator[SEP] { identifier[getTransform] operator[SEP] operator[SEP] operator[SEP] identifier[setScale] operator[SEP] identifier[x] , identifier[y] , identifier[z] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mTransformCache] operator[SEP] identifier[setScale] operator[SEP] identifier[x] , identifier[y] , identifier[z] operator[SEP] operator[SEP] { identifier[onTransformChanged] operator[SEP] operator[SEP] operator[SEP] } }
private String getDetails(Throwable error) { if (null == error) { return ""; } StringBuilder content = new StringBuilder(); content.append(error.getMessage()); processStackTrace(error.getStackTrace(), content); content.append(getDetails(error.getCause())); return content.toString(); }
class class_name[name] begin[{] method[getDetails, return_type[type[String]], modifier[private], parameter[error]] begin[{] if[binary_operation[literal[null], ==, member[.error]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[StringBuilder], content] call[content.append, parameter[call[error.getMessage, parameter[]]]] call[.processStackTrace, parameter[call[error.getStackTrace, parameter[]], member[.content]]] call[content.append, parameter[call[.getDetails, parameter[call[error.getCause, parameter[]]]]]] return[call[content.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[getDetails] operator[SEP] identifier[Throwable] identifier[error] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[error] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[StringBuilder] identifier[content] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[content] operator[SEP] identifier[append] operator[SEP] identifier[error] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processStackTrace] operator[SEP] identifier[error] operator[SEP] identifier[getStackTrace] operator[SEP] operator[SEP] , identifier[content] operator[SEP] operator[SEP] identifier[content] operator[SEP] identifier[append] operator[SEP] identifier[getDetails] operator[SEP] identifier[error] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[content] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public com.squareup.okhttp.Call createSubscriptionAsync(SubscriptionInfo subscriptionInfo, final ApiCallback<SubscriptionEnvelope> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = createSubscriptionValidateBeforeCall(subscriptionInfo, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<SubscriptionEnvelope>(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; }
class class_name[name] begin[{] method[createSubscriptionAsync, return_type[type[com]], modifier[public], parameter[subscriptionInfo, callback]] begin[{] local_variable[type[ProgressResponseBody], progressListener] local_variable[type[ProgressRequestBody], progressRequestListener] if[binary_operation[member[.callback], !=, literal[null]]] begin[{] assign[member[.progressListener], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bytesRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contentLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=done, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onDownloadProgress, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=update, parameters=[FormalParameter(annotations=[], modifiers=set(), name=bytesRead, type=BasicType(dimensions=[], name=long), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=contentLength, type=BasicType(dimensions=[], name=long), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=done, type=BasicType(dimensions=[], name=boolean), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProgressResponseBody, sub_type=ReferenceType(arguments=None, dimensions=None, name=ProgressListener, sub_type=None)))] assign[member[.progressRequestListener], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bytesWritten, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contentLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=done, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onUploadProgress, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onRequestProgress, parameters=[FormalParameter(annotations=[], modifiers=set(), name=bytesWritten, type=BasicType(dimensions=[], name=long), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=contentLength, type=BasicType(dimensions=[], name=long), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=done, type=BasicType(dimensions=[], name=boolean), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProgressRequestBody, sub_type=ReferenceType(arguments=None, dimensions=None, name=ProgressRequestListener, sub_type=None)))] else begin[{] None end[}] local_variable[type[com], call] local_variable[type[Type], localVarReturnType] call[apiClient.executeAsync, parameter[member[.call], member[.localVarReturnType], member[.callback]]] return[member[.call]] end[}] END[}]
Keyword[public] identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[createSubscriptionAsync] operator[SEP] identifier[SubscriptionInfo] identifier[subscriptionInfo] , Keyword[final] identifier[ApiCallback] operator[<] identifier[SubscriptionEnvelope] operator[>] identifier[callback] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[ProgressResponseBody] operator[SEP] identifier[ProgressListener] identifier[progressListener] operator[=] Other[null] operator[SEP] identifier[ProgressRequestBody] operator[SEP] identifier[ProgressRequestListener] identifier[progressRequestListener] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[callback] operator[!=] Other[null] operator[SEP] { identifier[progressListener] operator[=] Keyword[new] identifier[ProgressResponseBody] operator[SEP] identifier[ProgressListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[update] operator[SEP] Keyword[long] identifier[bytesRead] , Keyword[long] identifier[contentLength] , Keyword[boolean] identifier[done] operator[SEP] { identifier[callback] operator[SEP] identifier[onDownloadProgress] operator[SEP] identifier[bytesRead] , identifier[contentLength] , identifier[done] operator[SEP] operator[SEP] } } operator[SEP] identifier[progressRequestListener] operator[=] Keyword[new] identifier[ProgressRequestBody] operator[SEP] identifier[ProgressRequestListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onRequestProgress] operator[SEP] Keyword[long] identifier[bytesWritten] , Keyword[long] identifier[contentLength] , Keyword[boolean] identifier[done] operator[SEP] { identifier[callback] operator[SEP] identifier[onUploadProgress] operator[SEP] identifier[bytesWritten] , identifier[contentLength] , identifier[done] operator[SEP] operator[SEP] } } operator[SEP] } identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[createSubscriptionValidateBeforeCall] operator[SEP] identifier[subscriptionInfo] , identifier[progressListener] , identifier[progressRequestListener] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[SubscriptionEnvelope] operator[>] operator[SEP] operator[SEP] { } operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[apiClient] operator[SEP] identifier[executeAsync] operator[SEP] identifier[call] , identifier[localVarReturnType] , identifier[callback] operator[SEP] operator[SEP] Keyword[return] identifier[call] operator[SEP] }
public List<PlanNode> findAllAtOrBelow( Traversal order, Type firstTypeToFind, Type... additionalTypesToFind ) { return findAllAtOrBelow(order, EnumSet.of(firstTypeToFind, additionalTypesToFind)); }
class class_name[name] begin[{] method[findAllAtOrBelow, return_type[type[List]], modifier[public], parameter[order, firstTypeToFind, additionalTypesToFind]] begin[{] return[call[.findAllAtOrBelow, parameter[member[.order], call[EnumSet.of, parameter[member[.firstTypeToFind], member[.additionalTypesToFind]]]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[PlanNode] operator[>] identifier[findAllAtOrBelow] operator[SEP] identifier[Traversal] identifier[order] , identifier[Type] identifier[firstTypeToFind] , identifier[Type] operator[...] identifier[additionalTypesToFind] operator[SEP] { Keyword[return] identifier[findAllAtOrBelow] operator[SEP] identifier[order] , identifier[EnumSet] operator[SEP] identifier[of] operator[SEP] identifier[firstTypeToFind] , identifier[additionalTypesToFind] operator[SEP] operator[SEP] operator[SEP] }
public static String addStaticQueryParamtersToRequest(final Request<?> request, final String uriResourcePath) { if (request == null || uriResourcePath == null) { return null; } String resourcePath = uriResourcePath; int index = resourcePath.indexOf("?"); if (index != -1) { String queryString = resourcePath.substring(index + 1); resourcePath = resourcePath.substring(0, index); for (String s : queryString.split("[;&]")) { index = s.indexOf("="); if (index != -1) { request.addParameter(s.substring(0, index), s.substring(index + 1)); } else { request.addParameter(s, (String)null); } } } return resourcePath; }
class class_name[name] begin[{] method[addStaticQueryParamtersToRequest, return_type[type[String]], modifier[public static], parameter[request, uriResourcePath]] begin[{] if[binary_operation[binary_operation[member[.request], ==, literal[null]], ||, binary_operation[member[.uriResourcePath], ==, literal[null]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], resourcePath] local_variable[type[int], index] if[binary_operation[member[.index], !=, literal[1]]] begin[{] local_variable[type[String], queryString] assign[member[.resourcePath], call[resourcePath.substring, parameter[literal[0], member[.index]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=addParameter, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=addParameter, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[;&]")], member=split, postfix_operators=[], prefix_operators=[], qualifier=queryString, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] return[member[.resourcePath]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[addStaticQueryParamtersToRequest] operator[SEP] Keyword[final] identifier[Request] operator[<] operator[?] operator[>] identifier[request] , Keyword[final] identifier[String] identifier[uriResourcePath] operator[SEP] { Keyword[if] operator[SEP] identifier[request] operator[==] Other[null] operator[||] identifier[uriResourcePath] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[String] identifier[resourcePath] operator[=] identifier[uriResourcePath] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[resourcePath] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[!=] operator[-] Other[1] operator[SEP] { identifier[String] identifier[queryString] operator[=] identifier[resourcePath] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] identifier[resourcePath] operator[=] identifier[resourcePath] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[queryString] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[index] operator[=] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[!=] operator[-] Other[1] operator[SEP] { identifier[request] operator[SEP] identifier[addParameter] operator[SEP] identifier[s] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[SEP] , identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[request] operator[SEP] identifier[addParameter] operator[SEP] identifier[s] , operator[SEP] identifier[String] operator[SEP] Other[null] operator[SEP] operator[SEP] } } } Keyword[return] identifier[resourcePath] operator[SEP] }
public boolean matchesAny(String... seq) { for (String s : seq) { if (matches(s)) return true; } return false; }
class class_name[name] begin[{] method[matchesAny, return_type[type[boolean]], modifier[public], parameter[seq]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[matchesAny] operator[SEP] identifier[String] operator[...] identifier[seq] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[seq] operator[SEP] { Keyword[if] operator[SEP] identifier[matches] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static int modulo(final long h0, final long h1, final int divisor) { final long d = divisor; final long modH0 = (h0 < 0L) ? addRule(mulRule(BIT62, 2L, d), (h0 & MAX_LONG), d) : h0 % d; final long modH1 = (h1 < 0L) ? addRule(mulRule(BIT62, 2L, d), (h1 & MAX_LONG), d) : h1 % d; final long modTop = mulRule(mulRule(BIT62, 4L, d), modH1, d); return (int) addRule(modTop, modH0, d); }
class class_name[name] begin[{] method[modulo, return_type[type[int]], modifier[public static], parameter[h0, h1, divisor]] begin[{] local_variable[type[long], d] local_variable[type[long], modH0] local_variable[type[long], modH1] local_variable[type[long], modTop] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=modTop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=modH0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[modulo] operator[SEP] Keyword[final] Keyword[long] identifier[h0] , Keyword[final] Keyword[long] identifier[h1] , Keyword[final] Keyword[int] identifier[divisor] operator[SEP] { Keyword[final] Keyword[long] identifier[d] operator[=] identifier[divisor] operator[SEP] Keyword[final] Keyword[long] identifier[modH0] operator[=] operator[SEP] identifier[h0] operator[<] Other[0L] operator[SEP] operator[?] identifier[addRule] operator[SEP] identifier[mulRule] operator[SEP] identifier[BIT62] , Other[2L] , identifier[d] operator[SEP] , operator[SEP] identifier[h0] operator[&] identifier[MAX_LONG] operator[SEP] , identifier[d] operator[SEP] operator[:] identifier[h0] operator[%] identifier[d] operator[SEP] Keyword[final] Keyword[long] identifier[modH1] operator[=] operator[SEP] identifier[h1] operator[<] Other[0L] operator[SEP] operator[?] identifier[addRule] operator[SEP] identifier[mulRule] operator[SEP] identifier[BIT62] , Other[2L] , identifier[d] operator[SEP] , operator[SEP] identifier[h1] operator[&] identifier[MAX_LONG] operator[SEP] , identifier[d] operator[SEP] operator[:] identifier[h1] operator[%] identifier[d] operator[SEP] Keyword[final] Keyword[long] identifier[modTop] operator[=] identifier[mulRule] operator[SEP] identifier[mulRule] operator[SEP] identifier[BIT62] , Other[4L] , identifier[d] operator[SEP] , identifier[modH1] , identifier[d] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[int] operator[SEP] identifier[addRule] operator[SEP] identifier[modTop] , identifier[modH0] , identifier[d] operator[SEP] operator[SEP] }
public Observable<ServiceResponse<List<LabelTextObject>>> examplesMethodWithServiceResponseAsync(UUID appId, String versionId, String modelId, ExamplesMethodOptionalParameter examplesMethodOptionalParameter) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } if (modelId == null) { throw new IllegalArgumentException("Parameter modelId is required and cannot be null."); } final Integer skip = examplesMethodOptionalParameter != null ? examplesMethodOptionalParameter.skip() : null; final Integer take = examplesMethodOptionalParameter != null ? examplesMethodOptionalParameter.take() : null; return examplesMethodWithServiceResponseAsync(appId, versionId, modelId, skip, take); }
class class_name[name] begin[{] method[examplesMethodWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[appId, versionId, modelId, examplesMethodOptionalParameter]] begin[{] if[binary_operation[THIS[member[None.client]call[None.endpoint, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.endpoint() 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[.appId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter appId 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[.versionId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter versionId 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[.modelId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter modelId 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[Integer], skip] local_variable[type[Integer], take] return[call[.examplesMethodWithServiceResponseAsync, parameter[member[.appId], member[.versionId], member[.modelId], member[.skip], member[.take]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[LabelTextObject] operator[>] operator[>] operator[>] identifier[examplesMethodWithServiceResponseAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , identifier[String] identifier[modelId] , identifier[ExamplesMethodOptionalParameter] identifier[examplesMethodOptionalParameter] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[endpoint] 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[appId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[versionId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[modelId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[Integer] identifier[skip] operator[=] identifier[examplesMethodOptionalParameter] operator[!=] Other[null] operator[?] identifier[examplesMethodOptionalParameter] operator[SEP] identifier[skip] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[final] identifier[Integer] identifier[take] operator[=] identifier[examplesMethodOptionalParameter] operator[!=] Other[null] operator[?] identifier[examplesMethodOptionalParameter] operator[SEP] identifier[take] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[return] identifier[examplesMethodWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[versionId] , identifier[modelId] , identifier[skip] , identifier[take] operator[SEP] operator[SEP] }
private static ExecuteCallResults parseExecuteCallInternal( String statement, Map<String,Map<Integer, List<String>>> procedures ) throws SQLParser.Exception { Matcher matcher = ExecuteCallPreamble.matcher(statement); if ( ! matcher.lookingAt()) { return null; } String commandWordTerminator = matcher.group(1); if (OneWhitespace.matcher(commandWordTerminator).matches() || // Might as well accept a comma delimiter anywhere in the exec command, // even near the start commandWordTerminator.equals(",")) { ExecuteCallResults results = new ExecuteCallResults(); String rawParams = statement.substring(matcher.end()); results.params = parseExecParameters(rawParams); results.procedure = results.params.remove(0); // TestSqlCmdInterface passes procedures==null because it // doesn't need/want the param types. if (procedures == null) { results.paramTypes = null; return results; } Map<Integer, List<String>> signature = procedures.get(results.procedure); if (signature == null) { throw new SQLParser.Exception("Undefined procedure: %s", results.procedure); } results.paramTypes = signature.get(results.params.size()); if (results.paramTypes == null || results.params.size() != results.paramTypes.size()) { String expectedSizes = ""; for (Integer expectedSize : signature.keySet()) { expectedSizes += expectedSize + ", "; } throw new SQLParser.Exception( "Invalid parameter count for procedure: %s (expected: %s received: %d)", results.procedure, expectedSizes, results.params.size()); } return results; } if (commandWordTerminator.equals(";")) { // EOL or ; reached before subcommand throw new SQLParser.Exception( "Incomplete EXECUTE command. EXECUTE requires a procedure name argument."); } throw new SQLParser.Exception( "Invalid EXECUTE command. unexpected input: '" + commandWordTerminator + "'."); }
class class_name[name] begin[{] method[parseExecuteCallInternal, return_type[type[ExecuteCallResults]], modifier[private static], parameter[statement, procedures]] begin[{] local_variable[type[Matcher], matcher] if[call[matcher.lookingAt, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], commandWordTerminator] if[binary_operation[call[OneWhitespace.matcher, parameter[member[.commandWordTerminator]]], ||, call[commandWordTerminator.equals, parameter[literal[","]]]]] begin[{] local_variable[type[ExecuteCallResults], results] local_variable[type[String], rawParams] assign[member[results.params], call[.parseExecParameters, parameter[member[.rawParams]]]] assign[member[results.procedure], call[results.params.remove, parameter[literal[0]]]] if[binary_operation[member[.procedures], ==, literal[null]]] begin[{] assign[member[results.paramTypes], literal[null]] return[member[.results]] else begin[{] None end[}] local_variable[type[Map], signature] if[binary_operation[member[.signature], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Undefined procedure: %s"), MemberReference(member=procedure, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLParser, sub_type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None))), label=None) else begin[{] None end[}] assign[member[results.paramTypes], call[signature.get, parameter[call[results.params.size, parameter[]]]]] if[binary_operation[binary_operation[member[results.paramTypes], ==, literal[null]], ||, binary_operation[call[results.params.size, parameter[]], !=, call[results.paramTypes.size, parameter[]]]]] begin[{] local_variable[type[String], expectedSizes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=expectedSizes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=expectedSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", "), operator=+)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=signature, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=expectedSize)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None) ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid parameter count for procedure: %s (expected: %s received: %d)"), MemberReference(member=procedure, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[]), MemberReference(member=expectedSizes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=results.params, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLParser, sub_type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None))), label=None) else begin[{] None end[}] return[member[.results]] else begin[{] None end[}] if[call[commandWordTerminator.equals, parameter[literal[";"]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Incomplete EXECUTE command. EXECUTE requires a procedure name argument.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLParser, sub_type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None))), label=None) else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid EXECUTE command. unexpected input: '"), operandr=MemberReference(member=commandWordTerminator, 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=SQLParser, sub_type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[ExecuteCallResults] identifier[parseExecuteCallInternal] operator[SEP] identifier[String] identifier[statement] , identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[Integer] , identifier[List] operator[<] identifier[String] operator[>] operator[>] operator[>] identifier[procedures] operator[SEP] Keyword[throws] identifier[SQLParser] operator[SEP] identifier[Exception] { identifier[Matcher] identifier[matcher] operator[=] identifier[ExecuteCallPreamble] operator[SEP] identifier[matcher] operator[SEP] identifier[statement] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[matcher] operator[SEP] identifier[lookingAt] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[String] identifier[commandWordTerminator] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[OneWhitespace] operator[SEP] identifier[matcher] operator[SEP] identifier[commandWordTerminator] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[||] identifier[commandWordTerminator] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[ExecuteCallResults] identifier[results] operator[=] Keyword[new] identifier[ExecuteCallResults] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[rawParams] operator[=] identifier[statement] operator[SEP] identifier[substring] operator[SEP] identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[params] operator[=] identifier[parseExecParameters] operator[SEP] identifier[rawParams] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[procedure] operator[=] identifier[results] operator[SEP] identifier[params] operator[SEP] identifier[remove] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[procedures] operator[==] Other[null] operator[SEP] { identifier[results] operator[SEP] identifier[paramTypes] operator[=] Other[null] operator[SEP] Keyword[return] identifier[results] operator[SEP] } identifier[Map] operator[<] identifier[Integer] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[signature] operator[=] identifier[procedures] operator[SEP] identifier[get] operator[SEP] identifier[results] operator[SEP] identifier[procedure] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[signature] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SQLParser] operator[SEP] identifier[Exception] operator[SEP] literal[String] , identifier[results] operator[SEP] identifier[procedure] operator[SEP] operator[SEP] } identifier[results] operator[SEP] identifier[paramTypes] operator[=] identifier[signature] operator[SEP] identifier[get] operator[SEP] identifier[results] operator[SEP] identifier[params] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[results] operator[SEP] identifier[paramTypes] operator[==] Other[null] operator[||] identifier[results] operator[SEP] identifier[params] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[results] operator[SEP] identifier[paramTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[expectedSizes] operator[=] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[expectedSize] operator[:] identifier[signature] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[expectedSizes] operator[+=] identifier[expectedSize] operator[+] literal[String] operator[SEP] } Keyword[throw] Keyword[new] identifier[SQLParser] operator[SEP] identifier[Exception] operator[SEP] literal[String] , identifier[results] operator[SEP] identifier[procedure] , identifier[expectedSizes] , identifier[results] operator[SEP] identifier[params] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[results] operator[SEP] } Keyword[if] operator[SEP] identifier[commandWordTerminator] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[SQLParser] operator[SEP] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[SQLParser] operator[SEP] identifier[Exception] operator[SEP] literal[String] operator[+] identifier[commandWordTerminator] operator[+] literal[String] operator[SEP] operator[SEP] }
public void setObstacleAvoidanceParams(int idx, ObstacleAvoidanceParams params) { if (idx >= 0 && idx < DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS) { m_obstacleQueryParams[idx] = new ObstacleAvoidanceParams(params); } }
class class_name[name] begin[{] method[setObstacleAvoidanceParams, return_type[void], modifier[public], parameter[idx, params]] begin[{] if[binary_operation[binary_operation[member[.idx], >=, literal[0]], &&, binary_operation[member[.idx], <, member[.DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]]]] begin[{] assign[member[.m_obstacleQueryParams], ClassCreator(arguments=[MemberReference(member=params, 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=ObstacleAvoidanceParams, sub_type=None))] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setObstacleAvoidanceParams] operator[SEP] Keyword[int] identifier[idx] , identifier[ObstacleAvoidanceParams] identifier[params] operator[SEP] { Keyword[if] operator[SEP] identifier[idx] operator[>=] Other[0] operator[&&] identifier[idx] operator[<] identifier[DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS] operator[SEP] { identifier[m_obstacleQueryParams] operator[SEP] identifier[idx] operator[SEP] operator[=] Keyword[new] identifier[ObstacleAvoidanceParams] operator[SEP] identifier[params] operator[SEP] operator[SEP] } }
public SolrConfig getSolrConfig() { if (m_solrConfig == null) { try (FileInputStream fis = new FileInputStream(getSolrConfigFile())) { m_solrConfig = new SolrConfig( Paths.get(getHome(), DEFAULT_CONFIGSET_FOLDER), null, new InputSource(fis)); } catch (FileNotFoundException e) { CmsConfigurationException ex = new CmsConfigurationException( Messages.get().container(Messages.LOG_SOLR_ERR_CONFIG_XML_NOT_FOUND_1, getSolrConfigFile()), e); LOG.error(ex.getLocalizedMessage(), ex); } catch (Exception e) { CmsConfigurationException ex = new CmsConfigurationException( Messages.get().container(Messages.LOG_SOLR_ERR_CONFIG_XML_NOT_READABLE_1, getSolrConfigFile()), e); LOG.error(ex.getLocalizedMessage(), ex); } } return m_solrConfig; }
class class_name[name] begin[{] method[getSolrConfig, return_type[type[SolrConfig]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.m_solrConfig], ==, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_solrConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHome, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=DEFAULT_CONFIGSET_FOLDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=Paths, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassCreator(arguments=[MemberReference(member=fis, 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=InputSource, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SolrConfig, sub_type=None))), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=LOG_SOLR_ERR_CONFIG_XML_NOT_FOUND_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getSolrConfigFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), 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=CmsConfigurationException, sub_type=None)), name=ex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsConfigurationException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=LOG_SOLR_ERR_CONFIG_XML_NOT_READABLE_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getSolrConfigFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), 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=CmsConfigurationException, sub_type=None)), name=ex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsConfigurationException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=fis, type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None), value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getSolrConfigFile, 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=FileInputStream, sub_type=None)))]) else begin[{] None end[}] return[member[.m_solrConfig]] end[}] END[}]
Keyword[public] identifier[SolrConfig] identifier[getSolrConfig] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_solrConfig] operator[==] Other[null] operator[SEP] { Keyword[try] operator[SEP] identifier[FileInputStream] identifier[fis] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[getSolrConfigFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[m_solrConfig] operator[=] Keyword[new] identifier[SolrConfig] operator[SEP] identifier[Paths] operator[SEP] identifier[get] operator[SEP] identifier[getHome] operator[SEP] operator[SEP] , identifier[DEFAULT_CONFIGSET_FOLDER] operator[SEP] , Other[null] , Keyword[new] identifier[InputSource] operator[SEP] identifier[fis] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { identifier[CmsConfigurationException] identifier[ex] operator[=] Keyword[new] identifier[CmsConfigurationException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_SOLR_ERR_CONFIG_XML_NOT_FOUND_1] , identifier[getSolrConfigFile] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[ex] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[CmsConfigurationException] identifier[ex] operator[=] Keyword[new] identifier[CmsConfigurationException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_SOLR_ERR_CONFIG_XML_NOT_READABLE_1] , identifier[getSolrConfigFile] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[ex] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] } } Keyword[return] identifier[m_solrConfig] operator[SEP] }
private List<QueryAtomGroupImpl> findComponents(QueryAtomGroupImpl group) { List<QueryAtom> atoms = new LinkedList<>(); atoms.addAll(group.getAtoms()); List<QueryAtomGroupImpl> components = new LinkedList<>(); // if we have no atoms at all we simply return the same query as a single component if (atoms.isEmpty()) { components.add(group); return components; } // find all atoms containing no variables // and build a component QueryAtomGroupImpl component = new QueryAtomGroupImpl(); for (QueryAtom atom : atoms) { boolean noVar = true; for (QueryArgument arg : atom.getArguments()) { if (arg.isVar()) { noVar = false; break; } } if (noVar) { component.addAtom(atom); } } component.getAtoms().forEach(atoms::remove); if (!component.isEmpty()) { components.add(component); } // find connected components UnionFind<QueryArgument> unionFind = new UnionFind<>(); for (QueryAtom atom : atoms) { QueryArgument firstVar = null; for (QueryArgument arg : atom.getArguments()) { if (arg.isVar()) { if (firstVar == null) { firstVar = arg; } else { unionFind.union(firstVar, arg); } } } } while (!atoms.isEmpty()) { component = new QueryAtomGroupImpl(); QueryAtom nextAtom = atoms.get(0); atoms.remove(nextAtom); component.addAtom(nextAtom); QueryArgument args = null; for (QueryArgument arg : nextAtom.getArguments()) { if (arg.isVar()) { args = unionFind.find(arg); break; } } for (QueryAtom atom : atoms) { QueryArgument args2 = null; for (QueryArgument arg : atom.getArguments()) { if (arg.isVar()) { args2 = unionFind.find(arg); break; } } if (args.equals(args2)) { component.addAtom(atom); } } for (QueryAtom atom : component.getAtoms()) { atoms.remove(atom); } components.add(component); } return components; }
class class_name[name] begin[{] method[findComponents, return_type[type[List]], modifier[private], parameter[group]] begin[{] local_variable[type[List], atoms] call[atoms.addAll, parameter[call[group.getAtoms, parameter[]]]] local_variable[type[List], components] if[call[atoms.isEmpty, parameter[]]] begin[{] call[components.add, parameter[member[.group]]] return[member[.components]] else begin[{] None end[}] local_variable[type[QueryAtomGroupImpl], component] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=noVar)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isVar, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=noVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getArguments, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryArgument, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=noVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAtom, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=atoms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryAtom, sub_type=None))), label=None) call[component.getAtoms, parameter[]] if[call[component.isEmpty, parameter[]]] begin[{] call[components.add, parameter[member[.component]]] else begin[{] None end[}] local_variable[type[UnionFind], unionFind] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=firstVar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryArgument, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isVar, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=firstVar, 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=firstVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=union, postfix_operators=[], prefix_operators=[], qualifier=unionFind, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=firstVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getArguments, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryArgument, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=atoms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryAtom, sub_type=None))), label=None) while[call[atoms.isEmpty, parameter[]]] begin[{] assign[member[.component], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QueryAtomGroupImpl, sub_type=None))] local_variable[type[QueryAtom], nextAtom] call[atoms.remove, parameter[member[.nextAtom]]] call[component.addAtom, parameter[member[.nextAtom]]] local_variable[type[QueryArgument], args] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isVar, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=find, postfix_operators=[], prefix_operators=[], qualifier=unionFind, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getArguments, postfix_operators=[], prefix_operators=[], qualifier=nextAtom, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryArgument, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=args2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryArgument, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isVar, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=args2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=find, postfix_operators=[], prefix_operators=[], qualifier=unionFind, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getArguments, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryArgument, sub_type=None))), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=args2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=args, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAtom, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=atoms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryAtom, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=atoms, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAtoms, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=atom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryAtom, sub_type=None))), label=None) call[components.add, parameter[member[.component]]] end[}] return[member[.components]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[QueryAtomGroupImpl] operator[>] identifier[findComponents] operator[SEP] identifier[QueryAtomGroupImpl] identifier[group] operator[SEP] { identifier[List] operator[<] identifier[QueryAtom] operator[>] identifier[atoms] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[atoms] operator[SEP] identifier[addAll] operator[SEP] identifier[group] operator[SEP] identifier[getAtoms] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[QueryAtomGroupImpl] operator[>] identifier[components] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[atoms] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[components] operator[SEP] identifier[add] operator[SEP] identifier[group] operator[SEP] operator[SEP] Keyword[return] identifier[components] operator[SEP] } identifier[QueryAtomGroupImpl] identifier[component] operator[=] Keyword[new] identifier[QueryAtomGroupImpl] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[QueryAtom] identifier[atom] operator[:] identifier[atoms] operator[SEP] { Keyword[boolean] identifier[noVar] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[QueryArgument] identifier[arg] operator[:] identifier[atom] operator[SEP] identifier[getArguments] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[isVar] operator[SEP] operator[SEP] operator[SEP] { identifier[noVar] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[noVar] operator[SEP] { identifier[component] operator[SEP] identifier[addAtom] operator[SEP] identifier[atom] operator[SEP] operator[SEP] } } identifier[component] operator[SEP] identifier[getAtoms] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[atoms] operator[::] identifier[remove] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[component] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[components] operator[SEP] identifier[add] operator[SEP] identifier[component] operator[SEP] operator[SEP] } identifier[UnionFind] operator[<] identifier[QueryArgument] operator[>] identifier[unionFind] operator[=] Keyword[new] identifier[UnionFind] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[QueryAtom] identifier[atom] operator[:] identifier[atoms] operator[SEP] { identifier[QueryArgument] identifier[firstVar] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[QueryArgument] identifier[arg] operator[:] identifier[atom] operator[SEP] identifier[getArguments] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[isVar] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[firstVar] operator[==] Other[null] operator[SEP] { identifier[firstVar] operator[=] identifier[arg] operator[SEP] } Keyword[else] { identifier[unionFind] operator[SEP] identifier[union] operator[SEP] identifier[firstVar] , identifier[arg] operator[SEP] operator[SEP] } } } } Keyword[while] operator[SEP] operator[!] identifier[atoms] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[component] operator[=] Keyword[new] identifier[QueryAtomGroupImpl] operator[SEP] operator[SEP] operator[SEP] identifier[QueryAtom] identifier[nextAtom] operator[=] identifier[atoms] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[atoms] operator[SEP] identifier[remove] operator[SEP] identifier[nextAtom] operator[SEP] operator[SEP] identifier[component] operator[SEP] identifier[addAtom] operator[SEP] identifier[nextAtom] operator[SEP] operator[SEP] identifier[QueryArgument] identifier[args] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[QueryArgument] identifier[arg] operator[:] identifier[nextAtom] operator[SEP] identifier[getArguments] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[isVar] operator[SEP] operator[SEP] operator[SEP] { identifier[args] operator[=] identifier[unionFind] operator[SEP] identifier[find] operator[SEP] identifier[arg] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[for] operator[SEP] identifier[QueryAtom] identifier[atom] operator[:] identifier[atoms] operator[SEP] { identifier[QueryArgument] identifier[args2] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[QueryArgument] identifier[arg] operator[:] identifier[atom] operator[SEP] identifier[getArguments] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[isVar] operator[SEP] operator[SEP] operator[SEP] { identifier[args2] operator[=] identifier[unionFind] operator[SEP] identifier[find] operator[SEP] identifier[arg] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[equals] operator[SEP] identifier[args2] operator[SEP] operator[SEP] { identifier[component] operator[SEP] identifier[addAtom] operator[SEP] identifier[atom] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[QueryAtom] identifier[atom] operator[:] identifier[component] operator[SEP] identifier[getAtoms] operator[SEP] operator[SEP] operator[SEP] { identifier[atoms] operator[SEP] identifier[remove] operator[SEP] identifier[atom] operator[SEP] operator[SEP] } identifier[components] operator[SEP] identifier[add] operator[SEP] identifier[component] operator[SEP] operator[SEP] } Keyword[return] identifier[components] operator[SEP] }
DataDescriptor makeAssociatedField(int bitWidth) { DataDescriptor assDD = new DataDescriptor(); assDD.name = name + "_associated_field"; assDD.units = ""; assDD.refVal = 0; assDD.scale = 0; assDD.bitWidth = bitWidth; assDD.type = 0; assDD.f = 0; assDD.x = 31; assDD.y = 22; assDD.fxy = (short) ((f << 14) + (x << 8) + (y)); return assDD; }
class class_name[name] begin[{] method[makeAssociatedField, return_type[type[DataDescriptor]], modifier[default], parameter[bitWidth]] begin[{] local_variable[type[DataDescriptor], assDD] assign[member[assDD.name], binary_operation[member[.name], +, literal["_associated_field"]]] assign[member[assDD.units], literal[""]] assign[member[assDD.refVal], literal[0]] assign[member[assDD.scale], literal[0]] assign[member[assDD.bitWidth], member[.bitWidth]] assign[member[assDD.type], literal[0]] assign[member[assDD.f], literal[0]] assign[member[assDD.x], literal[31]] assign[member[assDD.y], literal[22]] assign[member[assDD.fxy], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=14), operator=<<), operandr=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=+), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), type=BasicType(dimensions=[], name=short))] return[member[.assDD]] end[}] END[}]
identifier[DataDescriptor] identifier[makeAssociatedField] operator[SEP] Keyword[int] identifier[bitWidth] operator[SEP] { identifier[DataDescriptor] identifier[assDD] operator[=] Keyword[new] identifier[DataDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[assDD] operator[SEP] identifier[name] operator[=] identifier[name] operator[+] literal[String] operator[SEP] identifier[assDD] operator[SEP] identifier[units] operator[=] literal[String] operator[SEP] identifier[assDD] operator[SEP] identifier[refVal] operator[=] Other[0] operator[SEP] identifier[assDD] operator[SEP] identifier[scale] operator[=] Other[0] operator[SEP] identifier[assDD] operator[SEP] identifier[bitWidth] operator[=] identifier[bitWidth] operator[SEP] identifier[assDD] operator[SEP] identifier[type] operator[=] Other[0] operator[SEP] identifier[assDD] operator[SEP] identifier[f] operator[=] Other[0] operator[SEP] identifier[assDD] operator[SEP] identifier[x] operator[=] Other[31] operator[SEP] identifier[assDD] operator[SEP] identifier[y] operator[=] Other[22] operator[SEP] identifier[assDD] operator[SEP] identifier[fxy] operator[=] operator[SEP] Keyword[short] operator[SEP] operator[SEP] operator[SEP] identifier[f] operator[<<] Other[14] operator[SEP] operator[+] operator[SEP] identifier[x] operator[<<] Other[8] operator[SEP] operator[+] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[assDD] operator[SEP] }
public static Authenticator buildAuthenticatorWithTruststore(final String keystorePath, final char[] keystorePassword, final List<String> keyids) { if (keystorePath != null) { final File file = new File(keystorePath); if (file.exists()) { try (final FileInputStream fis = new FileInputStream(file)) { final KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); ks.load(fis, keystorePassword); final List<String> keyIds = filterKeyIds(ks, keyids); switch (keyIds.size()) { case 0: LOGGER.warn("No valid key ids provided! Skipping keystore: {}", keystorePath); return null; case 1: return new JwtAuthenticator(ks.getCertificate(keyIds.get(0)).getPublicKey()); default: return new FederatedJwtAuthenticator(ks, keyIds); } } catch (final IOException | CertificateException | NoSuchAlgorithmException | KeyStoreException ex) { LOGGER.error("Error reading keystore: {}", ex.getMessage()); LOGGER.warn("Ignoring JWT authenticator with keystore: {}", keystorePath); } } } return null; }
class class_name[name] begin[{] method[buildAuthenticatorWithTruststore, return_type[type[Authenticator]], modifier[public static], parameter[keystorePath, keystorePassword, keyids]] begin[{] if[binary_operation[member[.keystorePath], !=, literal[null]]] begin[{] local_variable[type[File], file] if[call[file.exists, parameter[]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDefaultType, postfix_operators=[], prefix_operators=[], qualifier=KeyStore, selectors=[], type_arguments=None)], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=KeyStore, selectors=[], type_arguments=None), name=ks)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=KeyStore, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keystorePassword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=ks, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keyids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=filterKeyIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=keyIds)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No valid key ids provided! Skipping keystore: {}"), MemberReference(member=keystorePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=keyIds, selectors=[], type_arguments=None)], member=getCertificate, postfix_operators=[], prefix_operators=[], qualifier=ks, selectors=[MethodInvocation(arguments=[], member=getPublicKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JwtAuthenticator, sub_type=None)), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=ks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keyIds, 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=FederatedJwtAuthenticator, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=keyIds, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error reading keystore: {}"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)], member=error, 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="Ignoring JWT authenticator with keystore: {}"), MemberReference(member=keystorePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException', 'CertificateException', 'NoSuchAlgorithmException', 'KeyStoreException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=fis, type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=file, 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=FileInputStream, sub_type=None)))]) else begin[{] None end[}] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Authenticator] identifier[buildAuthenticatorWithTruststore] operator[SEP] Keyword[final] identifier[String] identifier[keystorePath] , Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[keystorePassword] , Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[keyids] operator[SEP] { Keyword[if] operator[SEP] identifier[keystorePath] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[keystorePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] operator[SEP] Keyword[final] identifier[FileInputStream] identifier[fis] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] { Keyword[final] identifier[KeyStore] identifier[ks] operator[=] identifier[KeyStore] operator[SEP] identifier[getInstance] operator[SEP] identifier[KeyStore] operator[SEP] identifier[getDefaultType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ks] operator[SEP] identifier[load] operator[SEP] identifier[fis] , identifier[keystorePassword] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[keyIds] operator[=] identifier[filterKeyIds] operator[SEP] identifier[ks] , identifier[keyids] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[keyIds] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] Other[0] operator[:] identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[keystorePath] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[case] Other[1] operator[:] Keyword[return] Keyword[new] identifier[JwtAuthenticator] operator[SEP] identifier[ks] operator[SEP] identifier[getCertificate] operator[SEP] identifier[keyIds] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[getPublicKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[return] Keyword[new] identifier[FederatedJwtAuthenticator] operator[SEP] identifier[ks] , identifier[keyIds] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] operator[|] identifier[CertificateException] operator[|] identifier[NoSuchAlgorithmException] operator[|] identifier[KeyStoreException] identifier[ex] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[keystorePath] operator[SEP] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
public <T, K> T get(ColumnFamily<K, String> columnFamily, K id, Class<T> itemClass) throws Exception { Mapping<T> mapping = getMapping(itemClass); ColumnList<String> result = keyspace.prepareQuery(columnFamily) .getKey(id).execute().getResult(); return mapping.newInstance(result); }
class class_name[name] begin[{] method[get, return_type[type[T]], modifier[public], parameter[columnFamily, id, itemClass]] begin[{] local_variable[type[Mapping], mapping] local_variable[type[ColumnList], result] return[call[mapping.newInstance, parameter[member[.result]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] , identifier[K] operator[>] identifier[T] identifier[get] operator[SEP] identifier[ColumnFamily] operator[<] identifier[K] , identifier[String] operator[>] identifier[columnFamily] , identifier[K] identifier[id] , identifier[Class] operator[<] identifier[T] operator[>] identifier[itemClass] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Mapping] operator[<] identifier[T] operator[>] identifier[mapping] operator[=] identifier[getMapping] operator[SEP] identifier[itemClass] operator[SEP] operator[SEP] identifier[ColumnList] operator[<] identifier[String] operator[>] identifier[result] operator[=] identifier[keyspace] operator[SEP] identifier[prepareQuery] operator[SEP] identifier[columnFamily] operator[SEP] operator[SEP] identifier[getKey] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[mapping] operator[SEP] identifier[newInstance] operator[SEP] identifier[result] operator[SEP] operator[SEP] }
@Override public int getBondOrderSum() { int sum = 0; for (int i = 0; i < getBondCount(); i++) { IBond.Order order = getBond(i).getOrder(); if (order != null) { sum += order.numeric(); } } return sum; }
class class_name[name] begin[{] method[getBondOrderSum, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[int], sum] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getOrder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=order)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=ReferenceType(arguments=None, dimensions=None, name=Order, sub_type=None))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=order, 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=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=numeric, postfix_operators=[], prefix_operators=[], qualifier=order, selectors=[], type_arguments=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getBondCount, postfix_operators=[], prefix_operators=[], qualifier=, 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[.sum]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[getBondOrderSum] operator[SEP] operator[SEP] { Keyword[int] identifier[sum] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[getBondCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[IBond] operator[SEP] identifier[Order] identifier[order] operator[=] identifier[getBond] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[order] operator[!=] Other[null] operator[SEP] { identifier[sum] operator[+=] identifier[order] operator[SEP] identifier[numeric] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[sum] operator[SEP] }
private static void calculateAndPrintIndicators(String[] args, boolean normalize) throws FileNotFoundException { Front referenceFront = new ArrayFront(args[1]); Front front = new ArrayFront(args[2]); if (normalize) { FrontNormalizer frontNormalizer = new FrontNormalizer(referenceFront); referenceFront = frontNormalizer.normalize(referenceFront); front = frontNormalizer.normalize(front); JMetalLogger.logger.info("The fronts are NORMALIZED before computing the indicators"); ; } else { JMetalLogger.logger.info("The fronts are NOT NORMALIZED before computing the indicators") ; } List<QualityIndicator<List<PointSolution>, Double>> indicatorList = getAvailableIndicators(referenceFront); if (!args[0].equals("ALL")) { QualityIndicator<List<PointSolution>, Double> indicator = getIndicatorFromName( args[0], indicatorList); System.out.println(indicator.evaluate(FrontUtils.convertFrontToSolutionList(front))); } else { for (QualityIndicator<List<PointSolution>, Double> indicator : indicatorList) { System.out.println(indicator.getName() + ": " + indicator.evaluate(FrontUtils.convertFrontToSolutionList(front))); } SetCoverage sc = new SetCoverage() ; JMetalLogger.logger.info("SC(refPF, front): " + sc.evaluate( FrontUtils.convertFrontToSolutionList(referenceFront), FrontUtils.convertFrontToSolutionList(front))) ; JMetalLogger.logger.info("SC(front, refPF): " + sc.evaluate( FrontUtils.convertFrontToSolutionList(front), FrontUtils.convertFrontToSolutionList(referenceFront))) ; } }
class class_name[name] begin[{] method[calculateAndPrintIndicators, return_type[void], modifier[private static], parameter[args, normalize]] begin[{] local_variable[type[Front], referenceFront] local_variable[type[Front], front] if[member[.normalize]] begin[{] local_variable[type[FrontNormalizer], frontNormalizer] assign[member[.referenceFront], call[frontNormalizer.normalize, parameter[member[.referenceFront]]]] assign[member[.front], call[frontNormalizer.normalize, parameter[member[.front]]]] call[JMetalLogger.logger.info, parameter[literal["The fronts are NORMALIZED before computing the indicators"]]] Statement(label=None) else begin[{] call[JMetalLogger.logger.info, parameter[literal["The fronts are NOT NORMALIZED before computing the indicators"]]] end[}] local_variable[type[List], indicatorList] if[member[.args]] begin[{] local_variable[type[QualityIndicator], indicator] call[System.out.println, parameter[call[indicator.evaluate, parameter[call[FrontUtils.convertFrontToSolutionList, parameter[member[.front]]]]]]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=indicator, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=front, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertFrontToSolutionList, postfix_operators=[], prefix_operators=[], qualifier=FrontUtils, selectors=[], type_arguments=None)], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=indicator, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=indicatorList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=indicator)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PointSolution, sub_type=None))], dimensions=[], name=List, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))], dimensions=[], name=QualityIndicator, sub_type=None))), label=None) local_variable[type[SetCoverage], sc] call[JMetalLogger.logger.info, parameter[binary_operation[literal["SC(refPF, front): "], +, call[sc.evaluate, parameter[call[FrontUtils.convertFrontToSolutionList, parameter[member[.referenceFront]]], call[FrontUtils.convertFrontToSolutionList, parameter[member[.front]]]]]]]] call[JMetalLogger.logger.info, parameter[binary_operation[literal["SC(front, refPF): "], +, call[sc.evaluate, parameter[call[FrontUtils.convertFrontToSolutionList, parameter[member[.front]]], call[FrontUtils.convertFrontToSolutionList, parameter[member[.referenceFront]]]]]]]] end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[calculateAndPrintIndicators] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] , Keyword[boolean] identifier[normalize] operator[SEP] Keyword[throws] identifier[FileNotFoundException] { identifier[Front] identifier[referenceFront] operator[=] Keyword[new] identifier[ArrayFront] operator[SEP] identifier[args] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[Front] identifier[front] operator[=] Keyword[new] identifier[ArrayFront] operator[SEP] identifier[args] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[normalize] operator[SEP] { identifier[FrontNormalizer] identifier[frontNormalizer] operator[=] Keyword[new] identifier[FrontNormalizer] operator[SEP] identifier[referenceFront] operator[SEP] operator[SEP] identifier[referenceFront] operator[=] identifier[frontNormalizer] operator[SEP] identifier[normalize] operator[SEP] identifier[referenceFront] operator[SEP] operator[SEP] identifier[front] operator[=] identifier[frontNormalizer] operator[SEP] identifier[normalize] operator[SEP] identifier[front] operator[SEP] operator[SEP] identifier[JMetalLogger] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[JMetalLogger] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[QualityIndicator] operator[<] identifier[List] operator[<] identifier[PointSolution] operator[>] , identifier[Double] operator[>] operator[>] identifier[indicatorList] operator[=] identifier[getAvailableIndicators] operator[SEP] identifier[referenceFront] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[QualityIndicator] operator[<] identifier[List] operator[<] identifier[PointSolution] operator[>] , identifier[Double] operator[>] identifier[indicator] operator[=] identifier[getIndicatorFromName] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] , identifier[indicatorList] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[indicator] operator[SEP] identifier[evaluate] operator[SEP] identifier[FrontUtils] operator[SEP] identifier[convertFrontToSolutionList] operator[SEP] identifier[front] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] identifier[QualityIndicator] operator[<] identifier[List] operator[<] identifier[PointSolution] operator[>] , identifier[Double] operator[>] identifier[indicator] operator[:] identifier[indicatorList] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[indicator] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[indicator] operator[SEP] identifier[evaluate] operator[SEP] identifier[FrontUtils] operator[SEP] identifier[convertFrontToSolutionList] operator[SEP] identifier[front] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[SetCoverage] identifier[sc] operator[=] Keyword[new] identifier[SetCoverage] operator[SEP] operator[SEP] operator[SEP] identifier[JMetalLogger] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[sc] operator[SEP] identifier[evaluate] operator[SEP] identifier[FrontUtils] operator[SEP] identifier[convertFrontToSolutionList] operator[SEP] identifier[referenceFront] operator[SEP] , identifier[FrontUtils] operator[SEP] identifier[convertFrontToSolutionList] operator[SEP] identifier[front] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[JMetalLogger] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[sc] operator[SEP] identifier[evaluate] operator[SEP] identifier[FrontUtils] operator[SEP] identifier[convertFrontToSolutionList] operator[SEP] identifier[front] operator[SEP] , identifier[FrontUtils] operator[SEP] identifier[convertFrontToSolutionList] operator[SEP] identifier[referenceFront] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public final EObject ruleXOtherOperatorExpression() throws RecognitionException { EObject current = null; EObject this_XAdditiveExpression_0 = null; EObject lv_rightOperand_3_0 = null; enterRule(); try { // InternalXbaseWithAnnotations.g:1373:2: ( (this_XAdditiveExpression_0= ruleXAdditiveExpression ( ( ( ( () ( ( ruleOpOther ) ) ) )=> ( () ( ( ruleOpOther ) ) ) ) ( (lv_rightOperand_3_0= ruleXAdditiveExpression ) ) )* ) ) // InternalXbaseWithAnnotations.g:1374:2: (this_XAdditiveExpression_0= ruleXAdditiveExpression ( ( ( ( () ( ( ruleOpOther ) ) ) )=> ( () ( ( ruleOpOther ) ) ) ) ( (lv_rightOperand_3_0= ruleXAdditiveExpression ) ) )* ) { // InternalXbaseWithAnnotations.g:1374:2: (this_XAdditiveExpression_0= ruleXAdditiveExpression ( ( ( ( () ( ( ruleOpOther ) ) ) )=> ( () ( ( ruleOpOther ) ) ) ) ( (lv_rightOperand_3_0= ruleXAdditiveExpression ) ) )* ) // InternalXbaseWithAnnotations.g:1375:3: this_XAdditiveExpression_0= ruleXAdditiveExpression ( ( ( ( () ( ( ruleOpOther ) ) ) )=> ( () ( ( ruleOpOther ) ) ) ) ( (lv_rightOperand_3_0= ruleXAdditiveExpression ) ) )* { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXOtherOperatorExpressionAccess().getXAdditiveExpressionParserRuleCall_0()); } pushFollow(FOLLOW_23); this_XAdditiveExpression_0=ruleXAdditiveExpression(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { current = this_XAdditiveExpression_0; afterParserOrEnumRuleCall(); } // InternalXbaseWithAnnotations.g:1383:3: ( ( ( ( () ( ( ruleOpOther ) ) ) )=> ( () ( ( ruleOpOther ) ) ) ) ( (lv_rightOperand_3_0= ruleXAdditiveExpression ) ) )* loop23: do { int alt23=2; alt23 = dfa23.predict(input); switch (alt23) { case 1 : // InternalXbaseWithAnnotations.g:1384:4: ( ( ( () ( ( ruleOpOther ) ) ) )=> ( () ( ( ruleOpOther ) ) ) ) ( (lv_rightOperand_3_0= ruleXAdditiveExpression ) ) { // InternalXbaseWithAnnotations.g:1384:4: ( ( ( () ( ( ruleOpOther ) ) ) )=> ( () ( ( ruleOpOther ) ) ) ) // InternalXbaseWithAnnotations.g:1385:5: ( ( () ( ( ruleOpOther ) ) ) )=> ( () ( ( ruleOpOther ) ) ) { // InternalXbaseWithAnnotations.g:1395:5: ( () ( ( ruleOpOther ) ) ) // InternalXbaseWithAnnotations.g:1396:6: () ( ( ruleOpOther ) ) { // InternalXbaseWithAnnotations.g:1396:6: () // InternalXbaseWithAnnotations.g:1397:7: { if ( state.backtracking==0 ) { current = forceCreateModelElementAndSet( grammarAccess.getXOtherOperatorExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0(), current); } } // InternalXbaseWithAnnotations.g:1403:6: ( ( ruleOpOther ) ) // InternalXbaseWithAnnotations.g:1404:7: ( ruleOpOther ) { // InternalXbaseWithAnnotations.g:1404:7: ( ruleOpOther ) // InternalXbaseWithAnnotations.g:1405:8: ruleOpOther { if ( state.backtracking==0 ) { if (current==null) { current = createModelElement(grammarAccess.getXOtherOperatorExpressionRule()); } } if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXOtherOperatorExpressionAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0()); } pushFollow(FOLLOW_9); ruleOpOther(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { afterParserOrEnumRuleCall(); } } } } } // InternalXbaseWithAnnotations.g:1421:4: ( (lv_rightOperand_3_0= ruleXAdditiveExpression ) ) // InternalXbaseWithAnnotations.g:1422:5: (lv_rightOperand_3_0= ruleXAdditiveExpression ) { // InternalXbaseWithAnnotations.g:1422:5: (lv_rightOperand_3_0= ruleXAdditiveExpression ) // InternalXbaseWithAnnotations.g:1423:6: lv_rightOperand_3_0= ruleXAdditiveExpression { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXOtherOperatorExpressionAccess().getRightOperandXAdditiveExpressionParserRuleCall_1_1_0()); } pushFollow(FOLLOW_23); lv_rightOperand_3_0=ruleXAdditiveExpression(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getXOtherOperatorExpressionRule()); } set( current, "rightOperand", lv_rightOperand_3_0, "org.eclipse.xtext.xbase.Xbase.XAdditiveExpression"); afterParserOrEnumRuleCall(); } } } } break; default : break loop23; } } while (true); } } if ( state.backtracking==0 ) { leaveRule(); } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; }
class class_name[name] begin[{] method[ruleXOtherOperatorExpression, return_type[type[EObject]], modifier[final public], parameter[]] begin[{] local_variable[type[EObject], current] local_variable[type[EObject], this_XAdditiveExpression_0] local_variable[type[EObject], lv_rightOperand_3_0] call[.enterRule, parameter[]] TryStatement(block=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXOtherOperatorExpressionAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getXAdditiveExpressionParserRuleCall_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newCompositeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_23, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=this_XAdditiveExpression_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=ruleXAdditiveExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=this_XAdditiveExpression_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=afterParserOrEnumRuleCall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), DoStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt23)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt23, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=predict, postfix_operators=[], prefix_operators=[], qualifier=dfa23, selectors=[], type_arguments=None)), label=None), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXOtherOperatorExpressionAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getXBinaryOperationLeftOperandAction_1_0_0_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forceCreateModelElementAndSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]))]), BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=current, 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=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXOtherOperatorExpressionRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=createModelElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXOtherOperatorExpressionAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newCompositeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_9, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=ruleOpOther, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=afterParserOrEnumRuleCall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])])])]), BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXOtherOperatorExpressionAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getRightOperandXAdditiveExpressionParserRuleCall_1_1_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newCompositeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_23, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lv_rightOperand_3_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=ruleXAdditiveExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=current, 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=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXOtherOperatorExpressionRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=createModelElementForParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rightOperand"), MemberReference(member=lv_rightOperand_3_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.eclipse.xtext.xbase.Xbase.XAdditiveExpression")], member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=afterParserOrEnumRuleCall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])])]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=loop23, label=None)])], expression=MemberReference(member=alt23, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=loop23)])]), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=leaveRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=appendSkippedTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None) return[member[.current]] end[}] END[}]
Keyword[public] Keyword[final] identifier[EObject] identifier[ruleXOtherOperatorExpression] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { identifier[EObject] identifier[current] operator[=] Other[null] operator[SEP] identifier[EObject] identifier[this_XAdditiveExpression_0] operator[=] Other[null] operator[SEP] identifier[EObject] identifier[lv_rightOperand_3_0] operator[=] Other[null] operator[SEP] identifier[enterRule] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { { { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[newCompositeNode] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXOtherOperatorExpressionAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getXAdditiveExpressionParserRuleCall_0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pushFollow] operator[SEP] identifier[FOLLOW_23] operator[SEP] operator[SEP] identifier[this_XAdditiveExpression_0] operator[=] identifier[ruleXAdditiveExpression] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[current] operator[=] identifier[this_XAdditiveExpression_0] operator[SEP] identifier[afterParserOrEnumRuleCall] operator[SEP] operator[SEP] operator[SEP] } identifier[loop23] operator[:] Keyword[do] { Keyword[int] identifier[alt23] operator[=] Other[2] operator[SEP] identifier[alt23] operator[=] identifier[dfa23] operator[SEP] identifier[predict] operator[SEP] identifier[input] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[alt23] operator[SEP] { Keyword[case] Other[1] operator[:] { { { { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[current] operator[=] identifier[forceCreateModelElementAndSet] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXOtherOperatorExpressionAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getXBinaryOperationLeftOperandAction_1_0_0_0] operator[SEP] operator[SEP] , identifier[current] operator[SEP] operator[SEP] } } { { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[current] operator[==] Other[null] operator[SEP] { identifier[current] operator[=] identifier[createModelElement] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXOtherOperatorExpressionRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[newCompositeNode] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXOtherOperatorExpressionAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getFeatureJvmIdentifiableElementCrossReference_1_0_0_1_0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pushFollow] operator[SEP] identifier[FOLLOW_9] operator[SEP] operator[SEP] identifier[ruleOpOther] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[afterParserOrEnumRuleCall] operator[SEP] operator[SEP] operator[SEP] } } } } } { { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[newCompositeNode] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXOtherOperatorExpressionAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getRightOperandXAdditiveExpressionParserRuleCall_1_1_0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pushFollow] operator[SEP] identifier[FOLLOW_23] operator[SEP] operator[SEP] identifier[lv_rightOperand_3_0] operator[=] identifier[ruleXAdditiveExpression] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[current] operator[==] Other[null] operator[SEP] { identifier[current] operator[=] identifier[createModelElementForParent] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXOtherOperatorExpressionRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[set] operator[SEP] identifier[current] , literal[String] , identifier[lv_rightOperand_3_0] , literal[String] operator[SEP] operator[SEP] identifier[afterParserOrEnumRuleCall] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] identifier[loop23] operator[SEP] } } Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[leaveRule] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[appendSkippedTokens] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { } Keyword[return] identifier[current] operator[SEP] }
protected void common_invalidate(Object key, boolean waitOnInvalidation, boolean checkPreInvalidationListener) { ValidateUtility.objectNotNull(key, "key"); cache.invalidateById(key, waitOnInvalidation, checkPreInvalidationListener); }
class class_name[name] begin[{] method[common_invalidate, return_type[void], modifier[protected], parameter[key, waitOnInvalidation, checkPreInvalidationListener]] begin[{] call[ValidateUtility.objectNotNull, parameter[member[.key], literal["key"]]] call[cache.invalidateById, parameter[member[.key], member[.waitOnInvalidation], member[.checkPreInvalidationListener]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[common_invalidate] operator[SEP] identifier[Object] identifier[key] , Keyword[boolean] identifier[waitOnInvalidation] , Keyword[boolean] identifier[checkPreInvalidationListener] operator[SEP] { identifier[ValidateUtility] operator[SEP] identifier[objectNotNull] operator[SEP] identifier[key] , literal[String] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[invalidateById] operator[SEP] identifier[key] , identifier[waitOnInvalidation] , identifier[checkPreInvalidationListener] operator[SEP] operator[SEP] }
@Override public boolean cancel(long taskId) throws Exception { StringBuilder update = new StringBuilder(87).append("UPDATE Task t SET t.STATES=") .append(TaskState.CANCELED.bit + TaskState.ENDED.bit) .append(",t.VERSION=t.VERSION+1 WHERE t.ID=:i AND t.STATES<") .append(TaskState.ENDED.bit); final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(this, tc, "cancel", taskId, update); EntityManager em = getPersistenceServiceUnit().createEntityManager(); try { Query query = em.createQuery(update.toString()); query.setParameter("i", taskId); boolean canceled = query.executeUpdate() > 0; if (trace && tc.isEntryEnabled()) Tr.exit(this, tc, "cancel", canceled); return canceled; } finally { em.close(); } }
class class_name[name] begin[{] method[cancel, return_type[type[boolean]], modifier[public], parameter[taskId]] begin[{] local_variable[type[StringBuilder], update] local_variable[type[boolean], trace] if[binary_operation[member[.trace], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[THIS[], member[.tc], literal["cancel"], member[.taskId], member[.update]]] else begin[{] None end[}] local_variable[type[EntityManager], em] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=update, selectors=[], type_arguments=None)], member=createQuery, postfix_operators=[], prefix_operators=[], qualifier=em, selectors=[], type_arguments=None), name=query)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Query, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="i"), MemberReference(member=taskId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParameter, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=executeUpdate, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), name=canceled)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=trace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cancel"), MemberReference(member=canceled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MemberReference(member=canceled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=em, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[cancel] operator[SEP] Keyword[long] identifier[taskId] operator[SEP] Keyword[throws] identifier[Exception] { identifier[StringBuilder] identifier[update] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[87] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[TaskState] operator[SEP] identifier[CANCELED] operator[SEP] identifier[bit] operator[+] identifier[TaskState] operator[SEP] identifier[ENDED] operator[SEP] identifier[bit] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[TaskState] operator[SEP] identifier[ENDED] operator[SEP] identifier[bit] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[trace] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[taskId] , identifier[update] operator[SEP] operator[SEP] identifier[EntityManager] identifier[em] operator[=] identifier[getPersistenceServiceUnit] operator[SEP] operator[SEP] operator[SEP] identifier[createEntityManager] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Query] identifier[query] operator[=] identifier[em] operator[SEP] identifier[createQuery] operator[SEP] identifier[update] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setParameter] operator[SEP] literal[String] , identifier[taskId] operator[SEP] operator[SEP] Keyword[boolean] identifier[canceled] operator[=] identifier[query] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[canceled] operator[SEP] operator[SEP] Keyword[return] identifier[canceled] operator[SEP] } Keyword[finally] { identifier[em] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
public ReplicatedServersConfig addNodeAddress(String... addresses) { for (String address : addresses) { nodeAddresses.add(URIBuilder.create(address)); } return this; }
class class_name[name] begin[{] method[addNodeAddress, return_type[type[ReplicatedServersConfig]], modifier[public], parameter[addresses]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=URIBuilder, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=nodeAddresses, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=addresses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=address)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ReplicatedServersConfig] identifier[addNodeAddress] operator[SEP] identifier[String] operator[...] identifier[addresses] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[address] operator[:] identifier[addresses] operator[SEP] { identifier[nodeAddresses] operator[SEP] identifier[add] operator[SEP] identifier[URIBuilder] operator[SEP] identifier[create] operator[SEP] identifier[address] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void importRtfDocumentIntoElement(Element elem, FileInputStream documentSource) throws IOException, DocumentException { importRtfDocumentIntoElement(elem, documentSource, null); }
class class_name[name] begin[{] method[importRtfDocumentIntoElement, return_type[void], modifier[public], parameter[elem, documentSource]] begin[{] call[.importRtfDocumentIntoElement, parameter[member[.elem], member[.documentSource], literal[null]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[importRtfDocumentIntoElement] operator[SEP] identifier[Element] identifier[elem] , identifier[FileInputStream] identifier[documentSource] operator[SEP] Keyword[throws] identifier[IOException] , identifier[DocumentException] { identifier[importRtfDocumentIntoElement] operator[SEP] identifier[elem] , identifier[documentSource] , Other[null] operator[SEP] operator[SEP] }
public static DeterministicKey deserializeB58(String base58, NetworkParameters params) { return deserializeB58(null, base58, params); }
class class_name[name] begin[{] method[deserializeB58, return_type[type[DeterministicKey]], modifier[public static], parameter[base58, params]] begin[{] return[call[.deserializeB58, parameter[literal[null], member[.base58], member[.params]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DeterministicKey] identifier[deserializeB58] operator[SEP] identifier[String] identifier[base58] , identifier[NetworkParameters] identifier[params] operator[SEP] { Keyword[return] identifier[deserializeB58] operator[SEP] Other[null] , identifier[base58] , identifier[params] operator[SEP] operator[SEP] }
public static void wipePS(ByteBuffer _in, ByteBuffer out, List<ByteBuffer> spsList, List<ByteBuffer> ppsList) { ByteBuffer dup = _in.duplicate(); while (dup.hasRemaining()) { ByteBuffer buf = H264Utils.nextNALUnit(dup); if (buf == null) break; NALUnit nu = NALUnit.read(buf.duplicate()); if (nu.type == NALUnitType.PPS) { if (ppsList != null) ppsList.add(NIOUtils.duplicate(buf)); } else if (nu.type == NALUnitType.SPS) { if (spsList != null) spsList.add(NIOUtils.duplicate(buf)); } else if (out != null) { out.putInt(1); out.put(buf); } } if (out != null) out.flip(); }
class class_name[name] begin[{] method[wipePS, return_type[void], modifier[public static], parameter[_in, out, spsList, ppsList]] begin[{] local_variable[type[ByteBuffer], dup] while[call[dup.hasRemaining, parameter[]]] begin[{] local_variable[type[ByteBuffer], buf] if[binary_operation[member[.buf], ==, literal[null]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[NALUnit], nu] if[binary_operation[member[nu.type], ==, member[NALUnitType.PPS]]] begin[{] if[binary_operation[member[.ppsList], !=, literal[null]]] begin[{] call[ppsList.add, parameter[call[NIOUtils.duplicate, parameter[member[.buf]]]]] else begin[{] None end[}] else begin[{] if[binary_operation[member[nu.type], ==, member[NALUnitType.SPS]]] begin[{] if[binary_operation[member[.spsList], !=, literal[null]]] begin[{] call[spsList.add, parameter[call[NIOUtils.duplicate, parameter[member[.buf]]]]] else begin[{] None end[}] else begin[{] if[binary_operation[member[.out], !=, literal[null]]] begin[{] call[out.putInt, parameter[literal[1]]] call[out.put, parameter[member[.buf]]] else begin[{] None end[}] end[}] end[}] end[}] if[binary_operation[member[.out], !=, literal[null]]] begin[{] call[out.flip, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[wipePS] operator[SEP] identifier[ByteBuffer] identifier[_in] , identifier[ByteBuffer] identifier[out] , identifier[List] operator[<] identifier[ByteBuffer] operator[>] identifier[spsList] , identifier[List] operator[<] identifier[ByteBuffer] operator[>] identifier[ppsList] operator[SEP] { identifier[ByteBuffer] identifier[dup] operator[=] identifier[_in] operator[SEP] identifier[duplicate] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[dup] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[SEP] { identifier[ByteBuffer] identifier[buf] operator[=] identifier[H264Utils] operator[SEP] identifier[nextNALUnit] operator[SEP] identifier[dup] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[buf] operator[==] Other[null] operator[SEP] Keyword[break] operator[SEP] identifier[NALUnit] identifier[nu] operator[=] identifier[NALUnit] operator[SEP] identifier[read] operator[SEP] identifier[buf] operator[SEP] identifier[duplicate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nu] operator[SEP] identifier[type] operator[==] identifier[NALUnitType] operator[SEP] identifier[PPS] operator[SEP] { Keyword[if] operator[SEP] identifier[ppsList] operator[!=] Other[null] operator[SEP] identifier[ppsList] operator[SEP] identifier[add] operator[SEP] identifier[NIOUtils] operator[SEP] identifier[duplicate] operator[SEP] identifier[buf] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[nu] operator[SEP] identifier[type] operator[==] identifier[NALUnitType] operator[SEP] identifier[SPS] operator[SEP] { Keyword[if] operator[SEP] identifier[spsList] operator[!=] Other[null] operator[SEP] identifier[spsList] operator[SEP] identifier[add] operator[SEP] identifier[NIOUtils] operator[SEP] identifier[duplicate] operator[SEP] identifier[buf] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[out] operator[!=] Other[null] operator[SEP] { identifier[out] operator[SEP] identifier[putInt] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[put] operator[SEP] identifier[buf] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[out] operator[!=] Other[null] operator[SEP] identifier[out] operator[SEP] identifier[flip] operator[SEP] operator[SEP] operator[SEP] }
public static Integer getInteger(String name, Integer def, Level logLevel) { String v = getString(name); if (v != null) { try { return Integer.decode(v); } catch (NumberFormatException e) { // Ignore, fallback to default if (LOGGER.isLoggable(logLevel)) { LOGGER.log(logLevel, "Property. Value is not integer: {0} => {1}", new Object[] {name, v}); } } } return def; }
class class_name[name] begin[{] method[getInteger, return_type[type[Integer]], modifier[public static], parameter[name, def, logLevel]] begin[{] local_variable[type[String], v] if[binary_operation[member[.v], !=, literal[null]]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decode, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=logLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=logLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Property. Value is not integer: {0} => {1}"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=v, 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=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.def]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Integer] identifier[getInteger] operator[SEP] identifier[String] identifier[name] , identifier[Integer] identifier[def] , identifier[Level] identifier[logLevel] operator[SEP] { identifier[String] identifier[v] operator[=] identifier[getString] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[return] identifier[Integer] operator[SEP] identifier[decode] operator[SEP] identifier[v] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isLoggable] operator[SEP] identifier[logLevel] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[logLevel] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[name] , identifier[v] } operator[SEP] operator[SEP] } } } Keyword[return] identifier[def] operator[SEP] }