code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public final GraphIterationElement<ST, PT> nextElement() { if (!this.courseModel.isEmpty()) { final GraphIterationElement<ST, PT> theElement = this.courseModel.removeNextIterationElement(); if (theElement != null) { final List<GraphIterationElement<ST, PT>> list = getNextSegments(true, theElement); final Iterator<GraphIterationElement<ST, PT>> iterator; boolean hasFollowingSegments = false; GraphIterationElement<ST, PT> elt; if (this.courseModel.isReversedRestitution()) { iterator = new ReverseIterator<>(list); } else { iterator = list.iterator(); } while (iterator.hasNext()) { elt = iterator.next(); if (canGotoIntoElement(elt)) { hasFollowingSegments = true; this.courseModel.addIterationElement(elt); if (!this.allowManyReplies) { this.visited.add(elt); } } } theElement.setTerminalSegment(!hasFollowingSegments); theElement.replied = true; this.current = theElement; return this.current; } } clear(); throw new NoSuchElementException(); }
class class_name[name] begin[{] method[nextElement, return_type[type[GraphIterationElement]], modifier[final public], parameter[]] begin[{] if[THIS[member[None.courseModel]call[None.isEmpty, parameter[]]]] begin[{] local_variable[type[GraphIterationElement], theElement] if[binary_operation[member[.theElement], !=, literal[null]]] begin[{] local_variable[type[List], list] local_variable[type[Iterator], iterator] local_variable[type[boolean], hasFollowingSegments] local_variable[type[GraphIterationElement], elt] if[THIS[member[None.courseModel]call[None.isReversedRestitution, parameter[]]]] begin[{] assign[member[.iterator], ClassCreator(arguments=[MemberReference(member=list, 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=ReverseIterator, sub_type=None))] else begin[{] assign[member[.iterator], call[list.iterator, parameter[]]] end[}] while[call[iterator.hasNext, parameter[]]] begin[{] assign[member[.elt], call[iterator.next, parameter[]]] if[call[.canGotoIntoElement, parameter[member[.elt]]]] begin[{] assign[member[.hasFollowingSegments], literal[true]] THIS[member[None.courseModel]call[None.addIterationElement, parameter[member[.elt]]]] if[THIS[member[None.allowManyReplies]]] begin[{] THIS[member[None.visited]call[None.add, parameter[member[.elt]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] call[theElement.setTerminalSegment, parameter[member[.hasFollowingSegments]]] assign[member[theElement.replied], literal[true]] assign[THIS[member[None.current]], member[.theElement]] return[THIS[member[None.current]]] else begin[{] None end[}] else begin[{] None end[}] call[.clear, parameter[]] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchElementException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[final] identifier[GraphIterationElement] operator[<] identifier[ST] , identifier[PT] operator[>] identifier[nextElement] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[courseModel] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[GraphIterationElement] operator[<] identifier[ST] , identifier[PT] operator[>] identifier[theElement] operator[=] Keyword[this] operator[SEP] identifier[courseModel] operator[SEP] identifier[removeNextIterationElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[theElement] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[GraphIterationElement] operator[<] identifier[ST] , identifier[PT] operator[>] operator[>] identifier[list] operator[=] identifier[getNextSegments] operator[SEP] literal[boolean] , identifier[theElement] operator[SEP] operator[SEP] Keyword[final] identifier[Iterator] operator[<] identifier[GraphIterationElement] operator[<] identifier[ST] , identifier[PT] operator[>] operator[>] identifier[iterator] operator[SEP] Keyword[boolean] identifier[hasFollowingSegments] operator[=] literal[boolean] operator[SEP] identifier[GraphIterationElement] operator[<] identifier[ST] , identifier[PT] operator[>] identifier[elt] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[courseModel] operator[SEP] identifier[isReversedRestitution] operator[SEP] operator[SEP] operator[SEP] { identifier[iterator] operator[=] Keyword[new] identifier[ReverseIterator] operator[<] operator[>] operator[SEP] identifier[list] operator[SEP] operator[SEP] } Keyword[else] { identifier[iterator] operator[=] identifier[list] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[elt] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[canGotoIntoElement] operator[SEP] identifier[elt] operator[SEP] operator[SEP] { identifier[hasFollowingSegments] operator[=] literal[boolean] operator[SEP] Keyword[this] operator[SEP] identifier[courseModel] operator[SEP] identifier[addIterationElement] operator[SEP] identifier[elt] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[allowManyReplies] operator[SEP] { Keyword[this] operator[SEP] identifier[visited] operator[SEP] identifier[add] operator[SEP] identifier[elt] operator[SEP] operator[SEP] } } } identifier[theElement] operator[SEP] identifier[setTerminalSegment] operator[SEP] operator[!] identifier[hasFollowingSegments] operator[SEP] operator[SEP] identifier[theElement] operator[SEP] identifier[replied] operator[=] literal[boolean] operator[SEP] Keyword[this] operator[SEP] identifier[current] operator[=] identifier[theElement] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[current] operator[SEP] } } identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NoSuchElementException] operator[SEP] operator[SEP] operator[SEP] }
@Nullable public static XMLGregorianCalendar getXMLCalendarDate (@Nullable final LocalDate aBase) { if (aBase == null) return null; return s_aDTFactory.newXMLGregorianCalendarDate (aBase.getYear (), aBase.getMonth ().getValue (), aBase.getDayOfMonth (), DatatypeConstants.FIELD_UNDEFINED); }
class class_name[name] begin[{] method[getXMLCalendarDate, return_type[type[XMLGregorianCalendar]], modifier[public static], parameter[aBase]] begin[{] if[binary_operation[member[.aBase], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[s_aDTFactory.newXMLGregorianCalendarDate, parameter[call[aBase.getYear, parameter[]], call[aBase.getMonth, parameter[]], call[aBase.getDayOfMonth, parameter[]], member[DatatypeConstants.FIELD_UNDEFINED]]]] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[XMLGregorianCalendar] identifier[getXMLCalendarDate] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[LocalDate] identifier[aBase] operator[SEP] { Keyword[if] operator[SEP] identifier[aBase] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] identifier[s_aDTFactory] operator[SEP] identifier[newXMLGregorianCalendarDate] operator[SEP] identifier[aBase] operator[SEP] identifier[getYear] operator[SEP] operator[SEP] , identifier[aBase] operator[SEP] identifier[getMonth] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[aBase] operator[SEP] identifier[getDayOfMonth] operator[SEP] operator[SEP] , identifier[DatatypeConstants] operator[SEP] identifier[FIELD_UNDEFINED] operator[SEP] operator[SEP] }
public static StringLessThanOrEqualCondition.Builder lte(String variable, String expectedValue) { return StringLessThanOrEqualCondition.builder().variable(variable).expectedValue(expectedValue); }
class class_name[name] begin[{] method[lte, return_type[type[StringLessThanOrEqualCondition]], modifier[public static], parameter[variable, expectedValue]] begin[{] return[call[StringLessThanOrEqualCondition.builder, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[StringLessThanOrEqualCondition] operator[SEP] identifier[Builder] identifier[lte] operator[SEP] identifier[String] identifier[variable] , identifier[String] identifier[expectedValue] operator[SEP] { Keyword[return] identifier[StringLessThanOrEqualCondition] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[variable] operator[SEP] identifier[variable] operator[SEP] operator[SEP] identifier[expectedValue] operator[SEP] identifier[expectedValue] operator[SEP] operator[SEP] }
public Class<? extends org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor> bindIParseTreeConstructor() { return org.eclipse.xtext.generator.parser.antlr.debug.parseTreeConstruction.SimpleAntlrParsetreeConstructor.class; }
class class_name[name] begin[{] method[bindIParseTreeConstructor, return_type[type[Class]], modifier[public], parameter[]] begin[{] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=org.eclipse.xtext.generator.parser.antlr.debug.parseTreeConstruction, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SimpleAntlrParsetreeConstructor, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[org] operator[SEP] identifier[eclipse] operator[SEP] identifier[xtext] operator[SEP] identifier[parsetree] operator[SEP] identifier[reconstr] operator[SEP] identifier[IParseTreeConstructor] operator[>] identifier[bindIParseTreeConstructor] operator[SEP] operator[SEP] { Keyword[return] identifier[org] operator[SEP] identifier[eclipse] operator[SEP] identifier[xtext] operator[SEP] identifier[generator] operator[SEP] identifier[parser] operator[SEP] identifier[antlr] operator[SEP] identifier[debug] operator[SEP] identifier[parseTreeConstruction] operator[SEP] identifier[SimpleAntlrParsetreeConstructor] operator[SEP] Keyword[class] operator[SEP] }
public List<RevisionPair> getRevisionPairs(int pageId, String template, RevisionPair.RevisionPairType type) throws WikiApiException{ if(revApi==null){ revApi = new RevisionApi(wiki.getDatabaseConfiguration()); } List<RevisionPair> resultList = new LinkedList<RevisionPair>(); Map<Timestamp, Boolean> tplIndexMap = new HashMap<Timestamp, Boolean>(); List<Timestamp> revTsList = revApi.getRevisionTimestamps(pageId); for(Timestamp ts:revTsList){ tplIndexMap.put(ts, revisionContainsTemplateName(revApi.getRevision(pageId, ts).getRevisionID(), template)); } SortedSet<Entry<Timestamp, Boolean>> entries = new TreeSet<Entry<Timestamp, Boolean>>( new Comparator<Entry<Timestamp, Boolean>>() { public int compare(Entry<Timestamp, Boolean> e1, Entry<Timestamp, Boolean> e2) { return e1.getKey().compareTo(e2.getKey()); } }); entries.addAll(tplIndexMap.entrySet()); Entry<Timestamp,Boolean> prev=null; Entry<Timestamp,Boolean> current=null; for(Entry<Timestamp,Boolean> e:entries){ current=e; //check pair if(prev!=null&&prev.getValue()!=current.getValue()){ //case: template has been deleted since last revision if(prev.getValue()&&!current.getValue()&&type==RevisionPairType.deleteTemplate){ resultList.add(new RevisionPair(revApi.getRevision(pageId, prev.getKey()),revApi.getRevision(pageId, current.getKey()),template,RevisionPairType.deleteTemplate)); } //case: template has been added since last revision if(!prev.getValue()&&current.getValue()&&type==RevisionPairType.addTemplate){ resultList.add(new RevisionPair(revApi.getRevision(pageId, prev.getKey()),revApi.getRevision(pageId, current.getKey()),template,RevisionPairType.addTemplate)); } } prev=current; } return resultList; }
class class_name[name] begin[{] method[getRevisionPairs, return_type[type[List]], modifier[public], parameter[pageId, template, type]] begin[{] if[binary_operation[member[.revApi], ==, literal[null]]] begin[{] assign[member[.revApi], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getDatabaseConfiguration, postfix_operators=[], prefix_operators=[], qualifier=wiki, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RevisionApi, sub_type=None))] else begin[{] None end[}] local_variable[type[List], resultList] local_variable[type[Map], tplIndexMap] local_variable[type[List], revTsList] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pageId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRevision, postfix_operators=[], prefix_operators=[], qualifier=revApi, selectors=[MethodInvocation(arguments=[], member=getRevisionID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=revisionContainsTemplateName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=tplIndexMap, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=revTsList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ts)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Timestamp, sub_type=None))), label=None) local_variable[type[SortedSet], entries] call[entries.addAll, parameter[call[tplIndexMap.entrySet, parameter[]]]] local_variable[type[Entry], prev] local_variable[type[Entry], current] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=prev, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=prev, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=['!'], qualifier=current, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=deleteTemplate, postfix_operators=[], prefix_operators=[], qualifier=RevisionPairType, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=pageId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=prev, selectors=[], type_arguments=None)], member=getRevision, postfix_operators=[], prefix_operators=[], qualifier=revApi, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=pageId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None)], member=getRevision, postfix_operators=[], prefix_operators=[], qualifier=revApi, selectors=[], type_arguments=None), MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deleteTemplate, postfix_operators=[], prefix_operators=[], qualifier=RevisionPairType, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RevisionPair, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=resultList, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=['!'], qualifier=prev, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=addTemplate, postfix_operators=[], prefix_operators=[], qualifier=RevisionPairType, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=pageId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=prev, selectors=[], type_arguments=None)], member=getRevision, postfix_operators=[], prefix_operators=[], qualifier=revApi, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=pageId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None)], member=getRevision, postfix_operators=[], prefix_operators=[], qualifier=revApi, selectors=[], type_arguments=None), MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=addTemplate, postfix_operators=[], prefix_operators=[], qualifier=RevisionPairType, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RevisionPair, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=resultList, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=entries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Timestamp, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) return[member[.resultList]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[RevisionPair] operator[>] identifier[getRevisionPairs] operator[SEP] Keyword[int] identifier[pageId] , identifier[String] identifier[template] , identifier[RevisionPair] operator[SEP] identifier[RevisionPairType] identifier[type] operator[SEP] Keyword[throws] identifier[WikiApiException] { Keyword[if] operator[SEP] identifier[revApi] operator[==] Other[null] operator[SEP] { identifier[revApi] operator[=] Keyword[new] identifier[RevisionApi] operator[SEP] identifier[wiki] operator[SEP] identifier[getDatabaseConfiguration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[RevisionPair] operator[>] identifier[resultList] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[RevisionPair] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Timestamp] , identifier[Boolean] operator[>] identifier[tplIndexMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Timestamp] , identifier[Boolean] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Timestamp] operator[>] identifier[revTsList] operator[=] identifier[revApi] operator[SEP] identifier[getRevisionTimestamps] operator[SEP] identifier[pageId] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Timestamp] identifier[ts] operator[:] identifier[revTsList] operator[SEP] { identifier[tplIndexMap] operator[SEP] identifier[put] operator[SEP] identifier[ts] , identifier[revisionContainsTemplateName] operator[SEP] identifier[revApi] operator[SEP] identifier[getRevision] operator[SEP] identifier[pageId] , identifier[ts] operator[SEP] operator[SEP] identifier[getRevisionID] operator[SEP] operator[SEP] , identifier[template] operator[SEP] operator[SEP] operator[SEP] } identifier[SortedSet] operator[<] identifier[Entry] operator[<] identifier[Timestamp] , identifier[Boolean] operator[>] operator[>] identifier[entries] operator[=] Keyword[new] identifier[TreeSet] operator[<] identifier[Entry] operator[<] identifier[Timestamp] , identifier[Boolean] operator[>] operator[>] operator[SEP] Keyword[new] identifier[Comparator] operator[<] identifier[Entry] operator[<] identifier[Timestamp] , identifier[Boolean] operator[>] operator[>] operator[SEP] operator[SEP] { Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[Entry] operator[<] identifier[Timestamp] , identifier[Boolean] operator[>] identifier[e1] , identifier[Entry] operator[<] identifier[Timestamp] , identifier[Boolean] operator[>] identifier[e2] operator[SEP] { Keyword[return] identifier[e1] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] identifier[e2] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[entries] operator[SEP] identifier[addAll] operator[SEP] identifier[tplIndexMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Entry] operator[<] identifier[Timestamp] , identifier[Boolean] operator[>] identifier[prev] operator[=] Other[null] operator[SEP] identifier[Entry] operator[<] identifier[Timestamp] , identifier[Boolean] operator[>] identifier[current] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[Timestamp] , identifier[Boolean] operator[>] identifier[e] operator[:] identifier[entries] operator[SEP] { identifier[current] operator[=] identifier[e] operator[SEP] Keyword[if] operator[SEP] identifier[prev] operator[!=] Other[null] operator[&&] identifier[prev] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] identifier[current] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[prev] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[current] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[&&] identifier[type] operator[==] identifier[RevisionPairType] operator[SEP] identifier[deleteTemplate] operator[SEP] { identifier[resultList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[RevisionPair] operator[SEP] identifier[revApi] operator[SEP] identifier[getRevision] operator[SEP] identifier[pageId] , identifier[prev] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] , identifier[revApi] operator[SEP] identifier[getRevision] operator[SEP] identifier[pageId] , identifier[current] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] , identifier[template] , identifier[RevisionPairType] operator[SEP] identifier[deleteTemplate] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[prev] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[&&] identifier[current] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[&&] identifier[type] operator[==] identifier[RevisionPairType] operator[SEP] identifier[addTemplate] operator[SEP] { identifier[resultList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[RevisionPair] operator[SEP] identifier[revApi] operator[SEP] identifier[getRevision] operator[SEP] identifier[pageId] , identifier[prev] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] , identifier[revApi] operator[SEP] identifier[getRevision] operator[SEP] identifier[pageId] , identifier[current] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] , identifier[template] , identifier[RevisionPairType] operator[SEP] identifier[addTemplate] operator[SEP] operator[SEP] operator[SEP] } } identifier[prev] operator[=] identifier[current] operator[SEP] } Keyword[return] identifier[resultList] operator[SEP] }
public List<String> listEntities(final String entityType) throws AtlasServiceException { JSONObject jsonResponse = callAPIWithRetries(API.LIST_ENTITIES, null, new ResourceCreator() { @Override public WebResource createResource() { WebResource resource = getResource(API.LIST_ENTITIES); resource = resource.queryParam(TYPE, entityType); return resource; } }); return extractResults(jsonResponse, AtlasClient.RESULTS, new ExtractOperation<String, String>()); }
class class_name[name] begin[{] method[listEntities, return_type[type[List]], modifier[public], parameter[entityType]] begin[{] local_variable[type[JSONObject], jsonResponse] return[call[.extractResults, parameter[member[.jsonResponse], member[AtlasClient.RESULTS], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ExtractOperation, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[listEntities] operator[SEP] Keyword[final] identifier[String] identifier[entityType] operator[SEP] Keyword[throws] identifier[AtlasServiceException] { identifier[JSONObject] identifier[jsonResponse] operator[=] identifier[callAPIWithRetries] operator[SEP] identifier[API] operator[SEP] identifier[LIST_ENTITIES] , Other[null] , Keyword[new] identifier[ResourceCreator] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[WebResource] identifier[createResource] operator[SEP] operator[SEP] { identifier[WebResource] identifier[resource] operator[=] identifier[getResource] operator[SEP] identifier[API] operator[SEP] identifier[LIST_ENTITIES] operator[SEP] operator[SEP] identifier[resource] operator[=] identifier[resource] operator[SEP] identifier[queryParam] operator[SEP] identifier[TYPE] , identifier[entityType] operator[SEP] operator[SEP] Keyword[return] identifier[resource] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] identifier[extractResults] operator[SEP] identifier[jsonResponse] , identifier[AtlasClient] operator[SEP] identifier[RESULTS] , Keyword[new] identifier[ExtractOperation] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void colorChooser2ndBackgroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_colorChooser2ndBackgroundActionPerformed if (this.colorChooser2ndBackground.isLastOkPressed() && changeNotificationAllowed) { this.controller.changed(); } }
class class_name[name] begin[{] method[colorChooser2ndBackgroundActionPerformed, return_type[void], modifier[private], parameter[evt]] begin[{] if[binary_operation[THIS[member[None.colorChooser2ndBackground]call[None.isLastOkPressed, parameter[]]], &&, member[.changeNotificationAllowed]]] begin[{] THIS[member[None.controller]call[None.changed, parameter[]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[colorChooser2ndBackgroundActionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[colorChooser2ndBackground] operator[SEP] identifier[isLastOkPressed] operator[SEP] operator[SEP] operator[&&] identifier[changeNotificationAllowed] operator[SEP] { Keyword[this] operator[SEP] identifier[controller] operator[SEP] identifier[changed] operator[SEP] operator[SEP] operator[SEP] } }
public static <T, U> ToLongBiFunction<T, U> toLongBiFunction(CheckedToLongBiFunction<T, U> function, Consumer<Throwable> handler) { return (t, u) -> { try { return function.applyAsLong(t, u); } catch (Throwable e) { handler.accept(e); throw new IllegalStateException("Exception handler must throw a RuntimeException", e); } }; }
class class_name[name] begin[{] method[toLongBiFunction, return_type[type[ToLongBiFunction]], modifier[public static], parameter[function, handler]] begin[{] return[LambdaExpression(body=[TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=applyAsLong, postfix_operators=[], prefix_operators=[], qualifier=function, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception handler must throw a RuntimeException"), 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=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)], parameters=[InferredFormalParameter(name=t), InferredFormalParameter(name=u)])] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[U] operator[>] identifier[ToLongBiFunction] operator[<] identifier[T] , identifier[U] operator[>] identifier[toLongBiFunction] operator[SEP] identifier[CheckedToLongBiFunction] operator[<] identifier[T] , identifier[U] operator[>] identifier[function] , identifier[Consumer] operator[<] identifier[Throwable] operator[>] identifier[handler] operator[SEP] { Keyword[return] operator[SEP] identifier[t] , identifier[u] operator[SEP] operator[->] { Keyword[try] { Keyword[return] identifier[function] operator[SEP] identifier[applyAsLong] operator[SEP] identifier[t] , identifier[u] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[handler] operator[SEP] identifier[accept] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } operator[SEP] }
public String encode(long... numbers) { if (numbers.length == 0) { return ""; } for (final long number : numbers) { if (number < 0) { return ""; } if (number > MAX_NUMBER) { throw new IllegalArgumentException("number can not be greater than " + MAX_NUMBER + "L"); } } return this._encode(numbers); }
class class_name[name] begin[{] method[encode, return_type[type[String]], modifier[public], parameter[numbers]] begin[{] if[binary_operation[member[numbers.length], ==, literal[0]]] begin[{] return[literal[""]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_NUMBER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="number can not be greater than "), operandr=MemberReference(member=MAX_NUMBER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="L"), 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)]))]), control=EnhancedForControl(iterable=MemberReference(member=numbers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=number)], modifiers={'final'}, type=BasicType(dimensions=[], name=long))), label=None) return[THIS[call[None._encode, parameter[member[.numbers]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[encode] operator[SEP] Keyword[long] operator[...] identifier[numbers] operator[SEP] { Keyword[if] operator[SEP] identifier[numbers] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] Keyword[long] identifier[number] operator[:] identifier[numbers] operator[SEP] { Keyword[if] operator[SEP] identifier[number] operator[<] Other[0] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[if] operator[SEP] identifier[number] operator[>] identifier[MAX_NUMBER] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[MAX_NUMBER] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[return] Keyword[this] operator[SEP] identifier[_encode] operator[SEP] identifier[numbers] operator[SEP] operator[SEP] }
@Override public void registerServlet(final String alias, final Servlet servlet, @SuppressWarnings("rawtypes") final Dictionary initParams, final HttpContext httpContext) throws ServletException, NamespaceException { LOG.warn("Http service has already been stopped"); }
class class_name[name] begin[{] method[registerServlet, return_type[void], modifier[public], parameter[alias, servlet, initParams, httpContext]] begin[{] call[LOG.warn, parameter[literal["Http service has already been stopped"]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[registerServlet] operator[SEP] Keyword[final] identifier[String] identifier[alias] , Keyword[final] identifier[Servlet] identifier[servlet] , annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[Dictionary] identifier[initParams] , Keyword[final] identifier[HttpContext] identifier[httpContext] operator[SEP] Keyword[throws] identifier[ServletException] , identifier[NamespaceException] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public Set<ResourceSelection> getSelections(final String catalog) { return getSelections(catalog, ResourceSelection.generateName(catalog)); }
class class_name[name] begin[{] method[getSelections, return_type[type[Set]], modifier[public], parameter[catalog]] begin[{] return[call[.getSelections, parameter[member[.catalog], call[ResourceSelection.generateName, parameter[member[.catalog]]]]]] end[}] END[}]
Keyword[public] identifier[Set] operator[<] identifier[ResourceSelection] operator[>] identifier[getSelections] operator[SEP] Keyword[final] identifier[String] identifier[catalog] operator[SEP] { Keyword[return] identifier[getSelections] operator[SEP] identifier[catalog] , identifier[ResourceSelection] operator[SEP] identifier[generateName] operator[SEP] identifier[catalog] operator[SEP] operator[SEP] operator[SEP] }
@Override public CloseableIterator<CaptureSearchResult> getPrefixReverseIterator(String prefix) throws ResourceIndexNotAvailableException { try { return adaptIterator(getReverseRecordIterator(prefix)); } catch (IOException e) { e.printStackTrace(); throw new ResourceIndexNotAvailableException(e.getMessage()); } }
class class_name[name] begin[{] method[getPrefixReverseIterator, return_type[type[CloseableIterator]], modifier[public], parameter[prefix]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getReverseRecordIterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=adaptIterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[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=[], type=ReferenceType(arguments=None, dimensions=None, name=ResourceIndexNotAvailableException, 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[}]
annotation[@] identifier[Override] Keyword[public] identifier[CloseableIterator] operator[<] identifier[CaptureSearchResult] operator[>] identifier[getPrefixReverseIterator] operator[SEP] identifier[String] identifier[prefix] operator[SEP] Keyword[throws] identifier[ResourceIndexNotAvailableException] { Keyword[try] { Keyword[return] identifier[adaptIterator] operator[SEP] identifier[getReverseRecordIterator] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ResourceIndexNotAvailableException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public final Observable<T> min(Comparator<? super T> comparator) { return OperatorMinMax.min(o, comparator); }
class class_name[name] begin[{] method[min, return_type[type[Observable]], modifier[final public], parameter[comparator]] begin[{] return[call[OperatorMinMax.min, parameter[member[.o], member[.comparator]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[Observable] operator[<] identifier[T] operator[>] identifier[min] operator[SEP] identifier[Comparator] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[comparator] operator[SEP] { Keyword[return] identifier[OperatorMinMax] operator[SEP] identifier[min] operator[SEP] identifier[o] , identifier[comparator] operator[SEP] operator[SEP] }
public T getObjectFromNameClassPair(NameClassPair nameClassPair) throws NamingException { if (!(nameClassPair instanceof Binding)) { throw new IllegalArgumentException("Parameter must be an instance of Binding"); } Binding binding = (Binding) nameClassPair; Object object = binding.getObject(); if (object == null) { throw new ObjectRetrievalException( "Binding did not contain any object."); } return mapper.mapFromContext(object); }
class class_name[name] begin[{] method[getObjectFromNameClassPair, return_type[type[T]], modifier[public], parameter[nameClassPair]] begin[{] if[binary_operation[member[.nameClassPair], instanceof, type[Binding]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter must be an instance of Binding")], 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[Binding], binding] local_variable[type[Object], object] if[binary_operation[member[.object], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Binding did not contain any object.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectRetrievalException, sub_type=None)), label=None) else begin[{] None end[}] return[call[mapper.mapFromContext, parameter[member[.object]]]] end[}] END[}]
Keyword[public] identifier[T] identifier[getObjectFromNameClassPair] operator[SEP] identifier[NameClassPair] identifier[nameClassPair] operator[SEP] Keyword[throws] identifier[NamingException] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[nameClassPair] Keyword[instanceof] identifier[Binding] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Binding] identifier[binding] operator[=] operator[SEP] identifier[Binding] operator[SEP] identifier[nameClassPair] operator[SEP] identifier[Object] identifier[object] operator[=] identifier[binding] operator[SEP] identifier[getObject] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ObjectRetrievalException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[mapper] operator[SEP] identifier[mapFromContext] operator[SEP] identifier[object] operator[SEP] operator[SEP] }
@Override public void waitForValue(final long timeout, final TimeUnit timeUnit) throws CouldNotPerformException, InterruptedException { synchronized (VALUE_LOCK) { if (value != null) { return; } // if 0 wait forever like the default java wait() implementation. if (timeUnit.toMillis(timeout) == 0) { VALUE_LOCK.wait(); } else { timeUnit.timedWait(VALUE_LOCK, timeout); } if (value == null) { throw new NotAvailableException(Observable.class, new TimeoutException()); } } //waitUntilNotificationIsFinished(); }
class class_name[name] begin[{] method[waitForValue, return_type[void], modifier[public], parameter[timeout, timeUnit]] begin[{] SYNCHRONIZED[member[.VALUE_LOCK]] BEGIN[{] if[binary_operation[member[.value], !=, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[call[timeUnit.toMillis, parameter[member[.timeout]]], ==, literal[0]]] begin[{] call[VALUE_LOCK.wait, parameter[]] else begin[{] call[timeUnit.timedWait, parameter[member[.VALUE_LOCK], member[.timeout]]] end[}] if[binary_operation[member[.value], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Observable, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TimeoutException, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NotAvailableException, sub_type=None)), label=None) else begin[{] None end[}] END[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[waitForValue] operator[SEP] Keyword[final] Keyword[long] identifier[timeout] , Keyword[final] identifier[TimeUnit] identifier[timeUnit] operator[SEP] Keyword[throws] identifier[CouldNotPerformException] , identifier[InterruptedException] { Keyword[synchronized] operator[SEP] identifier[VALUE_LOCK] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[timeUnit] operator[SEP] identifier[toMillis] operator[SEP] identifier[timeout] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[VALUE_LOCK] operator[SEP] identifier[wait] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[timeUnit] operator[SEP] identifier[timedWait] operator[SEP] identifier[VALUE_LOCK] , identifier[timeout] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NotAvailableException] operator[SEP] identifier[Observable] operator[SEP] Keyword[class] , Keyword[new] identifier[TimeoutException] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
public void setParentGroup(String groupName, String parentGroupName) throws CmsException { m_securityManager.setParentGroup(m_context, groupName, parentGroupName); }
class class_name[name] begin[{] method[setParentGroup, return_type[void], modifier[public], parameter[groupName, parentGroupName]] begin[{] call[m_securityManager.setParentGroup, parameter[member[.m_context], member[.groupName], member[.parentGroupName]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setParentGroup] operator[SEP] identifier[String] identifier[groupName] , identifier[String] identifier[parentGroupName] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[m_securityManager] operator[SEP] identifier[setParentGroup] operator[SEP] identifier[m_context] , identifier[groupName] , identifier[parentGroupName] operator[SEP] operator[SEP] }
public BigComplex multiply(BigDecimal value) { return valueOf( re.multiply(value), im.multiply(value)); }
class class_name[name] begin[{] method[multiply, return_type[type[BigComplex]], modifier[public], parameter[value]] begin[{] return[call[.valueOf, parameter[call[re.multiply, parameter[member[.value]]], call[im.multiply, parameter[member[.value]]]]]] end[}] END[}]
Keyword[public] identifier[BigComplex] identifier[multiply] operator[SEP] identifier[BigDecimal] identifier[value] operator[SEP] { Keyword[return] identifier[valueOf] operator[SEP] identifier[re] operator[SEP] identifier[multiply] operator[SEP] identifier[value] operator[SEP] , identifier[im] operator[SEP] identifier[multiply] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] }
public static String randomResourceName(String prefix, int maxLen) { ResourceNamer resourceNamer = SdkContext.getResourceNamerFactory().createResourceNamer(""); return resourceNamer.randomName(prefix, maxLen); }
class class_name[name] begin[{] method[randomResourceName, return_type[type[String]], modifier[public static], parameter[prefix, maxLen]] begin[{] local_variable[type[ResourceNamer], resourceNamer] return[call[resourceNamer.randomName, parameter[member[.prefix], member[.maxLen]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[randomResourceName] operator[SEP] identifier[String] identifier[prefix] , Keyword[int] identifier[maxLen] operator[SEP] { identifier[ResourceNamer] identifier[resourceNamer] operator[=] identifier[SdkContext] operator[SEP] identifier[getResourceNamerFactory] operator[SEP] operator[SEP] operator[SEP] identifier[createResourceNamer] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[resourceNamer] operator[SEP] identifier[randomName] operator[SEP] identifier[prefix] , identifier[maxLen] operator[SEP] operator[SEP] }
public void withUser(boolean user) { if (user) { addQueryParameter(Constants.WITH_PARAM, Constants.WITH_USER); } else { removeQueryParameter(Constants.WITH_PARAM); } }
class class_name[name] begin[{] method[withUser, return_type[void], modifier[public], parameter[user]] begin[{] if[member[.user]] begin[{] call[.addQueryParameter, parameter[member[Constants.WITH_PARAM], member[Constants.WITH_USER]]] else begin[{] call[.removeQueryParameter, parameter[member[Constants.WITH_PARAM]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[withUser] operator[SEP] Keyword[boolean] identifier[user] operator[SEP] { Keyword[if] operator[SEP] identifier[user] operator[SEP] { identifier[addQueryParameter] operator[SEP] identifier[Constants] operator[SEP] identifier[WITH_PARAM] , identifier[Constants] operator[SEP] identifier[WITH_USER] operator[SEP] operator[SEP] } Keyword[else] { identifier[removeQueryParameter] operator[SEP] identifier[Constants] operator[SEP] identifier[WITH_PARAM] operator[SEP] operator[SEP] } }
@Column(header = Messages.GUI_HISTORY_DIALOG_COL_LOCALE_0, order = 20) public String getLocale() { return m_elemComp.getLocale().toString(); }
class class_name[name] begin[{] method[getLocale, return_type[type[String]], modifier[public], parameter[]] begin[{] return[call[m_elemComp.getLocale, parameter[]]] end[}] END[}]
annotation[@] identifier[Column] operator[SEP] identifier[header] operator[=] identifier[Messages] operator[SEP] identifier[GUI_HISTORY_DIALOG_COL_LOCALE_0] , identifier[order] operator[=] Other[20] operator[SEP] Keyword[public] identifier[String] identifier[getLocale] operator[SEP] operator[SEP] { Keyword[return] identifier[m_elemComp] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static String diffReadable(String expression) throws InvalidExpressionException { ExpressionParser p = new ExpressionParser(); return p.format(diff(expression)); }
class class_name[name] begin[{] method[diffReadable, return_type[type[String]], modifier[public static], parameter[expression]] begin[{] local_variable[type[ExpressionParser], p] return[call[p.format, parameter[call[.diff, parameter[member[.expression]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[diffReadable] operator[SEP] identifier[String] identifier[expression] operator[SEP] Keyword[throws] identifier[InvalidExpressionException] { identifier[ExpressionParser] identifier[p] operator[=] Keyword[new] identifier[ExpressionParser] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[p] operator[SEP] identifier[format] operator[SEP] identifier[diff] operator[SEP] identifier[expression] operator[SEP] operator[SEP] operator[SEP] }
@NonNull public IconicsDrawable roundedCornersRes(@DimenRes int sizeResId) { return roundedCornersPx(mContext.getResources().getDimensionPixelSize(sizeResId)); }
class class_name[name] begin[{] method[roundedCornersRes, return_type[type[IconicsDrawable]], modifier[public], parameter[sizeResId]] begin[{] return[call[.roundedCornersPx, parameter[call[mContext.getResources, parameter[]]]]] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[public] identifier[IconicsDrawable] identifier[roundedCornersRes] operator[SEP] annotation[@] identifier[DimenRes] Keyword[int] identifier[sizeResId] operator[SEP] { Keyword[return] identifier[roundedCornersPx] operator[SEP] identifier[mContext] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[sizeResId] operator[SEP] operator[SEP] operator[SEP] }
public static void main(String[] args) throws Exception { CeUserArgumentProcessor processor = new CeUserArgumentProcessor(); //Responsible for creating a CeMain instance processor.process(args); }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] local_variable[type[CeUserArgumentProcessor], processor] call[processor.process, parameter[member[.args]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] { identifier[CeUserArgumentProcessor] identifier[processor] operator[=] Keyword[new] identifier[CeUserArgumentProcessor] operator[SEP] operator[SEP] operator[SEP] identifier[processor] operator[SEP] identifier[process] operator[SEP] identifier[args] operator[SEP] operator[SEP] }
public String generateResetToken(User user) { String encryptedToken = tokenEncryptor.encrypt(user.getUsername() + SEPARATOR + simpleDigester.digest(user.getPassword()) + SEPARATOR + System.currentTimeMillis()); return UrlEncoder.QUERY_INSTANCE.encode(encryptedToken, HTTP.ISO_8859_1); }
class class_name[name] begin[{] method[generateResetToken, return_type[type[String]], modifier[public], parameter[user]] begin[{] local_variable[type[String], encryptedToken] return[call[UrlEncoder.QUERY_INSTANCE.encode, parameter[member[.encryptedToken], member[HTTP.ISO_8859_1]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[generateResetToken] operator[SEP] identifier[User] identifier[user] operator[SEP] { identifier[String] identifier[encryptedToken] operator[=] identifier[tokenEncryptor] operator[SEP] identifier[encrypt] operator[SEP] identifier[user] operator[SEP] identifier[getUsername] operator[SEP] operator[SEP] operator[+] identifier[SEPARATOR] operator[+] identifier[simpleDigester] operator[SEP] identifier[digest] operator[SEP] identifier[user] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] operator[+] identifier[SEPARATOR] operator[+] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[UrlEncoder] operator[SEP] identifier[QUERY_INSTANCE] operator[SEP] identifier[encode] operator[SEP] identifier[encryptedToken] , identifier[HTTP] operator[SEP] identifier[ISO_8859_1] operator[SEP] operator[SEP] }
@BetaApi public final Operation insertInterconnectAttachment( String region, InterconnectAttachment interconnectAttachmentResource) { InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder() .setRegion(region) .setInterconnectAttachmentResource(interconnectAttachmentResource) .build(); return insertInterconnectAttachment(request); }
class class_name[name] begin[{] method[insertInterconnectAttachment, return_type[type[Operation]], modifier[final public], parameter[region, interconnectAttachmentResource]] begin[{] local_variable[type[InsertInterconnectAttachmentHttpRequest], request] return[call[.insertInterconnectAttachment, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Operation] identifier[insertInterconnectAttachment] operator[SEP] identifier[String] identifier[region] , identifier[InterconnectAttachment] identifier[interconnectAttachmentResource] operator[SEP] { identifier[InsertInterconnectAttachmentHttpRequest] identifier[request] operator[=] identifier[InsertInterconnectAttachmentHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setRegion] operator[SEP] identifier[region] operator[SEP] operator[SEP] identifier[setInterconnectAttachmentResource] operator[SEP] identifier[interconnectAttachmentResource] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[insertInterconnectAttachment] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static <V, T extends Tag> T convertToTag(String name, V value) throws ConversionException { if(value == null) { return null; } TagConverter<T, V> converter = (TagConverter<T, V>) typeToConverter.get(value.getClass()); if(converter == null) { for(Class<?> clazz : getAllClasses(value.getClass())) { if(typeToConverter.containsKey(clazz)) { try { converter = (TagConverter<T, V>) typeToConverter.get(clazz); break; } catch(ClassCastException e) { } } } } if(converter == null) { throw new ConversionException("Value type " + value.getClass().getName() + " has no converter."); } return converter.convert(name, value); }
class class_name[name] begin[{] method[convertToTag, return_type[type[T]], modifier[public static], parameter[name, value]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[TagConverter], converter] if[binary_operation[member[.converter], ==, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=typeToConverter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=typeToConverter, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=TagConverter, sub_type=None))), label=None), BreakStatement(goto=None, label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassCastException']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=getAllClasses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) else begin[{] None end[}] if[binary_operation[member[.converter], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Value type "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has no converter."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConversionException, sub_type=None)), label=None) else begin[{] None end[}] return[call[converter.convert, parameter[member[.name], member[.value]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[V] , identifier[T] Keyword[extends] identifier[Tag] operator[>] identifier[T] identifier[convertToTag] operator[SEP] identifier[String] identifier[name] , identifier[V] identifier[value] operator[SEP] Keyword[throws] identifier[ConversionException] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[TagConverter] operator[<] identifier[T] , identifier[V] operator[>] identifier[converter] operator[=] operator[SEP] identifier[TagConverter] operator[<] identifier[T] , identifier[V] operator[>] operator[SEP] identifier[typeToConverter] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[converter] operator[==] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[:] identifier[getAllClasses] operator[SEP] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[typeToConverter] operator[SEP] identifier[containsKey] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] { Keyword[try] { identifier[converter] operator[=] operator[SEP] identifier[TagConverter] operator[<] identifier[T] , identifier[V] operator[>] operator[SEP] identifier[typeToConverter] operator[SEP] identifier[get] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] { } } } } Keyword[if] operator[SEP] identifier[converter] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ConversionException] operator[SEP] literal[String] operator[+] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[converter] operator[SEP] identifier[convert] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] }
private PHS398Checklist13Document getPHS398Checklist() { PHS398Checklist13Document phsChecklistDocument = PHS398Checklist13Document.Factory .newInstance(); PHS398Checklist13 phsChecklist = PHS398Checklist13.Factory.newInstance(); answerHeaders = getPropDevQuestionAnswerService().getQuestionnaireAnswerHeaders(pdDoc.getDevelopmentProposal().getProposalNumber()); setPhsCheckListBasicProperties(phsChecklist); setFormerPDNameAndIsChangeOfPDPI(phsChecklist); setFormerInstitutionNameAndChangeOfInstitution(phsChecklist); setIsInventionsAndPatentsAndIsPreviouslyReported(phsChecklist); ProposalDevelopmentBudgetExtContract budget = s2SCommonBudgetService.getBudget(pdDoc.getDevelopmentProposal()); if (budget != null) { int numPeriods = budget.getBudgetPeriods().size(); setIncomeBudgetPeriods(phsChecklist, budget.getBudgetProjectIncomes()); } else { phsChecklist.setProgramIncome(YesNoDataType.N_NO); } ynqAnswer = getYNQAnswer(YNQANSWER_121); phsChecklist.setDisclosurePermission(ynqAnswer); phsChecklistDocument.setPHS398Checklist13(phsChecklist); return phsChecklistDocument; }
class class_name[name] begin[{] method[getPHS398Checklist, return_type[type[PHS398Checklist13Document]], modifier[private], parameter[]] begin[{] local_variable[type[PHS398Checklist13Document], phsChecklistDocument] local_variable[type[PHS398Checklist13], phsChecklist] assign[member[.answerHeaders], call[.getPropDevQuestionAnswerService, parameter[]]] call[.setPhsCheckListBasicProperties, parameter[member[.phsChecklist]]] call[.setFormerPDNameAndIsChangeOfPDPI, parameter[member[.phsChecklist]]] call[.setFormerInstitutionNameAndChangeOfInstitution, parameter[member[.phsChecklist]]] call[.setIsInventionsAndPatentsAndIsPreviouslyReported, parameter[member[.phsChecklist]]] local_variable[type[ProposalDevelopmentBudgetExtContract], budget] if[binary_operation[member[.budget], !=, literal[null]]] begin[{] local_variable[type[int], numPeriods] call[.setIncomeBudgetPeriods, parameter[member[.phsChecklist], call[budget.getBudgetProjectIncomes, parameter[]]]] else begin[{] call[phsChecklist.setProgramIncome, parameter[member[YesNoDataType.N_NO]]] end[}] assign[member[.ynqAnswer], call[.getYNQAnswer, parameter[member[.YNQANSWER_121]]]] call[phsChecklist.setDisclosurePermission, parameter[member[.ynqAnswer]]] call[phsChecklistDocument.setPHS398Checklist13, parameter[member[.phsChecklist]]] return[member[.phsChecklistDocument]] end[}] END[}]
Keyword[private] identifier[PHS398Checklist13Document] identifier[getPHS398Checklist] operator[SEP] operator[SEP] { identifier[PHS398Checklist13Document] identifier[phsChecklistDocument] operator[=] identifier[PHS398Checklist13Document] operator[SEP] identifier[Factory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[PHS398Checklist13] identifier[phsChecklist] operator[=] identifier[PHS398Checklist13] operator[SEP] identifier[Factory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[answerHeaders] operator[=] identifier[getPropDevQuestionAnswerService] operator[SEP] operator[SEP] operator[SEP] identifier[getQuestionnaireAnswerHeaders] operator[SEP] identifier[pdDoc] operator[SEP] identifier[getDevelopmentProposal] operator[SEP] operator[SEP] operator[SEP] identifier[getProposalNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setPhsCheckListBasicProperties] operator[SEP] identifier[phsChecklist] operator[SEP] operator[SEP] identifier[setFormerPDNameAndIsChangeOfPDPI] operator[SEP] identifier[phsChecklist] operator[SEP] operator[SEP] identifier[setFormerInstitutionNameAndChangeOfInstitution] operator[SEP] identifier[phsChecklist] operator[SEP] operator[SEP] identifier[setIsInventionsAndPatentsAndIsPreviouslyReported] operator[SEP] identifier[phsChecklist] operator[SEP] operator[SEP] identifier[ProposalDevelopmentBudgetExtContract] identifier[budget] operator[=] identifier[s2SCommonBudgetService] operator[SEP] identifier[getBudget] operator[SEP] identifier[pdDoc] operator[SEP] identifier[getDevelopmentProposal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[budget] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[numPeriods] operator[=] identifier[budget] operator[SEP] identifier[getBudgetPeriods] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[setIncomeBudgetPeriods] operator[SEP] identifier[phsChecklist] , identifier[budget] operator[SEP] identifier[getBudgetProjectIncomes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[phsChecklist] operator[SEP] identifier[setProgramIncome] operator[SEP] identifier[YesNoDataType] operator[SEP] identifier[N_NO] operator[SEP] operator[SEP] } identifier[ynqAnswer] operator[=] identifier[getYNQAnswer] operator[SEP] identifier[YNQANSWER_121] operator[SEP] operator[SEP] identifier[phsChecklist] operator[SEP] identifier[setDisclosurePermission] operator[SEP] identifier[ynqAnswer] operator[SEP] operator[SEP] identifier[phsChecklistDocument] operator[SEP] identifier[setPHS398Checklist13] operator[SEP] identifier[phsChecklist] operator[SEP] operator[SEP] Keyword[return] identifier[phsChecklistDocument] operator[SEP] }
public String convertDataObjectFontDescriptorEncEnvToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
class class_name[name] begin[{] method[convertDataObjectFontDescriptorEncEnvToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[String] identifier[convertDataObjectFontDescriptorEncEnvToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] { Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public ResolvedType findSupertype(Class<?> erasedSupertype) { if (erasedSupertype == _erasedType) { return this; } // Check super interfaces first: if (erasedSupertype.isInterface()) { for (ResolvedType it : implInterfaces()) { ResolvedType type = it.findSupertype(erasedSupertype); if (type != null) { return type; } } } // and if not found, super class and its supertypes ResolvedType pc = parentType(); if (pc != null) { ResolvedType type = pc.findSupertype(erasedSupertype); if (type != null) { return type; } } // nope; doesn't look like we extend or implement super type in question return null; }
class class_name[name] begin[{] method[findSupertype, return_type[type[ResolvedType]], modifier[public], parameter[erasedSupertype]] begin[{] if[binary_operation[member[.erasedSupertype], ==, member[._erasedType]]] begin[{] return[THIS[]] else begin[{] None end[}] if[call[erasedSupertype.isInterface, parameter[]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=erasedSupertype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findSupertype, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResolvedType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=implInterfaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResolvedType, sub_type=None))), label=None) else begin[{] None end[}] local_variable[type[ResolvedType], pc] if[binary_operation[member[.pc], !=, literal[null]]] begin[{] local_variable[type[ResolvedType], type] if[binary_operation[member[.type], !=, literal[null]]] begin[{] return[member[.type]] else begin[{] None end[}] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[ResolvedType] identifier[findSupertype] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[erasedSupertype] operator[SEP] { Keyword[if] operator[SEP] identifier[erasedSupertype] operator[==] identifier[_erasedType] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } Keyword[if] operator[SEP] identifier[erasedSupertype] operator[SEP] identifier[isInterface] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[ResolvedType] identifier[it] operator[:] identifier[implInterfaces] operator[SEP] operator[SEP] operator[SEP] { identifier[ResolvedType] identifier[type] operator[=] identifier[it] operator[SEP] identifier[findSupertype] operator[SEP] identifier[erasedSupertype] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[type] operator[SEP] } } } identifier[ResolvedType] identifier[pc] operator[=] identifier[parentType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pc] operator[!=] Other[null] operator[SEP] { identifier[ResolvedType] identifier[type] operator[=] identifier[pc] operator[SEP] identifier[findSupertype] operator[SEP] identifier[erasedSupertype] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[type] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public void setColorStateList(ColorStateList colorStateList) { boolean changed = mColorStateList != colorStateList; mColorStateList = colorStateList; if (changed) { updateBackground(); } }
class class_name[name] begin[{] method[setColorStateList, return_type[void], modifier[public], parameter[colorStateList]] begin[{] local_variable[type[boolean], changed] assign[member[.mColorStateList], member[.colorStateList]] if[member[.changed]] begin[{] call[.updateBackground, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setColorStateList] operator[SEP] identifier[ColorStateList] identifier[colorStateList] operator[SEP] { Keyword[boolean] identifier[changed] operator[=] identifier[mColorStateList] operator[!=] identifier[colorStateList] operator[SEP] identifier[mColorStateList] operator[=] identifier[colorStateList] operator[SEP] Keyword[if] operator[SEP] identifier[changed] operator[SEP] { identifier[updateBackground] operator[SEP] operator[SEP] operator[SEP] } }
public void renameFile(String oldpath, String newpath) throws SftpStatusException, SshException { if (version < 2) { throw new SftpStatusException( SftpStatusException.SSH_FX_OP_UNSUPPORTED, "Renaming files is not supported by the server SFTP version " + String.valueOf(version)); } try { UnsignedInteger32 requestId = nextRequestId(); Packet msg = createPacket(); msg.write(SSH_FXP_RENAME); msg.writeInt(requestId.longValue()); msg.writeString(oldpath, CHARSET_ENCODING); msg.writeString(newpath, CHARSET_ENCODING); sendMessage(msg); getOKRequestStatus(requestId); } catch (SshIOException ex) { throw ex.getRealException(); } catch (IOException ex) { throw new SshException(ex); } EventServiceImplementation .getInstance() .fireEvent( (new Event(this, J2SSHEventCodes.EVENT_SFTP_FILE_RENAMED, true)) .addAttribute( J2SSHEventCodes.ATTRIBUTE_FILE_NAME, oldpath) .addAttribute( J2SSHEventCodes.ATTRIBUTE_FILE_NEW_NAME, newpath)); }
class class_name[name] begin[{] method[renameFile, return_type[void], modifier[public], parameter[oldpath, newpath]] begin[{] if[binary_operation[member[.version], <, literal[2]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=SSH_FX_OP_UNSUPPORTED, postfix_operators=[], prefix_operators=[], qualifier=SftpStatusException, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Renaming files is not supported by the server SFTP version "), operandr=MethodInvocation(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, 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=SftpStatusException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextRequestId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=requestId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UnsignedInteger32, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=createPacket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Packet, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SSH_FXP_RENAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=longValue, postfix_operators=[], prefix_operators=[], qualifier=requestId, selectors=[], type_arguments=None)], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=oldpath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=CHARSET_ENCODING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newpath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=CHARSET_ENCODING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=requestId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOKRequestStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[], member=getRealException, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SshIOException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SshException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None) call[EventServiceImplementation.getInstance, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[renameFile] operator[SEP] identifier[String] identifier[oldpath] , identifier[String] identifier[newpath] operator[SEP] Keyword[throws] identifier[SftpStatusException] , identifier[SshException] { Keyword[if] operator[SEP] identifier[version] operator[<] Other[2] operator[SEP] { Keyword[throw] Keyword[new] identifier[SftpStatusException] operator[SEP] identifier[SftpStatusException] operator[SEP] identifier[SSH_FX_OP_UNSUPPORTED] , literal[String] operator[+] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[version] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[UnsignedInteger32] identifier[requestId] operator[=] identifier[nextRequestId] operator[SEP] operator[SEP] operator[SEP] identifier[Packet] identifier[msg] operator[=] identifier[createPacket] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[write] operator[SEP] identifier[SSH_FXP_RENAME] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[writeInt] operator[SEP] identifier[requestId] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[writeString] operator[SEP] identifier[oldpath] , identifier[CHARSET_ENCODING] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[writeString] operator[SEP] identifier[newpath] , identifier[CHARSET_ENCODING] operator[SEP] operator[SEP] identifier[sendMessage] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[getOKRequestStatus] operator[SEP] identifier[requestId] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SshIOException] identifier[ex] operator[SEP] { Keyword[throw] identifier[ex] operator[SEP] identifier[getRealException] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[SshException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } identifier[EventServiceImplementation] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[fireEvent] operator[SEP] operator[SEP] Keyword[new] identifier[Event] operator[SEP] Keyword[this] , identifier[J2SSHEventCodes] operator[SEP] identifier[EVENT_SFTP_FILE_RENAMED] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[addAttribute] operator[SEP] identifier[J2SSHEventCodes] operator[SEP] identifier[ATTRIBUTE_FILE_NAME] , identifier[oldpath] operator[SEP] operator[SEP] identifier[addAttribute] operator[SEP] identifier[J2SSHEventCodes] operator[SEP] identifier[ATTRIBUTE_FILE_NEW_NAME] , identifier[newpath] operator[SEP] operator[SEP] operator[SEP] }
public Thread spawn(String namePrefix, Runnable runnable) { checkNotNull(namePrefix, "namePrefix can't be null"); checkNotNull(runnable, "runnable can't be null"); String name = newName(namePrefix); Thread thread; if (throwException) { thread = new ThrowExceptionThread(name, runnable); thread.setUncaughtExceptionHandler(exceptionHandler); } else { thread = new ReportExceptionThread(testId, name, runnable); } threads.add(thread); thread.start(); return thread; }
class class_name[name] begin[{] method[spawn, return_type[type[Thread]], modifier[public], parameter[namePrefix, runnable]] begin[{] call[.checkNotNull, parameter[member[.namePrefix], literal["namePrefix can't be null"]]] call[.checkNotNull, parameter[member[.runnable], literal["runnable can't be null"]]] local_variable[type[String], name] local_variable[type[Thread], thread] if[member[.throwException]] begin[{] assign[member[.thread], ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=runnable, 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=ThrowExceptionThread, sub_type=None))] call[thread.setUncaughtExceptionHandler, parameter[member[.exceptionHandler]]] else begin[{] assign[member[.thread], ClassCreator(arguments=[MemberReference(member=testId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=runnable, 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=ReportExceptionThread, sub_type=None))] end[}] call[threads.add, parameter[member[.thread]]] call[thread.start, parameter[]] return[member[.thread]] end[}] END[}]
Keyword[public] identifier[Thread] identifier[spawn] operator[SEP] identifier[String] identifier[namePrefix] , identifier[Runnable] identifier[runnable] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[namePrefix] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[runnable] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[newName] operator[SEP] identifier[namePrefix] operator[SEP] operator[SEP] identifier[Thread] identifier[thread] operator[SEP] Keyword[if] operator[SEP] identifier[throwException] operator[SEP] { identifier[thread] operator[=] Keyword[new] identifier[ThrowExceptionThread] operator[SEP] identifier[name] , identifier[runnable] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[setUncaughtExceptionHandler] operator[SEP] identifier[exceptionHandler] operator[SEP] operator[SEP] } Keyword[else] { identifier[thread] operator[=] Keyword[new] identifier[ReportExceptionThread] operator[SEP] identifier[testId] , identifier[name] , identifier[runnable] operator[SEP] operator[SEP] } identifier[threads] operator[SEP] identifier[add] operator[SEP] identifier[thread] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[thread] operator[SEP] }
public <K,V> Map<K,V> readResultsByPage(TextPageCriteria criteria, int pageNumber, Region<K,V> region, Region<String,Collection<?>> pageRegion) { if(pageRegion == null ) return null; Collection<?> regionKeys = pageRegion.get(criteria.toPageKey(pageNumber)); if(regionKeys == null|| regionKeys.isEmpty()) return null; return region.getAll(regionKeys); }
class class_name[name] begin[{] method[readResultsByPage, return_type[type[Map]], modifier[public], parameter[criteria, pageNumber, region, pageRegion]] begin[{] if[binary_operation[member[.pageRegion], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Collection], regionKeys] if[binary_operation[binary_operation[member[.regionKeys], ==, literal[null]], ||, call[regionKeys.isEmpty, parameter[]]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[region.getAll, parameter[member[.regionKeys]]]] end[}] END[}]
Keyword[public] operator[<] identifier[K] , identifier[V] operator[>] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[readResultsByPage] operator[SEP] identifier[TextPageCriteria] identifier[criteria] , Keyword[int] identifier[pageNumber] , identifier[Region] operator[<] identifier[K] , identifier[V] operator[>] identifier[region] , identifier[Region] operator[<] identifier[String] , identifier[Collection] operator[<] operator[?] operator[>] operator[>] identifier[pageRegion] operator[SEP] { Keyword[if] operator[SEP] identifier[pageRegion] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[Collection] operator[<] operator[?] operator[>] identifier[regionKeys] operator[=] identifier[pageRegion] operator[SEP] identifier[get] operator[SEP] identifier[criteria] operator[SEP] identifier[toPageKey] operator[SEP] identifier[pageNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[regionKeys] operator[==] Other[null] operator[||] identifier[regionKeys] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] identifier[region] operator[SEP] identifier[getAll] operator[SEP] identifier[regionKeys] operator[SEP] operator[SEP] }
private String convertToJavacSriptArray(List<String> mediaIDs) { // in case there is no media visualizer do not build an array if (mediaIDs == null) { return ""; } StringBuilder sb = new StringBuilder("\nvar mediaIDs = [ "); int size = mediaIDs.size(); for (int i = 0; i < size; i++) { sb.append("\""); sb.append(mediaIDs.get(i)); sb.append("\""); if (!(size - 1 - i == 0)) { sb.append(", "); } } return sb.append(" ];\n").toString(); }
class class_name[name] begin[{] method[convertToJavacSriptArray, return_type[type[String]], modifier[private], parameter[mediaIDs]] begin[{] if[binary_operation[member[.mediaIDs], ==, literal[null]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[StringBuilder], sb] local_variable[type[int], size] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mediaIDs, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[sb.append, parameter[literal[" ];\n"]]]] end[}] END[}]
Keyword[private] identifier[String] identifier[convertToJavacSriptArray] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[mediaIDs] operator[SEP] { Keyword[if] operator[SEP] identifier[mediaIDs] operator[==] Other[null] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[mediaIDs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[mediaIDs] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[size] operator[-] Other[1] operator[-] identifier[i] operator[==] Other[0] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
protected String getConfiguredEncoding(CmsObject cms, CmsResource resource) throws CmsException { String encoding = null; try { encoding = cms.readPropertyObject( resource.getRootPath(), CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true).getValue(); } catch (CmsException e) { // encoding will be null } if (encoding == null) { encoding = OpenCms.getSystemInfo().getDefaultEncoding(); } else { encoding = CmsEncoder.lookupEncoding(encoding, null); if (encoding == null) { throw new CmsXmlException( Messages.get().container(Messages.ERR_XMLCONTENT_INVALID_ENC_1, resource.getRootPath())); } } return encoding; }
class class_name[name] begin[{] method[getConfiguredEncoding, return_type[type[String]], modifier[protected], parameter[cms, resource]] begin[{] local_variable[type[String], encoding] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), MemberReference(member=PROPERTY_CONTENT_ENCODING, postfix_operators=[], prefix_operators=[], qualifier=CmsPropertyDefinition, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=readPropertyObject, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.encoding], ==, literal[null]]] begin[{] assign[member[.encoding], call[OpenCms.getSystemInfo, parameter[]]] else begin[{] assign[member[.encoding], call[CmsEncoder.lookupEncoding, parameter[member[.encoding], literal[null]]]] if[binary_operation[member[.encoding], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_XMLCONTENT_INVALID_ENC_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=container, 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=CmsXmlException, sub_type=None)), label=None) else begin[{] None end[}] end[}] return[member[.encoding]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getConfiguredEncoding] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[CmsResource] identifier[resource] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[String] identifier[encoding] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[encoding] operator[=] identifier[cms] operator[SEP] identifier[readPropertyObject] operator[SEP] identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] , identifier[CmsPropertyDefinition] operator[SEP] identifier[PROPERTY_CONTENT_ENCODING] , literal[boolean] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { } Keyword[if] operator[SEP] identifier[encoding] operator[==] Other[null] operator[SEP] { identifier[encoding] operator[=] identifier[OpenCms] operator[SEP] identifier[getSystemInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getDefaultEncoding] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[encoding] operator[=] identifier[CmsEncoder] operator[SEP] identifier[lookupEncoding] operator[SEP] identifier[encoding] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[encoding] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[CmsXmlException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_XMLCONTENT_INVALID_ENC_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[encoding] operator[SEP] }
private boolean deleteDirectoryWithRetries(File directory, int retryCount) { if (retryCount > 100) { return false; } if (FileUtils.deleteQuietly(directory)) { return true; } else { try { Thread.sleep(10); } catch (InterruptedException ex) { // ignore } return deleteDirectoryWithRetries(directory, retryCount + 1); } }
class class_name[name] begin[{] method[deleteDirectoryWithRetries, return_type[type[boolean]], modifier[private], parameter[directory, retryCount]] begin[{] if[binary_operation[member[.retryCount], >, literal[100]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[FileUtils.deleteQuietly, parameter[member[.directory]]]] begin[{] return[literal[true]] else begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], 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=ex, types=['InterruptedException']))], finally_block=None, label=None, resources=None) return[call[.deleteDirectoryWithRetries, parameter[member[.directory], binary_operation[member[.retryCount], +, literal[1]]]]] end[}] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[deleteDirectoryWithRetries] operator[SEP] identifier[File] identifier[directory] , Keyword[int] identifier[retryCount] operator[SEP] { Keyword[if] operator[SEP] identifier[retryCount] operator[>] Other[100] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[FileUtils] operator[SEP] identifier[deleteQuietly] operator[SEP] identifier[directory] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[try] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[10] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ex] operator[SEP] { } Keyword[return] identifier[deleteDirectoryWithRetries] operator[SEP] identifier[directory] , identifier[retryCount] operator[+] Other[1] operator[SEP] operator[SEP] } }
public void setItems(List<String> items) { mItems = items.toArray(new String[items.size()]); mSelection = new boolean[mItems.length]; Arrays.fill(mSelection, false); refreshDisplayValue(); }
class class_name[name] begin[{] method[setItems, return_type[void], modifier[public], parameter[items]] begin[{] assign[member[.mItems], call[items.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=items, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]] assign[member[.mSelection], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=mItems, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=boolean))] call[Arrays.fill, parameter[member[.mSelection], literal[false]]] call[.refreshDisplayValue, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setItems] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[items] operator[SEP] { identifier[mItems] operator[=] identifier[items] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[items] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mSelection] operator[=] Keyword[new] Keyword[boolean] operator[SEP] identifier[mItems] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[mSelection] , literal[boolean] operator[SEP] operator[SEP] identifier[refreshDisplayValue] operator[SEP] operator[SEP] operator[SEP] }
public static auditsyslogpolicy_systemglobal_binding[] get(nitro_service service, String name) throws Exception{ auditsyslogpolicy_systemglobal_binding obj = new auditsyslogpolicy_systemglobal_binding(); obj.set_name(name); auditsyslogpolicy_systemglobal_binding response[] = (auditsyslogpolicy_systemglobal_binding[]) obj.get_resources(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[auditsyslogpolicy_systemglobal_binding]], modifier[public static], parameter[service, name]] begin[{] local_variable[type[auditsyslogpolicy_systemglobal_binding], obj] call[obj.set_name, parameter[member[.name]]] local_variable[type[auditsyslogpolicy_systemglobal_binding], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[auditsyslogpolicy_systemglobal_binding] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[Exception] { identifier[auditsyslogpolicy_systemglobal_binding] identifier[obj] operator[=] Keyword[new] identifier[auditsyslogpolicy_systemglobal_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_name] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[auditsyslogpolicy_systemglobal_binding] identifier[response] operator[SEP] operator[SEP] operator[=] operator[SEP] identifier[auditsyslogpolicy_systemglobal_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
public Stream<Discussion> getCommitDiscussionsStream(Object projectIdOrPath, Integer commitId) throws GitLabApiException { Pager<Discussion> pager = getCommitDiscussionsPager(projectIdOrPath, commitId, getDefaultPerPage()); return (pager.stream()); }
class class_name[name] begin[{] method[getCommitDiscussionsStream, return_type[type[Stream]], modifier[public], parameter[projectIdOrPath, commitId]] begin[{] local_variable[type[Pager], pager] return[call[pager.stream, parameter[]]] end[}] END[}]
Keyword[public] identifier[Stream] operator[<] identifier[Discussion] operator[>] identifier[getCommitDiscussionsStream] operator[SEP] identifier[Object] identifier[projectIdOrPath] , identifier[Integer] identifier[commitId] operator[SEP] Keyword[throws] identifier[GitLabApiException] { identifier[Pager] operator[<] identifier[Discussion] operator[>] identifier[pager] operator[=] identifier[getCommitDiscussionsPager] operator[SEP] identifier[projectIdOrPath] , identifier[commitId] , identifier[getDefaultPerPage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[pager] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private BufferedImage create_POI_Image(final int WIDTH) { if (WIDTH <= 0) { return null; } final java.awt.image.BufferedImage IMAGE = UTIL.createImage(WIDTH, WIDTH, java.awt.Transparency.TRANSLUCENT); final java.awt.Graphics2D G2 = IMAGE.createGraphics(); G2.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING, java.awt.RenderingHints.VALUE_ANTIALIAS_ON); //G2.setRenderingHint(java.awt.RenderingHints.KEY_RENDERING, java.awt.RenderingHints.VALUE_RENDER_QUALITY); //G2.setRenderingHint(java.awt.RenderingHints.KEY_DITHERING, java.awt.RenderingHints.VALUE_DITHER_ENABLE); //G2.setRenderingHint(java.awt.RenderingHints.KEY_ALPHA_INTERPOLATION, java.awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY); //G2.setRenderingHint(java.awt.RenderingHints.KEY_COLOR_RENDERING, java.awt.RenderingHints.VALUE_COLOR_RENDER_QUALITY); G2.setRenderingHint(java.awt.RenderingHints.KEY_STROKE_CONTROL, java.awt.RenderingHints.VALUE_STROKE_NORMALIZE); //G2.setRenderingHint(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON); final java.awt.geom.Ellipse2D BLIP = new java.awt.geom.Ellipse2D.Double(0, 0, WIDTH, WIDTH); final java.awt.geom.Point2D CENTER = new java.awt.geom.Point2D.Double(BLIP.getCenterX(), BLIP.getCenterY()); final float[] FRACTIONS = { 0.0f, 1.0f }; final Color[] COLORS = { new Color(1.0f, 1.0f, 1.0f, 0.9f), new Color(1.0f, 1.0f, 1.0f, 0.0f) }; final java.awt.RadialGradientPaint GRADIENT = new java.awt.RadialGradientPaint(CENTER, (int) (WIDTH / 2.0), FRACTIONS, COLORS); G2.setPaint(GRADIENT); G2.fill(BLIP); G2.dispose(); return IMAGE; }
class class_name[name] begin[{] method[create_POI_Image, return_type[type[BufferedImage]], modifier[private], parameter[WIDTH]] begin[{] if[binary_operation[member[.WIDTH], <=, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[java], IMAGE] local_variable[type[java], G2] call[G2.setRenderingHint, parameter[member[java.awt.RenderingHints.KEY_ANTIALIASING], member[java.awt.RenderingHints.VALUE_ANTIALIAS_ON]]] call[G2.setRenderingHint, parameter[member[java.awt.RenderingHints.KEY_STROKE_CONTROL], member[java.awt.RenderingHints.VALUE_STROKE_NORMALIZE]]] local_variable[type[java], BLIP] local_variable[type[java], CENTER] local_variable[type[float], FRACTIONS] local_variable[type[Color], COLORS] local_variable[type[java], GRADIENT] call[G2.setPaint, parameter[member[.GRADIENT]]] call[G2.fill, parameter[member[.BLIP]]] call[G2.dispose, parameter[]] return[member[.IMAGE]] end[}] END[}]
Keyword[private] identifier[BufferedImage] identifier[create_POI_Image] operator[SEP] Keyword[final] Keyword[int] identifier[WIDTH] operator[SEP] { Keyword[if] operator[SEP] identifier[WIDTH] operator[<=] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[image] operator[SEP] identifier[BufferedImage] identifier[IMAGE] operator[=] identifier[UTIL] operator[SEP] identifier[createImage] operator[SEP] identifier[WIDTH] , identifier[WIDTH] , identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Transparency] operator[SEP] identifier[TRANSLUCENT] operator[SEP] operator[SEP] Keyword[final] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Graphics2D] identifier[G2] operator[=] identifier[IMAGE] operator[SEP] identifier[createGraphics] operator[SEP] operator[SEP] operator[SEP] identifier[G2] operator[SEP] identifier[setRenderingHint] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[RenderingHints] operator[SEP] identifier[KEY_ANTIALIASING] , identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[RenderingHints] operator[SEP] identifier[VALUE_ANTIALIAS_ON] operator[SEP] operator[SEP] identifier[G2] operator[SEP] identifier[setRenderingHint] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[RenderingHints] operator[SEP] identifier[KEY_STROKE_CONTROL] , identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[RenderingHints] operator[SEP] identifier[VALUE_STROKE_NORMALIZE] operator[SEP] operator[SEP] Keyword[final] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[geom] operator[SEP] identifier[Ellipse2D] identifier[BLIP] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[geom] operator[SEP] identifier[Ellipse2D] operator[SEP] identifier[Double] operator[SEP] Other[0] , Other[0] , identifier[WIDTH] , identifier[WIDTH] operator[SEP] operator[SEP] Keyword[final] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[geom] operator[SEP] identifier[Point2D] identifier[CENTER] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[geom] operator[SEP] identifier[Point2D] operator[SEP] identifier[Double] operator[SEP] identifier[BLIP] operator[SEP] identifier[getCenterX] operator[SEP] operator[SEP] , identifier[BLIP] operator[SEP] identifier[getCenterY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[float] operator[SEP] operator[SEP] identifier[FRACTIONS] operator[=] { literal[Float] , literal[Float] } operator[SEP] Keyword[final] identifier[Color] operator[SEP] operator[SEP] identifier[COLORS] operator[=] { Keyword[new] identifier[Color] operator[SEP] literal[Float] , literal[Float] , literal[Float] , literal[Float] operator[SEP] , Keyword[new] identifier[Color] operator[SEP] literal[Float] , literal[Float] , literal[Float] , literal[Float] operator[SEP] } operator[SEP] Keyword[final] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[RadialGradientPaint] identifier[GRADIENT] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[RadialGradientPaint] operator[SEP] identifier[CENTER] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[WIDTH] operator[/] literal[Float] operator[SEP] , identifier[FRACTIONS] , identifier[COLORS] operator[SEP] operator[SEP] identifier[G2] operator[SEP] identifier[setPaint] operator[SEP] identifier[GRADIENT] operator[SEP] operator[SEP] identifier[G2] operator[SEP] identifier[fill] operator[SEP] identifier[BLIP] operator[SEP] operator[SEP] identifier[G2] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[IMAGE] operator[SEP] }
public ElementCollection<EmbeddableAttributes<T>> getOrCreateElementCollection() { List<Node> nodeList = childNode.get("element-collection"); if (nodeList != null && nodeList.size() > 0) { return new ElementCollectionImpl<EmbeddableAttributes<T>>(this, "element-collection", childNode, nodeList.get(0)); } return createElementCollection(); }
class class_name[name] begin[{] method[getOrCreateElementCollection, return_type[type[ElementCollection]], modifier[public], parameter[]] begin[{] local_variable[type[List], nodeList] if[binary_operation[binary_operation[member[.nodeList], !=, literal[null]], &&, binary_operation[call[nodeList.size, parameter[]], >, literal[0]]]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="element-collection"), MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=nodeList, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=EmbeddableAttributes, sub_type=None))], dimensions=None, name=ElementCollectionImpl, sub_type=None))] else begin[{] None end[}] return[call[.createElementCollection, parameter[]]] end[}] END[}]
Keyword[public] identifier[ElementCollection] operator[<] identifier[EmbeddableAttributes] operator[<] identifier[T] operator[>] operator[>] identifier[getOrCreateElementCollection] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Node] operator[>] identifier[nodeList] operator[=] identifier[childNode] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodeList] operator[!=] Other[null] operator[&&] identifier[nodeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] Keyword[new] identifier[ElementCollectionImpl] operator[<] identifier[EmbeddableAttributes] operator[<] identifier[T] operator[>] operator[>] operator[SEP] Keyword[this] , literal[String] , identifier[childNode] , identifier[nodeList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[createElementCollection] operator[SEP] operator[SEP] operator[SEP] }
public static MozuUrl renameProductCodesUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/Actions/RenameProductCodes"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
class class_name[name] begin[{] method[renameProductCodesUrl, return_type[type[MozuUrl]], modifier[public static], parameter[]] begin[{] local_variable[type[UrlFormatter], formatter] 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[renameProductCodesUrl] operator[SEP] operator[SEP] { identifier[UrlFormatter] identifier[formatter] operator[=] Keyword[new] identifier[UrlFormatter] operator[SEP] literal[String] 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] }
@FormatMethod private void reportError(ParseTree parseTree, @FormatString String message, Object... arguments) { if (parseTree == null) { reportError(message, arguments); } else { errorReporter.reportError(parseTree.location.start, message, arguments); } }
class class_name[name] begin[{] method[reportError, return_type[void], modifier[private], parameter[parseTree, message, arguments]] begin[{] if[binary_operation[member[.parseTree], ==, literal[null]]] begin[{] call[.reportError, parameter[member[.message], member[.arguments]]] else begin[{] call[errorReporter.reportError, parameter[member[parseTree.location.start], member[.message], member[.arguments]]] end[}] end[}] END[}]
annotation[@] identifier[FormatMethod] Keyword[private] Keyword[void] identifier[reportError] operator[SEP] identifier[ParseTree] identifier[parseTree] , annotation[@] identifier[FormatString] identifier[String] identifier[message] , identifier[Object] operator[...] identifier[arguments] operator[SEP] { Keyword[if] operator[SEP] identifier[parseTree] operator[==] Other[null] operator[SEP] { identifier[reportError] operator[SEP] identifier[message] , identifier[arguments] operator[SEP] operator[SEP] } Keyword[else] { identifier[errorReporter] operator[SEP] identifier[reportError] operator[SEP] identifier[parseTree] operator[SEP] identifier[location] operator[SEP] identifier[start] , identifier[message] , identifier[arguments] operator[SEP] operator[SEP] } }
public void commit() throws IOException { if (this.tasks == null || this.tasks.isEmpty()) { log.warn("No tasks to be committed in container " + containerIdOptional.or("")); return; } Iterator<Callable<Void>> callableIterator = Iterators.transform(this.tasks.iterator(), new Function<Task, Callable<Void>>() { @Override public Callable<Void> apply(final Task task) { return new Callable<Void>() { @Nullable @Override public Void call() throws Exception { task.commit(); return null; } }; } }); try { List<Either<Void, ExecutionException>> executionResults = new IteratorExecutor<>(callableIterator, this.getTaskCommitThreadPoolSize(), ExecutorsUtils.newDaemonThreadFactory(Optional.of(log), Optional.of("Task-committing-pool-%d"))) .executeAndGetResults(); IteratorExecutor.logFailures(executionResults, log, 10); } catch (InterruptedException ie) { log.error("Committing of tasks interrupted. Aborting."); throw new RuntimeException(ie); } finally { persistTaskStateStore(); if (this.cleanupCommitSteps != null) { for (CommitStep cleanupCommitStep : this.cleanupCommitSteps) { log.info("Executing additional commit step."); cleanupCommitStep.execute(); } } } }
class class_name[name] begin[{] method[commit, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[THIS[member[None.tasks]], ==, literal[null]], ||, THIS[member[None.tasks]call[None.isEmpty, parameter[]]]]] begin[{] call[log.warn, parameter[binary_operation[literal["No tasks to be committed in container "], +, call[containerIdOptional.or, parameter[literal[""]]]]]] return[None] else begin[{] None end[}] local_variable[type[Iterator], callableIterator] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=callableIterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getTaskCommitThreadPoolSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Task-committing-pool-%d")], member=of, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None)], member=newDaemonThreadFactory, postfix_operators=[], prefix_operators=[], qualifier=ExecutorsUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=executeAndGetResults, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[], dimensions=None, name=IteratorExecutor, sub_type=None)), name=executionResults)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ExecutionException, sub_type=None))], dimensions=[], name=Either, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=executionResults, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=logFailures, postfix_operators=[], prefix_operators=[], qualifier=IteratorExecutor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Committing of tasks interrupted. Aborting.")], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ie, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ie, types=['InterruptedException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=persistTaskStateStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=cleanupCommitSteps, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Executing additional commit step.")], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=execute, postfix_operators=[], prefix_operators=[], qualifier=cleanupCommitStep, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=cleanupCommitSteps, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cleanupCommitStep)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommitStep, sub_type=None))), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[commit] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[tasks] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[tasks] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[containerIdOptional] operator[SEP] identifier[or] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[Iterator] operator[<] identifier[Callable] operator[<] identifier[Void] operator[>] operator[>] identifier[callableIterator] operator[=] identifier[Iterators] operator[SEP] identifier[transform] operator[SEP] Keyword[this] operator[SEP] identifier[tasks] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] , Keyword[new] identifier[Function] operator[<] identifier[Task] , identifier[Callable] operator[<] identifier[Void] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Callable] operator[<] identifier[Void] operator[>] identifier[apply] operator[SEP] Keyword[final] identifier[Task] identifier[task] operator[SEP] { Keyword[return] Keyword[new] identifier[Callable] operator[<] identifier[Void] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Nullable] annotation[@] identifier[Override] Keyword[public] identifier[Void] identifier[call] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[task] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } operator[SEP] } } operator[SEP] operator[SEP] Keyword[try] { identifier[List] operator[<] identifier[Either] operator[<] identifier[Void] , identifier[ExecutionException] operator[>] operator[>] identifier[executionResults] operator[=] Keyword[new] identifier[IteratorExecutor] operator[<] operator[>] operator[SEP] identifier[callableIterator] , Keyword[this] operator[SEP] identifier[getTaskCommitThreadPoolSize] operator[SEP] operator[SEP] , identifier[ExecutorsUtils] operator[SEP] identifier[newDaemonThreadFactory] operator[SEP] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[log] operator[SEP] , identifier[Optional] operator[SEP] identifier[of] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[executeAndGetResults] operator[SEP] operator[SEP] operator[SEP] identifier[IteratorExecutor] operator[SEP] identifier[logFailures] operator[SEP] identifier[executionResults] , identifier[log] , Other[10] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ie] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ie] operator[SEP] operator[SEP] } Keyword[finally] { identifier[persistTaskStateStore] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[cleanupCommitSteps] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[CommitStep] identifier[cleanupCommitStep] operator[:] Keyword[this] operator[SEP] identifier[cleanupCommitSteps] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cleanupCommitStep] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] } } } }
private Object getObjectForString(Class<?> type, String values[]) throws Exception{ if(values == null || values.length == 0) throw new Exception("getObjectForString: values was null or of zero length"); Object array = Array.newInstance(type.getComponentType(), values.length); // Now fill in the values for the empty array we just created. for(int i = 0; i < values.length; i++) Array.set(array, i, getObjectForString(type, values[i])); return array; }
class class_name[name] begin[{] method[getObjectForString, return_type[type[Object]], modifier[private], parameter[type, values]] begin[{] if[binary_operation[binary_operation[member[.values], ==, literal[null]], ||, binary_operation[member[values.length], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getObjectForString: values was null or of zero length")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Object], array] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getObjectForString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=Array, 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=values, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.array]] end[}] END[}]
Keyword[private] identifier[Object] identifier[getObjectForString] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] , identifier[String] identifier[values] operator[SEP] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[values] operator[==] Other[null] operator[||] identifier[values] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Object] identifier[array] operator[=] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[type] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] , identifier[values] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[values] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[Array] operator[SEP] identifier[set] operator[SEP] identifier[array] , identifier[i] , identifier[getObjectForString] operator[SEP] identifier[type] , identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[array] operator[SEP] }
public T withOptionalOutgoingPayload(Optional<Map<String, ByteBuffer>> outgoingPayload) { getOptions().setOutgoingPayLoad(outgoingPayload); return getThis(); }
class class_name[name] begin[{] method[withOptionalOutgoingPayload, return_type[type[T]], modifier[public], parameter[outgoingPayload]] begin[{] call[.getOptions, parameter[]] return[call[.getThis, parameter[]]] end[}] END[}]
Keyword[public] identifier[T] identifier[withOptionalOutgoingPayload] operator[SEP] identifier[Optional] operator[<] identifier[Map] operator[<] identifier[String] , identifier[ByteBuffer] operator[>] operator[>] identifier[outgoingPayload] operator[SEP] { identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] identifier[setOutgoingPayLoad] operator[SEP] identifier[outgoingPayload] operator[SEP] operator[SEP] Keyword[return] identifier[getThis] operator[SEP] operator[SEP] operator[SEP] }
public static CommerceNotificationAttachment fetchByUuid_C_First( String uuid, long companyId, OrderByComparator<CommerceNotificationAttachment> orderByComparator) { return getPersistence() .fetchByUuid_C_First(uuid, companyId, orderByComparator); }
class class_name[name] begin[{] method[fetchByUuid_C_First, return_type[type[CommerceNotificationAttachment]], modifier[public static], parameter[uuid, companyId, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommerceNotificationAttachment] identifier[fetchByUuid_C_First] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[companyId] , identifier[OrderByComparator] operator[<] identifier[CommerceNotificationAttachment] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByUuid_C_First] operator[SEP] identifier[uuid] , identifier[companyId] , identifier[orderByComparator] operator[SEP] operator[SEP] }
@Override public <T extends KTypeProcedure<? super KType>> T forEach(T procedure) { return forEach(procedure, 0, size()); }
class class_name[name] begin[{] method[forEach, return_type[type[T]], modifier[public], parameter[procedure]] begin[{] return[call[.forEach, parameter[member[.procedure], literal[0], call[.size, parameter[]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[KTypeProcedure] operator[<] operator[?] Keyword[super] identifier[KType] operator[>] operator[>] identifier[T] identifier[forEach] operator[SEP] identifier[T] identifier[procedure] operator[SEP] { Keyword[return] identifier[forEach] operator[SEP] identifier[procedure] , Other[0] , identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static double daleChallScore(String strText) { strText = cleanText(strText); int intDifficultWordCount = 0; List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText); int intWordCount = arrWords.size(); for (int i = 0; i < intWordCount; ++i) { if (!DALECHALL_WORDLIST.contains(arrWords.get(i))) { ++intDifficultWordCount; } } int intSentenceCount=sentenceCount(strText); double percentageOfDifficultWords=intDifficultWordCount/(double)intWordCount; double score=0.1579*(100*percentageOfDifficultWords)+0.0496*(intWordCount/(double)intSentenceCount); if(percentageOfDifficultWords>0.05) { score+=3.6365; } return score; }
class class_name[name] begin[{] method[daleChallScore, return_type[type[double]], modifier[public static], parameter[strText]] begin[{] assign[member[.strText], call[.cleanText, parameter[member[.strText]]]] local_variable[type[int], intDifficultWordCount] local_variable[type[List], arrWords] local_variable[type[int], intWordCount] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=arrWords, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=DALECHALL_WORDLIST, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=intDifficultWordCount, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=intWordCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[int], intSentenceCount] local_variable[type[double], percentageOfDifficultWords] local_variable[type[double], score] if[binary_operation[member[.percentageOfDifficultWords], >, literal[0.05]]] begin[{] assign[member[.score], literal[3.6365]] else begin[{] None end[}] return[member[.score]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[daleChallScore] operator[SEP] identifier[String] identifier[strText] operator[SEP] { identifier[strText] operator[=] identifier[cleanText] operator[SEP] identifier[strText] operator[SEP] operator[SEP] Keyword[int] identifier[intDifficultWordCount] operator[=] Other[0] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[arrWords] operator[=] operator[SEP] Keyword[new] identifier[WhitespaceTokenizer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tokenize] operator[SEP] identifier[strText] operator[SEP] operator[SEP] Keyword[int] identifier[intWordCount] operator[=] identifier[arrWords] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[intWordCount] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[DALECHALL_WORDLIST] operator[SEP] identifier[contains] operator[SEP] identifier[arrWords] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { operator[++] identifier[intDifficultWordCount] operator[SEP] } } Keyword[int] identifier[intSentenceCount] operator[=] identifier[sentenceCount] operator[SEP] identifier[strText] operator[SEP] operator[SEP] Keyword[double] identifier[percentageOfDifficultWords] operator[=] identifier[intDifficultWordCount] operator[/] operator[SEP] Keyword[double] operator[SEP] identifier[intWordCount] operator[SEP] Keyword[double] identifier[score] operator[=] literal[Float] operator[*] operator[SEP] Other[100] operator[*] identifier[percentageOfDifficultWords] operator[SEP] operator[+] literal[Float] operator[*] operator[SEP] identifier[intWordCount] operator[/] operator[SEP] Keyword[double] operator[SEP] identifier[intSentenceCount] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[percentageOfDifficultWords] operator[>] literal[Float] operator[SEP] { identifier[score] operator[+=] literal[Float] operator[SEP] } Keyword[return] identifier[score] operator[SEP] }
public ChannelSpecification withSupportedInputModes(String... supportedInputModes) { if (this.supportedInputModes == null) { setSupportedInputModes(new java.util.ArrayList<String>(supportedInputModes.length)); } for (String ele : supportedInputModes) { this.supportedInputModes.add(ele); } return this; }
class class_name[name] begin[{] method[withSupportedInputModes, return_type[type[ChannelSpecification]], modifier[public], parameter[supportedInputModes]] begin[{] if[binary_operation[THIS[member[None.supportedInputModes]], ==, literal[null]]] begin[{] call[.setSupportedInputModes, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=supportedInputModes, 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=supportedInputModes, 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=supportedInputModes, 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[ChannelSpecification] identifier[withSupportedInputModes] operator[SEP] identifier[String] operator[...] identifier[supportedInputModes] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[supportedInputModes] operator[==] Other[null] operator[SEP] { identifier[setSupportedInputModes] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[supportedInputModes] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[supportedInputModes] operator[SEP] { Keyword[this] operator[SEP] identifier[supportedInputModes] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public DistanceElement getElement(long id) { if (!vector.containsKey(id)) vector.put(id, new DistanceElement(id)); return vector.get(id); }
class class_name[name] begin[{] method[getElement, return_type[type[DistanceElement]], modifier[public], parameter[id]] begin[{] if[call[vector.containsKey, parameter[member[.id]]]] begin[{] call[vector.put, parameter[member[.id], ClassCreator(arguments=[MemberReference(member=id, 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=DistanceElement, sub_type=None))]] else begin[{] None end[}] return[call[vector.get, parameter[member[.id]]]] end[}] END[}]
Keyword[public] identifier[DistanceElement] identifier[getElement] operator[SEP] Keyword[long] identifier[id] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[vector] operator[SEP] identifier[containsKey] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[vector] operator[SEP] identifier[put] operator[SEP] identifier[id] , Keyword[new] identifier[DistanceElement] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[vector] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] }
public List<Node> apply(List<Node> selectedCandidates, Random rng) { List<Node> evolved = new ArrayList<Node>(selectedCandidates.size()); for (Node node : selectedCandidates) { evolved.add(probability.nextEvent(rng) ? node.simplify() : node); } return evolved; }
class class_name[name] begin[{] method[apply, return_type[type[List]], modifier[public], parameter[selectedCandidates, rng]] begin[{] local_variable[type[List], evolved] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=rng, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nextEvent, postfix_operators=[], prefix_operators=[], qualifier=probability, selectors=[], type_arguments=None), if_false=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=simplify, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=evolved, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=selectedCandidates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None) return[member[.evolved]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Node] operator[>] identifier[apply] operator[SEP] identifier[List] operator[<] identifier[Node] operator[>] identifier[selectedCandidates] , identifier[Random] identifier[rng] operator[SEP] { identifier[List] operator[<] identifier[Node] operator[>] identifier[evolved] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Node] operator[>] operator[SEP] identifier[selectedCandidates] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Node] identifier[node] operator[:] identifier[selectedCandidates] operator[SEP] { identifier[evolved] operator[SEP] identifier[add] operator[SEP] identifier[probability] operator[SEP] identifier[nextEvent] operator[SEP] identifier[rng] operator[SEP] operator[?] identifier[node] operator[SEP] identifier[simplify] operator[SEP] operator[SEP] operator[:] identifier[node] operator[SEP] operator[SEP] } Keyword[return] identifier[evolved] operator[SEP] }
@Override public Object remove(Object key, boolean dropRef) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "remove", new Object[] { key, new Boolean(dropRef) }); Bucket bucket = getBucketForKey(key); Object object = null; if (bucket != null) // d739870 { synchronized (bucket) { Element element = bucket.removeByKey(key, dropRef); object = element != null ? element.object : null; } if (object != null) { synchronized (this) { // ACK! This is going to be a choke point numObjects--; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "remove", object); return object; }
class class_name[name] begin[{] method[remove, return_type[type[Object]], modifier[public], parameter[key, dropRef]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["remove"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=dropRef, 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=Boolean, sub_type=None))]), 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[Bucket], bucket] local_variable[type[Object], object] if[binary_operation[member[.bucket], !=, literal[null]]] begin[{] SYNCHRONIZED[member[.bucket]] BEGIN[{] local_variable[type[Element], element] assign[member[.object], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[]))] END[}] if[binary_operation[member[.object], !=, literal[null]]] begin[{] SYNCHRONIZED[THIS[]] BEGIN[{] member[.numObjects] END[}] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["remove"], member[.object]]] else begin[{] None end[}] return[member[.object]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[remove] operator[SEP] identifier[Object] identifier[key] , Keyword[boolean] identifier[dropRef] 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[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[key] , Keyword[new] identifier[Boolean] operator[SEP] identifier[dropRef] operator[SEP] } operator[SEP] operator[SEP] identifier[Bucket] identifier[bucket] operator[=] identifier[getBucketForKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[Object] identifier[object] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[bucket] operator[!=] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[bucket] operator[SEP] { identifier[Element] identifier[element] operator[=] identifier[bucket] operator[SEP] identifier[removeByKey] operator[SEP] identifier[key] , identifier[dropRef] operator[SEP] operator[SEP] identifier[object] operator[=] identifier[element] operator[!=] Other[null] operator[?] identifier[element] operator[SEP] identifier[object] operator[:] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[object] operator[!=] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[numObjects] operator[--] 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[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[object] operator[SEP] operator[SEP] Keyword[return] identifier[object] operator[SEP] }
public long getAverageEventRoutingTime() { long time = 0L; long events = 0L; for (EventTypeID eventTypeID : eventRouter.getSleeContainer().getComponentManagement().getComponentRepository().getEventComponentIDs()) { for (int i = 0; i < getExecutors().length; i++) { final EventRouterExecutorStatistics eventRouterExecutorStatistics = getEventRouterExecutorStatistics(i); if (eventRouterExecutorStatistics != null) { EventTypeRoutingStatistics eventTypeRoutingStatistics = eventRouterExecutorStatistics.getEventTypeRoutingStatistics(eventTypeID); if (eventTypeRoutingStatistics != null) { time += eventTypeRoutingStatistics.getRoutingTime(); events += eventTypeRoutingStatistics.getEventsRouted(); } } } } return time == 0L ? 0L : time / events; }
class class_name[name] begin[{] method[getAverageEventRoutingTime, return_type[type[long]], modifier[public], parameter[]] begin[{] local_variable[type[long], time] local_variable[type[long], events] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEventRouterExecutorStatistics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=eventRouterExecutorStatistics)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=EventRouterExecutorStatistics, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=eventRouterExecutorStatistics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=eventTypeID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEventTypeRoutingStatistics, postfix_operators=[], prefix_operators=[], qualifier=eventRouterExecutorStatistics, selectors=[], type_arguments=None), name=eventTypeRoutingStatistics)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EventTypeRoutingStatistics, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=eventTypeRoutingStatistics, 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=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getRoutingTime, postfix_operators=[], prefix_operators=[], qualifier=eventTypeRoutingStatistics, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=events, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getEventsRouted, postfix_operators=[], prefix_operators=[], qualifier=eventTypeRoutingStatistics, selectors=[], type_arguments=None)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getExecutors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSleeContainer, postfix_operators=[], prefix_operators=[], qualifier=eventRouter, selectors=[MethodInvocation(arguments=[], member=getComponentManagement, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getComponentRepository, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getEventComponentIDs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=eventTypeID)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EventTypeID, sub_type=None))), label=None) return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), operator===), if_false=BinaryOperation(operandl=MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=events, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L))] end[}] END[}]
Keyword[public] Keyword[long] identifier[getAverageEventRoutingTime] operator[SEP] operator[SEP] { Keyword[long] identifier[time] operator[=] Other[0L] operator[SEP] Keyword[long] identifier[events] operator[=] Other[0L] operator[SEP] Keyword[for] operator[SEP] identifier[EventTypeID] identifier[eventTypeID] operator[:] identifier[eventRouter] operator[SEP] identifier[getSleeContainer] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentManagement] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentRepository] operator[SEP] operator[SEP] operator[SEP] identifier[getEventComponentIDs] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[getExecutors] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] identifier[EventRouterExecutorStatistics] identifier[eventRouterExecutorStatistics] operator[=] identifier[getEventRouterExecutorStatistics] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eventRouterExecutorStatistics] operator[!=] Other[null] operator[SEP] { identifier[EventTypeRoutingStatistics] identifier[eventTypeRoutingStatistics] operator[=] identifier[eventRouterExecutorStatistics] operator[SEP] identifier[getEventTypeRoutingStatistics] operator[SEP] identifier[eventTypeID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eventTypeRoutingStatistics] operator[!=] Other[null] operator[SEP] { identifier[time] operator[+=] identifier[eventTypeRoutingStatistics] operator[SEP] identifier[getRoutingTime] operator[SEP] operator[SEP] operator[SEP] identifier[events] operator[+=] identifier[eventTypeRoutingStatistics] operator[SEP] identifier[getEventsRouted] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[return] identifier[time] operator[==] Other[0L] operator[?] Other[0L] operator[:] identifier[time] operator[/] identifier[events] operator[SEP] }
@Nonnull @Override public <V> ScheduledFuture<V> schedule(@Nonnull Callable<V> callable, long delay, @Nonnull TimeUnit unit) { scheduledOnce.mark(); return delegate.schedule(new InstrumentedCallable<>(callable), delay, unit); }
class class_name[name] begin[{] method[schedule, return_type[type[ScheduledFuture]], modifier[public], parameter[callable, delay, unit]] begin[{] call[scheduledOnce.mark, parameter[]] return[call[delegate.schedule, parameter[ClassCreator(arguments=[MemberReference(member=callable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=InstrumentedCallable, sub_type=None)), member[.delay], member[.unit]]]] end[}] END[}]
annotation[@] identifier[Nonnull] annotation[@] identifier[Override] Keyword[public] operator[<] identifier[V] operator[>] identifier[ScheduledFuture] operator[<] identifier[V] operator[>] identifier[schedule] operator[SEP] annotation[@] identifier[Nonnull] identifier[Callable] operator[<] identifier[V] operator[>] identifier[callable] , Keyword[long] identifier[delay] , annotation[@] identifier[Nonnull] identifier[TimeUnit] identifier[unit] operator[SEP] { identifier[scheduledOnce] operator[SEP] identifier[mark] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[delegate] operator[SEP] identifier[schedule] operator[SEP] Keyword[new] identifier[InstrumentedCallable] operator[<] operator[>] operator[SEP] identifier[callable] operator[SEP] , identifier[delay] , identifier[unit] operator[SEP] operator[SEP] }
public void printStackTrace(PrintStream printStream) { if (mStackTrace == null) { printStream.print(getMessage()); } else { printStream.print(mStackTrace); } }
class class_name[name] begin[{] method[printStackTrace, return_type[void], modifier[public], parameter[printStream]] begin[{] if[binary_operation[member[.mStackTrace], ==, literal[null]]] begin[{] call[printStream.print, parameter[call[.getMessage, parameter[]]]] else begin[{] call[printStream.print, parameter[member[.mStackTrace]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[printStackTrace] operator[SEP] identifier[PrintStream] identifier[printStream] operator[SEP] { Keyword[if] operator[SEP] identifier[mStackTrace] operator[==] Other[null] operator[SEP] { identifier[printStream] operator[SEP] identifier[print] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[printStream] operator[SEP] identifier[print] operator[SEP] identifier[mStackTrace] operator[SEP] operator[SEP] } }
@Override public Collection<String> wordsNearestSum(Collection<String> positive, Collection<String> negative, int top) { throw new UnsupportedOperationException("Method isn't implemented. Please use usual Word2Vec implementation"); }
class class_name[name] begin[{] method[wordsNearestSum, return_type[type[Collection]], modifier[public], parameter[positive, negative, top]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Method isn't implemented. Please use usual Word2Vec implementation")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Collection] operator[<] identifier[String] operator[>] identifier[wordsNearestSum] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[positive] , identifier[Collection] operator[<] identifier[String] operator[>] identifier[negative] , Keyword[int] identifier[top] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
private boolean matches(final Method seiMethod, final Method viewMethod) { if (!seiMethod.getName().equals(viewMethod.getName())) return false; final Class<?>[] sourceParams = seiMethod.getParameterTypes(); final Class<?>[] targetParams = viewMethod.getParameterTypes(); if (sourceParams.length != targetParams.length) return false; for (int i = 0; i < sourceParams.length; i++) { if (!sourceParams[i].equals(targetParams[i])) return false; } return true; }
class class_name[name] begin[{] method[matches, return_type[type[boolean]], modifier[private], parameter[seiMethod, viewMethod]] begin[{] if[call[seiMethod.getName, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[Class], sourceParams] local_variable[type[Class], targetParams] if[binary_operation[member[sourceParams.length], !=, member[targetParams.length]]] begin[{] return[literal[false]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=sourceParams, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=targetParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), 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=sourceParams, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[matches] operator[SEP] Keyword[final] identifier[Method] identifier[seiMethod] , Keyword[final] identifier[Method] identifier[viewMethod] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[seiMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[viewMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[sourceParams] operator[=] identifier[seiMethod] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[targetParams] operator[=] identifier[viewMethod] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sourceParams] operator[SEP] identifier[length] operator[!=] identifier[targetParams] operator[SEP] identifier[length] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[sourceParams] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[sourceParams] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[targetParams] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public boolean checkResource(RequiredOrientResource resource, Action action) { if(!resource.action().equals(action.getName())) return true; OSecurityUser user = OrientDbWebSession.get().getEffectiveUser(); if(user==null) return false; int iOperation = OrientPermission.combinedPermission(resource.permissions()); ORule.ResourceGeneric value = OSecurityHelper.getResourceGeneric(resource.value()); String specific = resource.specific(); if(Strings.isEmpty(specific)) specific = null; if(user.checkIfAllowed(value, specific, iOperation)!=null) return true; while(!Strings.isEmpty(specific=Strings.beforeLastPathComponent(specific, '.'))) { if(user.checkIfAllowed(value, specific+"."+ODatabaseSecurityResources.ALL, iOperation)!=null) return true; } return false; }
class class_name[name] begin[{] method[checkResource, return_type[type[boolean]], modifier[public], parameter[resource, action]] begin[{] if[call[resource.action, parameter[]]] begin[{] return[literal[true]] else begin[{] None end[}] local_variable[type[OSecurityUser], user] if[binary_operation[member[.user], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[int], iOperation] local_variable[type[ORule], value] local_variable[type[String], specific] if[call[Strings.isEmpty, parameter[member[.specific]]]] begin[{] assign[member[.specific], literal[null]] else begin[{] None end[}] if[binary_operation[call[user.checkIfAllowed, parameter[member[.value], member[.specific], member[.iOperation]]], !=, literal[null]]] begin[{] return[literal[true]] else begin[{] None end[}] while[call[Strings.isEmpty, parameter[assign[member[.specific], call[Strings.beforeLastPathComponent, parameter[member[.specific], literal['.']]]]]]] begin[{] if[binary_operation[call[user.checkIfAllowed, parameter[member[.value], binary_operation[binary_operation[member[.specific], +, literal["."]], +, member[ODatabaseSecurityResources.ALL]], member[.iOperation]]], !=, literal[null]]] begin[{] return[literal[true]] else begin[{] None end[}] end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[checkResource] operator[SEP] identifier[RequiredOrientResource] identifier[resource] , identifier[Action] identifier[action] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[resource] operator[SEP] identifier[action] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[action] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[OSecurityUser] identifier[user] operator[=] identifier[OrientDbWebSession] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getEffectiveUser] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[int] identifier[iOperation] operator[=] identifier[OrientPermission] operator[SEP] identifier[combinedPermission] operator[SEP] identifier[resource] operator[SEP] identifier[permissions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ORule] operator[SEP] identifier[ResourceGeneric] identifier[value] operator[=] identifier[OSecurityHelper] operator[SEP] identifier[getResourceGeneric] operator[SEP] identifier[resource] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[specific] operator[=] identifier[resource] operator[SEP] identifier[specific] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Strings] operator[SEP] identifier[isEmpty] operator[SEP] identifier[specific] operator[SEP] operator[SEP] identifier[specific] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[SEP] identifier[checkIfAllowed] operator[SEP] identifier[value] , identifier[specific] , identifier[iOperation] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[Strings] operator[SEP] identifier[isEmpty] operator[SEP] identifier[specific] operator[=] identifier[Strings] operator[SEP] identifier[beforeLastPathComponent] operator[SEP] identifier[specific] , literal[String] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[user] operator[SEP] identifier[checkIfAllowed] operator[SEP] identifier[value] , identifier[specific] operator[+] literal[String] operator[+] identifier[ODatabaseSecurityResources] operator[SEP] identifier[ALL] , identifier[iOperation] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static <T> ServiceController<T> getService(ServiceRegistry registry, ServiceName name) { return (ServiceController<T>) registry.getRequiredService(name); }
class class_name[name] begin[{] method[getService, return_type[type[ServiceController]], modifier[public static], parameter[registry, name]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRequiredService, postfix_operators=[], prefix_operators=[], qualifier=registry, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=ServiceController, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[ServiceController] operator[<] identifier[T] operator[>] identifier[getService] operator[SEP] identifier[ServiceRegistry] identifier[registry] , identifier[ServiceName] identifier[name] operator[SEP] { Keyword[return] operator[SEP] identifier[ServiceController] operator[<] identifier[T] operator[>] operator[SEP] identifier[registry] operator[SEP] identifier[getRequiredService] operator[SEP] identifier[name] operator[SEP] operator[SEP] }
ArrayTagSet addAll(Tag[] ts, int tsLength) { if (tsLength == 0) { return this; } else if (length == 0) { Arrays.sort(ts, 0, tsLength, TAG_COMPARATOR); int len = dedup(ts, 0, ts, 0, tsLength); return new ArrayTagSet(toStringArray(ts, len)); } else { String[] newTags = new String[(length + tsLength) * 2]; Arrays.sort(ts, 0, tsLength, TAG_COMPARATOR); int newLength = merge(newTags, tags, length, ts, tsLength); return new ArrayTagSet(newTags, newLength); } }
class class_name[name] begin[{] method[addAll, return_type[type[ArrayTagSet]], modifier[default], parameter[ts, tsLength]] begin[{] if[binary_operation[member[.tsLength], ==, literal[0]]] begin[{] return[THIS[]] else begin[{] if[binary_operation[member[.length], ==, literal[0]]] begin[{] call[Arrays.sort, parameter[member[.ts], literal[0], member[.tsLength], member[.TAG_COMPARATOR]]] local_variable[type[int], len] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=ts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toStringArray, 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=ArrayTagSet, sub_type=None))] else begin[{] local_variable[type[String], newTags] call[Arrays.sort, parameter[member[.ts], literal[0], member[.tsLength], member[.TAG_COMPARATOR]]] local_variable[type[int], newLength] return[ClassCreator(arguments=[MemberReference(member=newTags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newLength, 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=ArrayTagSet, sub_type=None))] end[}] end[}] end[}] END[}]
identifier[ArrayTagSet] identifier[addAll] operator[SEP] identifier[Tag] operator[SEP] operator[SEP] identifier[ts] , Keyword[int] identifier[tsLength] operator[SEP] { Keyword[if] operator[SEP] identifier[tsLength] operator[==] Other[0] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[ts] , Other[0] , identifier[tsLength] , identifier[TAG_COMPARATOR] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[dedup] operator[SEP] identifier[ts] , Other[0] , identifier[ts] , Other[0] , identifier[tsLength] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ArrayTagSet] operator[SEP] identifier[toStringArray] operator[SEP] identifier[ts] , identifier[len] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] operator[SEP] operator[SEP] identifier[newTags] operator[=] Keyword[new] identifier[String] operator[SEP] operator[SEP] identifier[length] operator[+] identifier[tsLength] operator[SEP] operator[*] Other[2] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[ts] , Other[0] , identifier[tsLength] , identifier[TAG_COMPARATOR] operator[SEP] operator[SEP] Keyword[int] identifier[newLength] operator[=] identifier[merge] operator[SEP] identifier[newTags] , identifier[tags] , identifier[length] , identifier[ts] , identifier[tsLength] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ArrayTagSet] operator[SEP] identifier[newTags] , identifier[newLength] operator[SEP] operator[SEP] } }
public static <V> Key<V> key( com.google.appengine.api.datastore.Key raw ) { if ( raw == null ) { return null; } else { return new Key<V>( raw ); } }
class class_name[name] begin[{] method[key, return_type[type[Key]], modifier[public static], parameter[raw]] begin[{] if[binary_operation[member[.raw], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] return[ClassCreator(arguments=[MemberReference(member=raw, 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=V, sub_type=None))], dimensions=None, name=Key, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[V] operator[>] identifier[Key] operator[<] identifier[V] operator[>] identifier[key] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[appengine] operator[SEP] identifier[api] operator[SEP] identifier[datastore] operator[SEP] identifier[Key] identifier[raw] operator[SEP] { Keyword[if] operator[SEP] identifier[raw] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[Key] operator[<] identifier[V] operator[>] operator[SEP] identifier[raw] operator[SEP] operator[SEP] } }
private String getNamespace(final Attr attribute) { final Element parent = attribute.getOwnerElement(); return parent.getAttribute(NAMESPACE); }
class class_name[name] begin[{] method[getNamespace, return_type[type[String]], modifier[private], parameter[attribute]] begin[{] local_variable[type[Element], parent] return[call[parent.getAttribute, parameter[member[.NAMESPACE]]]] end[}] END[}]
Keyword[private] identifier[String] identifier[getNamespace] operator[SEP] Keyword[final] identifier[Attr] identifier[attribute] operator[SEP] { Keyword[final] identifier[Element] identifier[parent] operator[=] identifier[attribute] operator[SEP] identifier[getOwnerElement] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[parent] operator[SEP] identifier[getAttribute] operator[SEP] identifier[NAMESPACE] operator[SEP] operator[SEP] }
public KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags) { return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags).toBlocking().single().body(); }
class class_name[name] begin[{] method[updateKey, return_type[type[KeyBundle]], modifier[public], parameter[vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags]] begin[{] return[call[.updateKeyWithServiceResponseAsync, parameter[member[.vaultBaseUrl], member[.keyName], member[.keyVersion], member[.keyOps], member[.keyAttributes], member[.tags]]]] end[}] END[}]
Keyword[public] identifier[KeyBundle] identifier[updateKey] operator[SEP] identifier[String] identifier[vaultBaseUrl] , identifier[String] identifier[keyName] , identifier[String] identifier[keyVersion] , identifier[List] operator[<] identifier[JsonWebKeyOperation] operator[>] identifier[keyOps] , identifier[KeyAttributes] identifier[keyAttributes] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[tags] operator[SEP] { Keyword[return] identifier[updateKeyWithServiceResponseAsync] operator[SEP] identifier[vaultBaseUrl] , identifier[keyName] , identifier[keyVersion] , identifier[keyOps] , identifier[keyAttributes] , identifier[tags] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
@Override public void draw(@NonNull Canvas canvas) { pruneRipples(); // Clip to the dirty bounds, which will be the drawable bounds if we // have a mask or content and the ripple bounds if we're projecting. final Rect bounds = getDirtyBounds(); final int saveCount = canvas.save(); canvas.clipRect(bounds); drawContent(canvas); drawBackgroundAndRipples(canvas); canvas.restoreToCount(saveCount); }
class class_name[name] begin[{] method[draw, return_type[void], modifier[public], parameter[canvas]] begin[{] call[.pruneRipples, parameter[]] local_variable[type[Rect], bounds] local_variable[type[int], saveCount] call[canvas.clipRect, parameter[member[.bounds]]] call[.drawContent, parameter[member[.canvas]]] call[.drawBackgroundAndRipples, parameter[member[.canvas]]] call[canvas.restoreToCount, parameter[member[.saveCount]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[draw] operator[SEP] annotation[@] identifier[NonNull] identifier[Canvas] identifier[canvas] operator[SEP] { identifier[pruneRipples] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Rect] identifier[bounds] operator[=] identifier[getDirtyBounds] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[saveCount] operator[=] identifier[canvas] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] identifier[canvas] operator[SEP] identifier[clipRect] operator[SEP] identifier[bounds] operator[SEP] operator[SEP] identifier[drawContent] operator[SEP] identifier[canvas] operator[SEP] operator[SEP] identifier[drawBackgroundAndRipples] operator[SEP] identifier[canvas] operator[SEP] operator[SEP] identifier[canvas] operator[SEP] identifier[restoreToCount] operator[SEP] identifier[saveCount] operator[SEP] operator[SEP] }
protected void set(V v) { if (U.compareAndSwapInt(this, STATE, NEW, COMPLETING)) { outcome = v; U.putOrderedInt(this, STATE, NORMAL); // final state finishCompletion(); } }
class class_name[name] begin[{] method[set, return_type[void], modifier[protected], parameter[v]] begin[{] if[call[U.compareAndSwapInt, parameter[THIS[], member[.STATE], member[.NEW], member[.COMPLETING]]]] begin[{] assign[member[.outcome], member[.v]] call[U.putOrderedInt, parameter[THIS[], member[.STATE], member[.NORMAL]]] call[.finishCompletion, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[set] operator[SEP] identifier[V] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[U] operator[SEP] identifier[compareAndSwapInt] operator[SEP] Keyword[this] , identifier[STATE] , identifier[NEW] , identifier[COMPLETING] operator[SEP] operator[SEP] { identifier[outcome] operator[=] identifier[v] operator[SEP] identifier[U] operator[SEP] identifier[putOrderedInt] operator[SEP] Keyword[this] , identifier[STATE] , identifier[NORMAL] operator[SEP] operator[SEP] identifier[finishCompletion] operator[SEP] operator[SEP] operator[SEP] } }
protected Object createJavaObjectInstance(Class clazz, JsonObject jsonObj) { final boolean useMapsLocal = useMaps; String type = jsonObj.type; // We can't set values to an Object, so well try to use the contained type instead if ("java.lang.Object".equals(type)) { Object value = jsonObj.get("value"); if (jsonObj.keySet().size() == 1 && value != null) { type = value.getClass().getName(); } } Object mate; // @type always takes precedence over inferred Java (clazz) type. if (type != null) { // @type is explicitly set, use that as it always takes precedence Class c; try { c = MetaUtils.classForName(type, reader.getClassLoader(), failOnUnknownType); } catch (Exception e) { if (useMapsLocal) { jsonObj.type = null; jsonObj.target = null; return jsonObj; } else { String name = clazz == null ? "null" : clazz.getName(); throw new JsonIoException("Unable to create class: " + name, e); } } if (c.isArray()) { // Handle [] Object[] items = jsonObj.getArray(); int size = (items == null) ? 0 : items.length; if (c == char[].class) { jsonObj.moveCharsToMate(); mate = jsonObj.target; } else { mate = Array.newInstance(c.getComponentType(), size); } } else { // Handle regular field.object reference if (MetaUtils.isPrimitive(c)) { mate = MetaUtils.convert(c, jsonObj.get("value")); } else if (c == Class.class) { mate = MetaUtils.classForName((String) jsonObj.get("value"), reader.getClassLoader()); } else if (c.isEnum()) { mate = getEnum(c, jsonObj); } else if (Enum.class.isAssignableFrom(c)) // anonymous subclass of an enum { mate = getEnum(c.getSuperclass(), jsonObj); } else if (EnumSet.class.isAssignableFrom(c)) { mate = getEnumSet(c, jsonObj); } else if ((mate = coerceCertainTypes(c.getName())) != null) { // if coerceCertainTypes() returns non-null, it did the work } else { mate = newInstance(c, jsonObj); } } } else { // @type, not specified, figure out appropriate type Object[] items = jsonObj.getArray(); // if @items is specified, it must be an [] type. // if clazz.isArray(), then it must be an [] type. if (clazz.isArray() || (items != null && clazz == Object.class && !jsonObj.containsKey("@keys"))) { int size = (items == null) ? 0 : items.length; mate = Array.newInstance(clazz.isArray() ? clazz.getComponentType() : Object.class, size); } else if (clazz.isEnum()) { mate = getEnum(clazz, jsonObj); } else if (Enum.class.isAssignableFrom(clazz)) // anonymous subclass of an enum { mate = getEnum(clazz.getSuperclass(), jsonObj); } else if (EnumSet.class.isAssignableFrom(clazz)) // anonymous subclass of an enum { mate = getEnumSet(clazz, jsonObj); } else if ((mate = coerceCertainTypes(clazz.getName())) != null) { // if coerceCertainTypes() returns non-null, it did the work } else if (clazz == Object.class && !useMapsLocal) { if (unknownClass == null) { mate = new JsonObject(); ((JsonObject)mate).type = Map.class.getName(); } else if (unknownClass instanceof String) { mate = newInstance(MetaUtils.classForName(((String)unknownClass).trim(), reader.getClassLoader()), jsonObj); } else { throw new JsonIoException("Unable to determine object type at column: " + jsonObj.col + ", line: " + jsonObj.line + ", content: " + jsonObj); } } else { mate = newInstance(clazz, jsonObj); } } jsonObj.target = mate; return jsonObj.target; }
class class_name[name] begin[{] method[createJavaObjectInstance, return_type[type[Object]], modifier[protected], parameter[clazz, jsonObj]] begin[{] local_variable[type[boolean], useMapsLocal] local_variable[type[String], type] if[literal["java.lang.Object"]] begin[{] local_variable[type[Object], value] if[binary_operation[binary_operation[call[jsonObj.keySet, parameter[]], ==, literal[1]], &&, binary_operation[member[.value], !=, literal[null]]]] begin[{] assign[member[.type], call[value.getClass, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[Object], mate] if[binary_operation[member[.type], !=, literal[null]]] begin[{] local_variable[type[Class], c] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), MemberReference(member=failOnUnknownType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=classForName, postfix_operators=[], prefix_operators=[], qualifier=MetaUtils, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[IfStatement(condition=MemberReference(member=useMapsLocal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to create class: "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonIoException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=jsonObj, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=jsonObj, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ReturnStatement(expression=MemberReference(member=jsonObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[call[c.isArray, parameter[]]] begin[{] local_variable[type[Object], items] local_variable[type[int], size] if[binary_operation[member[.c], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=char))]] begin[{] call[jsonObj.moveCharsToMate, parameter[]] assign[member[.mate], member[jsonObj.target]] else begin[{] assign[member[.mate], call[Array.newInstance, parameter[call[c.getComponentType, parameter[]], member[.size]]]] end[}] else begin[{] if[call[MetaUtils.isPrimitive, parameter[member[.c]]]] begin[{] assign[member[.mate], call[MetaUtils.convert, parameter[member[.c], call[jsonObj.get, parameter[literal["value"]]]]]] else begin[{] if[binary_operation[member[.c], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))]] begin[{] assign[member[.mate], call[MetaUtils.classForName, parameter[Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value")], member=get, postfix_operators=[], prefix_operators=[], qualifier=jsonObj, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), call[reader.getClassLoader, parameter[]]]]] else begin[{] if[call[c.isEnum, parameter[]]] begin[{] assign[member[.mate], call[.getEnum, parameter[member[.c], member[.jsonObj]]]] else begin[{] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Enum, sub_type=None))] begin[{] assign[member[.mate], call[.getEnum, parameter[call[c.getSuperclass, parameter[]], member[.jsonObj]]]] else begin[{] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=EnumSet, sub_type=None))] begin[{] assign[member[.mate], call[.getEnumSet, parameter[member[.c], member[.jsonObj]]]] else begin[{] if[binary_operation[assign[member[.mate], call[.coerceCertainTypes, parameter[call[c.getName, parameter[]]]]], !=, literal[null]]] begin[{] else begin[{] assign[member[.mate], call[.newInstance, parameter[member[.c], member[.jsonObj]]]] end[}] end[}] end[}] end[}] end[}] end[}] end[}] else begin[{] local_variable[type[Object], items] if[binary_operation[call[clazz.isArray, parameter[]], ||, binary_operation[binary_operation[binary_operation[member[.items], !=, literal[null]], &&, binary_operation[member[.clazz], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]], &&, call[jsonObj.containsKey, parameter[literal["@keys"]]]]]] begin[{] local_variable[type[int], size] assign[member[.mate], call[Array.newInstance, parameter[TernaryExpression(condition=MethodInvocation(arguments=[], member=isArray, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), if_false=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), if_true=MethodInvocation(arguments=[], member=getComponentType, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None)), member[.size]]]] else begin[{] if[call[clazz.isEnum, parameter[]]] begin[{] assign[member[.mate], call[.getEnum, parameter[member[.clazz], member[.jsonObj]]]] else begin[{] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Enum, sub_type=None))] begin[{] assign[member[.mate], call[.getEnum, parameter[call[clazz.getSuperclass, parameter[]], member[.jsonObj]]]] else begin[{] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=EnumSet, sub_type=None))] begin[{] assign[member[.mate], call[.getEnumSet, parameter[member[.clazz], member[.jsonObj]]]] else begin[{] if[binary_operation[assign[member[.mate], call[.coerceCertainTypes, parameter[call[clazz.getName, parameter[]]]]], !=, literal[null]]] begin[{] else begin[{] if[binary_operation[binary_operation[member[.clazz], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], &&, member[.useMapsLocal]]] begin[{] if[binary_operation[member[.unknownClass], ==, literal[null]]] begin[{] assign[member[.mate], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None))] assign[Cast(expression=MemberReference(member=mate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, 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=Map, sub_type=None))] else begin[{] if[binary_operation[member[.unknownClass], instanceof, type[String]]] begin[{] assign[member[.mate], call[.newInstance, parameter[call[MetaUtils.classForName, parameter[Cast(expression=MemberReference(member=unknownClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), call[reader.getClassLoader, parameter[]]]], member[.jsonObj]]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to determine object type at column: "), operandr=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=jsonObj, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", line: "), operator=+), operandr=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=jsonObj, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", content: "), operator=+), operandr=MemberReference(member=jsonObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonIoException, sub_type=None)), label=None) end[}] end[}] else begin[{] assign[member[.mate], call[.newInstance, parameter[member[.clazz], member[.jsonObj]]]] end[}] end[}] end[}] end[}] end[}] end[}] end[}] assign[member[jsonObj.target], member[.mate]] return[member[jsonObj.target]] end[}] END[}]
Keyword[protected] identifier[Object] identifier[createJavaObjectInstance] operator[SEP] identifier[Class] identifier[clazz] , identifier[JsonObject] identifier[jsonObj] operator[SEP] { Keyword[final] Keyword[boolean] identifier[useMapsLocal] operator[=] identifier[useMaps] operator[SEP] identifier[String] identifier[type] operator[=] identifier[jsonObj] operator[SEP] identifier[type] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[Object] identifier[value] operator[=] identifier[jsonObj] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jsonObj] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[value] operator[!=] Other[null] operator[SEP] { identifier[type] operator[=] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] } } identifier[Object] identifier[mate] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[SEP] { identifier[Class] identifier[c] operator[SEP] Keyword[try] { identifier[c] operator[=] identifier[MetaUtils] operator[SEP] identifier[classForName] operator[SEP] identifier[type] , identifier[reader] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] , identifier[failOnUnknownType] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[useMapsLocal] operator[SEP] { identifier[jsonObj] operator[SEP] identifier[type] operator[=] Other[null] operator[SEP] identifier[jsonObj] operator[SEP] identifier[target] operator[=] Other[null] operator[SEP] Keyword[return] identifier[jsonObj] operator[SEP] } Keyword[else] { identifier[String] identifier[name] operator[=] identifier[clazz] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[JsonIoException] operator[SEP] literal[String] operator[+] identifier[name] , identifier[e] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] operator[SEP] operator[SEP] identifier[items] operator[=] identifier[jsonObj] operator[SEP] identifier[getArray] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] operator[SEP] identifier[items] operator[==] Other[null] operator[SEP] operator[?] Other[0] operator[:] identifier[items] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] Keyword[char] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] { identifier[jsonObj] operator[SEP] identifier[moveCharsToMate] operator[SEP] operator[SEP] operator[SEP] identifier[mate] operator[=] identifier[jsonObj] operator[SEP] identifier[target] operator[SEP] } Keyword[else] { identifier[mate] operator[=] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[c] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] , identifier[size] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[MetaUtils] operator[SEP] identifier[isPrimitive] operator[SEP] identifier[c] operator[SEP] operator[SEP] { identifier[mate] operator[=] identifier[MetaUtils] operator[SEP] identifier[convert] operator[SEP] identifier[c] , identifier[jsonObj] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[Class] operator[SEP] Keyword[class] operator[SEP] { identifier[mate] operator[=] identifier[MetaUtils] operator[SEP] identifier[classForName] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[jsonObj] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] , identifier[reader] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[isEnum] operator[SEP] operator[SEP] operator[SEP] { identifier[mate] operator[=] identifier[getEnum] operator[SEP] identifier[c] , identifier[jsonObj] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Enum] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[c] operator[SEP] operator[SEP] { identifier[mate] operator[=] identifier[getEnum] operator[SEP] identifier[c] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] , identifier[jsonObj] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[EnumSet] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[c] operator[SEP] operator[SEP] { identifier[mate] operator[=] identifier[getEnumSet] operator[SEP] identifier[c] , identifier[jsonObj] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[mate] operator[=] identifier[coerceCertainTypes] operator[SEP] identifier[c] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { } Keyword[else] { identifier[mate] operator[=] identifier[newInstance] operator[SEP] identifier[c] , identifier[jsonObj] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[Object] operator[SEP] operator[SEP] identifier[items] operator[=] identifier[jsonObj] operator[SEP] identifier[getArray] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clazz] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[items] operator[!=] Other[null] operator[&&] identifier[clazz] operator[==] identifier[Object] operator[SEP] Keyword[class] operator[&&] operator[!] identifier[jsonObj] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[size] operator[=] operator[SEP] identifier[items] operator[==] Other[null] operator[SEP] operator[?] Other[0] operator[:] identifier[items] operator[SEP] identifier[length] operator[SEP] identifier[mate] operator[=] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[clazz] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[?] identifier[clazz] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] operator[:] identifier[Object] operator[SEP] Keyword[class] , identifier[size] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[clazz] operator[SEP] identifier[isEnum] operator[SEP] operator[SEP] operator[SEP] { identifier[mate] operator[=] identifier[getEnum] operator[SEP] identifier[clazz] , identifier[jsonObj] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Enum] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] { identifier[mate] operator[=] identifier[getEnum] operator[SEP] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] , identifier[jsonObj] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[EnumSet] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] { identifier[mate] operator[=] identifier[getEnumSet] operator[SEP] identifier[clazz] , identifier[jsonObj] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[mate] operator[=] identifier[coerceCertainTypes] operator[SEP] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[clazz] operator[==] identifier[Object] operator[SEP] Keyword[class] operator[&&] operator[!] identifier[useMapsLocal] operator[SEP] { Keyword[if] operator[SEP] identifier[unknownClass] operator[==] Other[null] operator[SEP] { identifier[mate] operator[=] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[JsonObject] operator[SEP] identifier[mate] operator[SEP] operator[SEP] identifier[type] operator[=] identifier[Map] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[unknownClass] Keyword[instanceof] identifier[String] operator[SEP] { identifier[mate] operator[=] identifier[newInstance] operator[SEP] identifier[MetaUtils] operator[SEP] identifier[classForName] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[unknownClass] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , identifier[reader] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] , identifier[jsonObj] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[JsonIoException] operator[SEP] literal[String] operator[+] identifier[jsonObj] operator[SEP] identifier[col] operator[+] literal[String] operator[+] identifier[jsonObj] operator[SEP] identifier[line] operator[+] literal[String] operator[+] identifier[jsonObj] operator[SEP] operator[SEP] } } Keyword[else] { identifier[mate] operator[=] identifier[newInstance] operator[SEP] identifier[clazz] , identifier[jsonObj] operator[SEP] operator[SEP] } } identifier[jsonObj] operator[SEP] identifier[target] operator[=] identifier[mate] operator[SEP] Keyword[return] identifier[jsonObj] operator[SEP] identifier[target] operator[SEP] }
@Override public List<List<LogTrace<LogEntry>>> parse(File file, ParsingMode parsingMode) throws ParameterException, ParserException { Validate.noDirectory(file); if (!file.canRead()) throw new ParameterException("Unable to read input file!"); try { try { InputStream is = new FileInputStream(file); return parse(is, parsingMode); } catch (FileNotFoundException | ParameterException | ParserException e) { throw new ParserException("Exception while parsing with OpenXES: " + e.getMessage()); } } catch (Exception e) { throw new ParserException("Error while parsing log with OpenXES-Parser: " + e.getMessage()); } }
class class_name[name] begin[{] method[parse, return_type[type[List]], modifier[public], parameter[file, parsingMode]] begin[{] call[Validate.noDirectory, parameter[member[.file]]] if[call[file.canRead, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to read input file!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParameterException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=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)), name=is)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parsingMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception while parsing with OpenXES: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, 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=ParserException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException', 'ParameterException', 'ParserException']))], finally_block=None, label=None, resources=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while parsing log with OpenXES-Parser: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, 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=ParserException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[List] operator[<] identifier[LogTrace] operator[<] identifier[LogEntry] operator[>] operator[>] operator[>] identifier[parse] operator[SEP] identifier[File] identifier[file] , identifier[ParsingMode] identifier[parsingMode] operator[SEP] Keyword[throws] identifier[ParameterException] , identifier[ParserException] { identifier[Validate] operator[SEP] identifier[noDirectory] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[file] operator[SEP] identifier[canRead] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ParameterException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { Keyword[try] { identifier[InputStream] identifier[is] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[return] identifier[parse] operator[SEP] identifier[is] , identifier[parsingMode] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] operator[|] identifier[ParameterException] operator[|] identifier[ParserException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ParserException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ParserException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public int getUnsignedPixelValue(WritableRaster raster, int x, int y) { short pixelValue = getPixelValue(raster, x, y); int unsignedPixelValue = getUnsignedPixelValue(pixelValue); return unsignedPixelValue; }
class class_name[name] begin[{] method[getUnsignedPixelValue, return_type[type[int]], modifier[public], parameter[raster, x, y]] begin[{] local_variable[type[short], pixelValue] local_variable[type[int], unsignedPixelValue] return[member[.unsignedPixelValue]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getUnsignedPixelValue] operator[SEP] identifier[WritableRaster] identifier[raster] , Keyword[int] identifier[x] , Keyword[int] identifier[y] operator[SEP] { Keyword[short] identifier[pixelValue] operator[=] identifier[getPixelValue] operator[SEP] identifier[raster] , identifier[x] , identifier[y] operator[SEP] operator[SEP] Keyword[int] identifier[unsignedPixelValue] operator[=] identifier[getUnsignedPixelValue] operator[SEP] identifier[pixelValue] operator[SEP] operator[SEP] Keyword[return] identifier[unsignedPixelValue] operator[SEP] }
protected void appendDefType(SolrQuery solrQuery, @Nullable String defType) { if (StringUtils.isNotBlank(defType)) { solrQuery.set("defType", defType); } }
class class_name[name] begin[{] method[appendDefType, return_type[void], modifier[protected], parameter[solrQuery, defType]] begin[{] if[call[StringUtils.isNotBlank, parameter[member[.defType]]]] begin[{] call[solrQuery.set, parameter[literal["defType"], member[.defType]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[appendDefType] operator[SEP] identifier[SolrQuery] identifier[solrQuery] , annotation[@] identifier[Nullable] identifier[String] identifier[defType] operator[SEP] { Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[defType] operator[SEP] operator[SEP] { identifier[solrQuery] operator[SEP] identifier[set] operator[SEP] literal[String] , identifier[defType] operator[SEP] operator[SEP] } }
private HtmlResponse asListHtml() { return asHtml(path_AdminGroup_AdminGroupJsp).renderWith(data -> { RenderDataUtil.register(data, "groupItems", groupService.getGroupList(groupPager)); // page navi }).useForm(SearchForm.class, setup -> { setup.setup(form -> { copyBeanToBean(groupPager, form, op -> op.include("id")); }); }); }
class class_name[name] begin[{] method[asListHtml, return_type[type[HtmlResponse]], modifier[private], parameter[]] begin[{] return[call[.asHtml, parameter[member[.path_AdminGroup_AdminGroupJsp]]]] end[}] END[}]
Keyword[private] identifier[HtmlResponse] identifier[asListHtml] operator[SEP] operator[SEP] { Keyword[return] identifier[asHtml] operator[SEP] identifier[path_AdminGroup_AdminGroupJsp] operator[SEP] operator[SEP] identifier[renderWith] operator[SEP] identifier[data] operator[->] { identifier[RenderDataUtil] operator[SEP] identifier[register] operator[SEP] identifier[data] , literal[String] , identifier[groupService] operator[SEP] identifier[getGroupList] operator[SEP] identifier[groupPager] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[useForm] operator[SEP] identifier[SearchForm] operator[SEP] Keyword[class] , identifier[setup] operator[->] { identifier[setup] operator[SEP] identifier[setup] operator[SEP] identifier[form] operator[->] { identifier[copyBeanToBean] operator[SEP] identifier[groupPager] , identifier[form] , identifier[op] operator[->] identifier[op] operator[SEP] identifier[include] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } operator[SEP] operator[SEP] }
public void updateLog(CmsDbContext dbc) throws CmsDataAccessException { synchronized (m_publishListUpdateLock) { if (m_log.isEmpty()) { return; } List<CmsLogEntry> log = new ArrayList<CmsLogEntry>(m_log); m_log.clear(); String logTableEnabledStr = (String)OpenCms.getRuntimeProperty(PARAM_LOG_TABLE_ENABLED); if (Boolean.parseBoolean(logTableEnabledStr)) { // defaults to 'false' if value not set m_projectDriver.log(dbc, log); } CmsLogToPublishListChangeConverter converter = new CmsLogToPublishListChangeConverter(); for (CmsLogEntry entry : log) { converter.add(entry); } m_projectDriver.deleteUserPublishListEntries(dbc, converter.getPublishListDeletions()); m_projectDriver.writeUserPublishListEntries(dbc, converter.getPublishListAdditions()); } }
class class_name[name] begin[{] method[updateLog, return_type[void], modifier[public], parameter[dbc]] begin[{] SYNCHRONIZED[member[.m_publishListUpdateLock]] BEGIN[{] if[call[m_log.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[List], log] call[m_log.clear, parameter[]] local_variable[type[String], logTableEnabledStr] if[call[Boolean.parseBoolean, parameter[member[.logTableEnabledStr]]]] begin[{] call[m_projectDriver.log, parameter[member[.dbc], member[.log]]] else begin[{] None end[}] local_variable[type[CmsLogToPublishListChangeConverter], converter] 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=converter, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsLogEntry, sub_type=None))), label=None) call[m_projectDriver.deleteUserPublishListEntries, parameter[member[.dbc], call[converter.getPublishListDeletions, parameter[]]]] call[m_projectDriver.writeUserPublishListEntries, parameter[member[.dbc], call[converter.getPublishListAdditions, parameter[]]]] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[updateLog] operator[SEP] identifier[CmsDbContext] identifier[dbc] operator[SEP] Keyword[throws] identifier[CmsDataAccessException] { Keyword[synchronized] operator[SEP] identifier[m_publishListUpdateLock] operator[SEP] { Keyword[if] operator[SEP] identifier[m_log] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[List] operator[<] identifier[CmsLogEntry] operator[>] identifier[log] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsLogEntry] operator[>] operator[SEP] identifier[m_log] operator[SEP] operator[SEP] identifier[m_log] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[logTableEnabledStr] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getRuntimeProperty] operator[SEP] identifier[PARAM_LOG_TABLE_ENABLED] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[logTableEnabledStr] operator[SEP] operator[SEP] { identifier[m_projectDriver] operator[SEP] identifier[log] operator[SEP] identifier[dbc] , identifier[log] operator[SEP] operator[SEP] } identifier[CmsLogToPublishListChangeConverter] identifier[converter] operator[=] Keyword[new] identifier[CmsLogToPublishListChangeConverter] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsLogEntry] identifier[entry] operator[:] identifier[log] operator[SEP] { identifier[converter] operator[SEP] identifier[add] operator[SEP] identifier[entry] operator[SEP] operator[SEP] } identifier[m_projectDriver] operator[SEP] identifier[deleteUserPublishListEntries] operator[SEP] identifier[dbc] , identifier[converter] operator[SEP] identifier[getPublishListDeletions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_projectDriver] operator[SEP] identifier[writeUserPublishListEntries] operator[SEP] identifier[dbc] , identifier[converter] operator[SEP] identifier[getPublishListAdditions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public void marshall(PutParameterRequest putParameterRequest, ProtocolMarshaller protocolMarshaller) { if (putParameterRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(putParameterRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(putParameterRequest.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(putParameterRequest.getValue(), VALUE_BINDING); protocolMarshaller.marshall(putParameterRequest.getType(), TYPE_BINDING); protocolMarshaller.marshall(putParameterRequest.getKeyId(), KEYID_BINDING); protocolMarshaller.marshall(putParameterRequest.getOverwrite(), OVERWRITE_BINDING); protocolMarshaller.marshall(putParameterRequest.getAllowedPattern(), ALLOWEDPATTERN_BINDING); protocolMarshaller.marshall(putParameterRequest.getTags(), TAGS_BINDING); protocolMarshaller.marshall(putParameterRequest.getTier(), TIER_BINDING); protocolMarshaller.marshall(putParameterRequest.getPolicies(), POLICIES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[putParameterRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.putParameterRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=putParameterRequest, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDescription, postfix_operators=[], prefix_operators=[], qualifier=putParameterRequest, selectors=[], type_arguments=None), MemberReference(member=DESCRIPTION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=putParameterRequest, selectors=[], type_arguments=None), MemberReference(member=VALUE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=putParameterRequest, selectors=[], type_arguments=None), MemberReference(member=TYPE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKeyId, postfix_operators=[], prefix_operators=[], qualifier=putParameterRequest, selectors=[], type_arguments=None), MemberReference(member=KEYID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOverwrite, postfix_operators=[], prefix_operators=[], qualifier=putParameterRequest, selectors=[], type_arguments=None), MemberReference(member=OVERWRITE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAllowedPattern, postfix_operators=[], prefix_operators=[], qualifier=putParameterRequest, selectors=[], type_arguments=None), MemberReference(member=ALLOWEDPATTERN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTags, postfix_operators=[], prefix_operators=[], qualifier=putParameterRequest, selectors=[], type_arguments=None), MemberReference(member=TAGS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTier, postfix_operators=[], prefix_operators=[], qualifier=putParameterRequest, selectors=[], type_arguments=None), MemberReference(member=TIER_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPolicies, postfix_operators=[], prefix_operators=[], qualifier=putParameterRequest, selectors=[], type_arguments=None), MemberReference(member=POLICIES_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[PutParameterRequest] identifier[putParameterRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[putParameterRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putParameterRequest] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putParameterRequest] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] , identifier[DESCRIPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putParameterRequest] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[VALUE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putParameterRequest] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[TYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putParameterRequest] operator[SEP] identifier[getKeyId] operator[SEP] operator[SEP] , identifier[KEYID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putParameterRequest] operator[SEP] identifier[getOverwrite] operator[SEP] operator[SEP] , identifier[OVERWRITE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putParameterRequest] operator[SEP] identifier[getAllowedPattern] operator[SEP] operator[SEP] , identifier[ALLOWEDPATTERN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putParameterRequest] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] , identifier[TAGS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putParameterRequest] operator[SEP] identifier[getTier] operator[SEP] operator[SEP] , identifier[TIER_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putParameterRequest] operator[SEP] identifier[getPolicies] operator[SEP] operator[SEP] , identifier[POLICIES_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private String generateSilientCheckpointId() { byte[] randomBytes = new byte[32]; ThreadLocalRandom.current().nextBytes(randomBytes); return Base64.getEncoder().encodeToString(randomBytes) + SILENT; }
class class_name[name] begin[{] method[generateSilientCheckpointId, return_type[type[String]], modifier[private], parameter[]] begin[{] local_variable[type[byte], randomBytes] call[ThreadLocalRandom.current, parameter[]] return[binary_operation[call[Base64.getEncoder, parameter[]], +, member[.SILENT]]] end[}] END[}]
Keyword[private] identifier[String] identifier[generateSilientCheckpointId] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[randomBytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[32] operator[SEP] operator[SEP] identifier[ThreadLocalRandom] operator[SEP] identifier[current] operator[SEP] operator[SEP] operator[SEP] identifier[nextBytes] operator[SEP] identifier[randomBytes] operator[SEP] operator[SEP] Keyword[return] identifier[Base64] operator[SEP] identifier[getEncoder] operator[SEP] operator[SEP] operator[SEP] identifier[encodeToString] operator[SEP] identifier[randomBytes] operator[SEP] operator[+] identifier[SILENT] operator[SEP] }
private void createMaxp(FontFileReader in, int size) throws IOException { TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("maxp"); if (entry != null) { pad4(); seekTab(in, "maxp", 0); System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()), 0, output, currentPos, (int)entry.getLength()); writeUShort(currentPos + 4, size); int checksum = getCheckSum(currentPos, (int)entry.getLength()); writeULong(maxpDirOffset, checksum); writeULong(maxpDirOffset + 4, currentPos); writeULong(maxpDirOffset + 8, (int)entry.getLength()); currentPos += (int)entry.getLength(); realSize += (int)entry.getLength(); } else { throw new IOException("Can't find maxp table"); } }
class class_name[name] begin[{] method[createMaxp, return_type[void], modifier[private], parameter[in, size]] begin[{] local_variable[type[TTFDirTabEntry], entry] if[binary_operation[member[.entry], !=, literal[null]]] begin[{] call[.pad4, parameter[]] call[.seekTab, parameter[member[.in], literal["maxp"], literal[0]]] call[System.arraycopy, parameter[call[in.getBytes, parameter[Cast(expression=MethodInvocation(arguments=[], member=getOffset, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), Cast(expression=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]], literal[0], member[.output], member[.currentPos], Cast(expression=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]] call[.writeUShort, parameter[binary_operation[member[.currentPos], +, literal[4]], member[.size]]] local_variable[type[int], checksum] call[.writeULong, parameter[member[.maxpDirOffset], member[.checksum]]] call[.writeULong, parameter[binary_operation[member[.maxpDirOffset], +, literal[4]], member[.currentPos]]] call[.writeULong, parameter[binary_operation[member[.maxpDirOffset], +, literal[8]], Cast(expression=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]] assign[member[.currentPos], Cast(expression=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] assign[member[.realSize], Cast(expression=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't find maxp table")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[createMaxp] operator[SEP] identifier[FontFileReader] identifier[in] , Keyword[int] identifier[size] operator[SEP] Keyword[throws] identifier[IOException] { identifier[TTFDirTabEntry] identifier[entry] operator[=] operator[SEP] identifier[TTFDirTabEntry] operator[SEP] identifier[dirTabs] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entry] operator[!=] Other[null] operator[SEP] { identifier[pad4] operator[SEP] operator[SEP] operator[SEP] identifier[seekTab] operator[SEP] identifier[in] , literal[String] , Other[0] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[in] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[entry] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] , operator[SEP] Keyword[int] operator[SEP] identifier[entry] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] , Other[0] , identifier[output] , identifier[currentPos] , operator[SEP] Keyword[int] operator[SEP] identifier[entry] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writeUShort] operator[SEP] identifier[currentPos] operator[+] Other[4] , identifier[size] operator[SEP] operator[SEP] Keyword[int] identifier[checksum] operator[=] identifier[getCheckSum] operator[SEP] identifier[currentPos] , operator[SEP] Keyword[int] operator[SEP] identifier[entry] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writeULong] operator[SEP] identifier[maxpDirOffset] , identifier[checksum] operator[SEP] operator[SEP] identifier[writeULong] operator[SEP] identifier[maxpDirOffset] operator[+] Other[4] , identifier[currentPos] operator[SEP] operator[SEP] identifier[writeULong] operator[SEP] identifier[maxpDirOffset] operator[+] Other[8] , operator[SEP] Keyword[int] operator[SEP] identifier[entry] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[currentPos] operator[+=] operator[SEP] Keyword[int] operator[SEP] identifier[entry] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[realSize] operator[+=] operator[SEP] Keyword[int] operator[SEP] identifier[entry] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public List<TProtocol> amendMissingRequiredFields(StructType recordThriftType) throws TException { Iterator<TProtocol> protocolIter = rootEvents.iterator(); checkStruct(protocolIter, recordThriftType); return fixedEvents; }
class class_name[name] begin[{] method[amendMissingRequiredFields, return_type[type[List]], modifier[public], parameter[recordThriftType]] begin[{] local_variable[type[Iterator], protocolIter] call[.checkStruct, parameter[member[.protocolIter], member[.recordThriftType]]] return[member[.fixedEvents]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[TProtocol] operator[>] identifier[amendMissingRequiredFields] operator[SEP] identifier[StructType] identifier[recordThriftType] operator[SEP] Keyword[throws] identifier[TException] { identifier[Iterator] operator[<] identifier[TProtocol] operator[>] identifier[protocolIter] operator[=] identifier[rootEvents] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[checkStruct] operator[SEP] identifier[protocolIter] , identifier[recordThriftType] operator[SEP] operator[SEP] Keyword[return] identifier[fixedEvents] operator[SEP] }
public WebhookMessageBuilder setContent(String content) { Checks.check(content == null || content.length() <= 2000, "Content may not exceed 2000 characters!"); if (content != null) this.content.replace(0, content.length(), content); else this.content.setLength(0); return this; }
class class_name[name] begin[{] method[setContent, return_type[type[WebhookMessageBuilder]], modifier[public], parameter[content]] begin[{] call[Checks.check, parameter[binary_operation[binary_operation[member[.content], ==, literal[null]], ||, binary_operation[call[content.length, parameter[]], <=, literal[2000]]], literal["Content may not exceed 2000 characters!"]]] if[binary_operation[member[.content], !=, literal[null]]] begin[{] THIS[member[None.content]call[None.replace, parameter[literal[0], call[content.length, parameter[]], member[.content]]]] else begin[{] THIS[member[None.content]call[None.setLength, parameter[literal[0]]]] end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[WebhookMessageBuilder] identifier[setContent] operator[SEP] identifier[String] identifier[content] operator[SEP] { identifier[Checks] operator[SEP] identifier[check] operator[SEP] identifier[content] operator[==] Other[null] operator[||] identifier[content] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<=] Other[2000] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[content] operator[!=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[content] operator[SEP] identifier[replace] operator[SEP] Other[0] , identifier[content] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[content] operator[SEP] operator[SEP] Keyword[else] Keyword[this] operator[SEP] identifier[content] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static File getRelativePath(final File parent, final String... folders) { return getRelativePathTo(parent, Arrays.asList(folders)); }
class class_name[name] begin[{] method[getRelativePath, return_type[type[File]], modifier[public static], parameter[parent, folders]] begin[{] return[call[.getRelativePathTo, parameter[member[.parent], call[Arrays.asList, parameter[member[.folders]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[File] identifier[getRelativePath] operator[SEP] Keyword[final] identifier[File] identifier[parent] , Keyword[final] identifier[String] operator[...] identifier[folders] operator[SEP] { Keyword[return] identifier[getRelativePathTo] operator[SEP] identifier[parent] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[folders] operator[SEP] operator[SEP] operator[SEP] }
public static byte[] getBytesFor(String name, Object obj) { if(obj == null) throw new NullPointerException("obj is null"); return getBytesFor(name,obj.getClass()); }
class class_name[name] begin[{] method[getBytesFor, return_type[type[byte]], modifier[public static], parameter[name, obj]] begin[{] if[binary_operation[member[.obj], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="obj is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] return[call[.getBytesFor, parameter[member[.name], call[obj.getClass, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[getBytesFor] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[obj] operator[SEP] { Keyword[if] operator[SEP] identifier[obj] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[getBytesFor] operator[SEP] identifier[name] , identifier[obj] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void addInsideAFieldLayoutExamples() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect inside a WFieldLayout")); add(new ExplanatoryText("When a WCheckBoxSelect is inside a WField its label is exposed in a way which appears and behaves like a regular " + "HTML label. This allows WCheckBoxSelects to be used in a layout with simple form controls (such as WTextField) and produce a " + "consistent and predicatable interface. The third example in this set uses a null label and a toolTip to hide the labelling " + "element. This can lead to user confusion and is not recommended.")); WFieldLayout layout = new WFieldLayout(); layout.setLabelWidth(25); add(layout); String[] options = new String[]{"Dog", "Cat", "Bird", "Turtle"}; WCheckBoxSelect select = new WCheckBoxSelect(options); layout.addField("Select some animals", select); String[] options2 = new String[]{"Parrot", "Galah", "Cockatoo", "Lyre"}; select = new WCheckBoxSelect(options2); layout.addField("Select some birds", select); select.setFrameless(true); // a tooltip can be used as a label stand-in even in a WField String[] options3 = new String[]{"Carrot", "Beet", "Brocolli", "Bacon - the perfect vegetable"}; select = new WCheckBoxSelect(options3); layout.addField((WLabel) null, select); select.setToolTip("Veggies"); select = new WCheckBoxSelect("australian_state"); layout.addField("Select a state", select).getLabel().setHint("This is an ajax trigger"); add(new WAjaxControl(select, layout)); }
class class_name[name] begin[{] method[addInsideAFieldLayoutExamples, return_type[void], modifier[private], parameter[]] begin[{] call[.add, parameter[ClassCreator(arguments=[MemberReference(member=H3, postfix_operators=[], prefix_operators=[], qualifier=HeadingLevel, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="WCheckBoxSelect inside a WFieldLayout")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WHeading, sub_type=None))]] call[.add, parameter[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="When a WCheckBoxSelect is inside a WField its label is exposed in a way which appears and behaves like a regular "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="HTML label. This allows WCheckBoxSelects to be used in a layout with simple form controls (such as WTextField) and produce a "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="consistent and predicatable interface. The third example in this set uses a null label and a toolTip to hide the labelling "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="element. This can lead to user confusion and is not recommended."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExplanatoryText, sub_type=None))]] local_variable[type[WFieldLayout], layout] call[layout.setLabelWidth, parameter[literal[25]]] call[.add, parameter[member[.layout]]] local_variable[type[String], options] local_variable[type[WCheckBoxSelect], select] call[layout.addField, parameter[literal["Select some animals"], member[.select]]] local_variable[type[String], options2] assign[member[.select], ClassCreator(arguments=[MemberReference(member=options2, 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=WCheckBoxSelect, sub_type=None))] call[layout.addField, parameter[literal["Select some birds"], member[.select]]] call[select.setFrameless, parameter[literal[true]]] local_variable[type[String], options3] assign[member[.select], ClassCreator(arguments=[MemberReference(member=options3, 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=WCheckBoxSelect, sub_type=None))] call[layout.addField, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=WLabel, sub_type=None)), member[.select]]] call[select.setToolTip, parameter[literal["Veggies"]]] assign[member[.select], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="australian_state")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WCheckBoxSelect, sub_type=None))] call[layout.addField, parameter[literal["Select a state"], member[.select]]] call[.add, parameter[ClassCreator(arguments=[MemberReference(member=select, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=layout, 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=WAjaxControl, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addInsideAFieldLayoutExamples] operator[SEP] operator[SEP] { identifier[add] operator[SEP] Keyword[new] identifier[WHeading] operator[SEP] identifier[HeadingLevel] operator[SEP] identifier[H3] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ExplanatoryText] operator[SEP] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[WFieldLayout] identifier[layout] operator[=] Keyword[new] identifier[WFieldLayout] operator[SEP] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[setLabelWidth] operator[SEP] Other[25] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[layout] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[options] operator[=] Keyword[new] identifier[String] operator[SEP] operator[SEP] { literal[String] , literal[String] , literal[String] , literal[String] } operator[SEP] identifier[WCheckBoxSelect] identifier[select] operator[=] Keyword[new] identifier[WCheckBoxSelect] operator[SEP] identifier[options] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[addField] operator[SEP] literal[String] , identifier[select] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[options2] operator[=] Keyword[new] identifier[String] operator[SEP] operator[SEP] { literal[String] , literal[String] , literal[String] , literal[String] } operator[SEP] identifier[select] operator[=] Keyword[new] identifier[WCheckBoxSelect] operator[SEP] identifier[options2] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[addField] operator[SEP] literal[String] , identifier[select] operator[SEP] operator[SEP] identifier[select] operator[SEP] identifier[setFrameless] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[options3] operator[=] Keyword[new] identifier[String] operator[SEP] operator[SEP] { literal[String] , literal[String] , literal[String] , literal[String] } operator[SEP] identifier[select] operator[=] Keyword[new] identifier[WCheckBoxSelect] operator[SEP] identifier[options3] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[addField] operator[SEP] operator[SEP] identifier[WLabel] operator[SEP] Other[null] , identifier[select] operator[SEP] operator[SEP] identifier[select] operator[SEP] identifier[setToolTip] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[select] operator[=] Keyword[new] identifier[WCheckBoxSelect] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[addField] operator[SEP] literal[String] , identifier[select] operator[SEP] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP] identifier[setHint] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WAjaxControl] operator[SEP] identifier[select] , identifier[layout] operator[SEP] operator[SEP] operator[SEP] }
public Object doRemoteCommand(String strCommand, Map<String, Object> properties) { if (SET_DEFAULT_COMMAND.equalsIgnoreCase(strCommand)) if (properties != null) if (properties.get(DBConstants.SYSTEM_NAME) != null) { if (this.getTask() != null) if (this.getTask().getApplication() instanceof BaseApplication) if (((BaseApplication)this.getTask().getApplication()).getEnvironment() != null) { String systemName = properties.get(DBConstants.SYSTEM_NAME).toString(); Environment env = ((BaseApplication)this.getTask().getApplication()).getEnvironment(); properties.put(DBConstants.SYSTEM_NAME, "base"); BaseApplication app = new MainApplication(env, properties, null); try { Task task = new AutoTask(app, null, properties); RecordOwner recordOwner = new BaseProcess(task, null, properties); Menus menus = new Menus(recordOwner); menus.setKeyArea(Menus.CODE_KEY); menus.getField(Menus.CODE).setString(ResourceConstants.DEFAULT_RESOURCE); if (menus.seek(null)) menus.edit(); else menus.addNew(); menus.getField(Menus.CODE).setString(ResourceConstants.DEFAULT_RESOURCE); ((PropertiesField)menus.getField(Menus.PARAMS)).setProperty(DBConstants.SYSTEM_NAME, systemName); if (menus.getEditMode() == DBConstants.EDIT_ADD) menus.add(); else menus.set(); } catch (DBException e) { e.printStackTrace(); } finally { app.free(); } env.getDefaultApplication().getSystemRecordOwner().setProperty(DBConstants.DEFAULT_SYSTEM_NAME, systemName); return Boolean.TRUE; // Success } } return super.doRemoteCommand(strCommand, properties); }
class class_name[name] begin[{] method[doRemoteCommand, return_type[type[Object]], modifier[public], parameter[strCommand, properties]] begin[{] if[call[SET_DEFAULT_COMMAND.equalsIgnoreCase, parameter[member[.strCommand]]]] begin[{] if[binary_operation[member[.properties], !=, literal[null]]] begin[{] if[binary_operation[call[properties.get, parameter[member[DBConstants.SYSTEM_NAME]]], !=, literal[null]]] begin[{] if[binary_operation[THIS[call[None.getTask, parameter[]]], !=, literal[null]]] begin[{] if[binary_operation[THIS[call[None.getTask, parameter[]]call[None.getApplication, parameter[]]], instanceof, type[BaseApplication]]] begin[{] if[binary_operation[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getTask, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getApplication, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=BaseApplication, sub_type=None)), !=, literal[null]]] begin[{] local_variable[type[String], systemName] local_variable[type[Environment], env] call[properties.put, parameter[member[DBConstants.SYSTEM_NAME], literal["base"]]] local_variable[type[BaseApplication], app] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=app, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=properties, 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=AutoTask, sub_type=None)), name=task)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Task, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=task, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=properties, 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=BaseProcess, sub_type=None)), name=recordOwner)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RecordOwner, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=recordOwner, 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=Menus, sub_type=None)), name=menus)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Menus, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CODE_KEY, postfix_operators=[], prefix_operators=[], qualifier=Menus, selectors=[])], member=setKeyArea, postfix_operators=[], prefix_operators=[], qualifier=menus, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CODE, postfix_operators=[], prefix_operators=[], qualifier=Menus, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=menus, selectors=[MethodInvocation(arguments=[MemberReference(member=DEFAULT_RESOURCE, postfix_operators=[], prefix_operators=[], qualifier=ResourceConstants, selectors=[])], member=setString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=seek, postfix_operators=[], prefix_operators=[], qualifier=menus, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=addNew, postfix_operators=[], prefix_operators=[], qualifier=menus, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=edit, postfix_operators=[], prefix_operators=[], qualifier=menus, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CODE, postfix_operators=[], prefix_operators=[], qualifier=Menus, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=menus, selectors=[MethodInvocation(arguments=[MemberReference(member=DEFAULT_RESOURCE, postfix_operators=[], prefix_operators=[], qualifier=ResourceConstants, selectors=[])], member=setString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=PARAMS, postfix_operators=[], prefix_operators=[], qualifier=Menus, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=menus, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=PropertiesField, sub_type=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEditMode, postfix_operators=[], prefix_operators=[], qualifier=menus, selectors=[], type_arguments=None), operandr=MemberReference(member=EDIT_ADD, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[]), operator===), else_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=set, postfix_operators=[], prefix_operators=[], qualifier=menus, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=add, postfix_operators=[], prefix_operators=[], qualifier=menus, selectors=[], type_arguments=None), label=None))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DBException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=free, postfix_operators=[], prefix_operators=[], qualifier=app, selectors=[], type_arguments=None), label=None)], label=None, resources=None) call[env.getDefaultApplication, parameter[]] return[member[Boolean.TRUE]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] return[SuperMethodInvocation(arguments=[MemberReference(member=strCommand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doRemoteCommand, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
Keyword[public] identifier[Object] identifier[doRemoteCommand] operator[SEP] identifier[String] identifier[strCommand] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[SEP] { Keyword[if] operator[SEP] identifier[SET_DEFAULT_COMMAND] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[strCommand] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[get] operator[SEP] identifier[DBConstants] operator[SEP] identifier[SYSTEM_NAME] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] Keyword[instanceof] identifier[BaseApplication] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[BaseApplication] operator[SEP] Keyword[this] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getEnvironment] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[systemName] operator[=] identifier[properties] operator[SEP] identifier[get] operator[SEP] identifier[DBConstants] operator[SEP] identifier[SYSTEM_NAME] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[Environment] identifier[env] operator[=] operator[SEP] operator[SEP] identifier[BaseApplication] operator[SEP] Keyword[this] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getEnvironment] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[DBConstants] operator[SEP] identifier[SYSTEM_NAME] , literal[String] operator[SEP] operator[SEP] identifier[BaseApplication] identifier[app] operator[=] Keyword[new] identifier[MainApplication] operator[SEP] identifier[env] , identifier[properties] , Other[null] operator[SEP] operator[SEP] Keyword[try] { identifier[Task] identifier[task] operator[=] Keyword[new] identifier[AutoTask] operator[SEP] identifier[app] , Other[null] , identifier[properties] operator[SEP] operator[SEP] identifier[RecordOwner] identifier[recordOwner] operator[=] Keyword[new] identifier[BaseProcess] operator[SEP] identifier[task] , Other[null] , identifier[properties] operator[SEP] operator[SEP] identifier[Menus] identifier[menus] operator[=] Keyword[new] identifier[Menus] operator[SEP] identifier[recordOwner] operator[SEP] operator[SEP] identifier[menus] operator[SEP] identifier[setKeyArea] operator[SEP] identifier[Menus] operator[SEP] identifier[CODE_KEY] operator[SEP] operator[SEP] identifier[menus] operator[SEP] identifier[getField] operator[SEP] identifier[Menus] operator[SEP] identifier[CODE] operator[SEP] operator[SEP] identifier[setString] operator[SEP] identifier[ResourceConstants] operator[SEP] identifier[DEFAULT_RESOURCE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[menus] operator[SEP] identifier[seek] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[menus] operator[SEP] identifier[edit] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[menus] operator[SEP] identifier[addNew] operator[SEP] operator[SEP] operator[SEP] identifier[menus] operator[SEP] identifier[getField] operator[SEP] identifier[Menus] operator[SEP] identifier[CODE] operator[SEP] operator[SEP] identifier[setString] operator[SEP] identifier[ResourceConstants] operator[SEP] identifier[DEFAULT_RESOURCE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[PropertiesField] operator[SEP] identifier[menus] operator[SEP] identifier[getField] operator[SEP] identifier[Menus] operator[SEP] identifier[PARAMS] operator[SEP] operator[SEP] operator[SEP] identifier[setProperty] operator[SEP] identifier[DBConstants] operator[SEP] identifier[SYSTEM_NAME] , identifier[systemName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[menus] operator[SEP] identifier[getEditMode] operator[SEP] operator[SEP] operator[==] identifier[DBConstants] operator[SEP] identifier[EDIT_ADD] operator[SEP] identifier[menus] operator[SEP] identifier[add] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[menus] operator[SEP] identifier[set] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DBException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[app] operator[SEP] identifier[free] operator[SEP] operator[SEP] operator[SEP] } identifier[env] operator[SEP] identifier[getDefaultApplication] operator[SEP] operator[SEP] operator[SEP] identifier[getSystemRecordOwner] operator[SEP] operator[SEP] operator[SEP] identifier[setProperty] operator[SEP] identifier[DBConstants] operator[SEP] identifier[DEFAULT_SYSTEM_NAME] , identifier[systemName] operator[SEP] operator[SEP] Keyword[return] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] } } Keyword[return] Keyword[super] operator[SEP] identifier[doRemoteCommand] operator[SEP] identifier[strCommand] , identifier[properties] operator[SEP] operator[SEP] }
public OvhTask serviceName_lines_number_dslamPort_changeProfile_POST(String serviceName, String number, Long dslamProfileId) throws IOException { String qPath = "/xdsl/{serviceName}/lines/{number}/dslamPort/changeProfile"; StringBuilder sb = path(qPath, serviceName, number); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "dslamProfileId", dslamProfileId); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhTask.class); }
class class_name[name] begin[{] method[serviceName_lines_number_dslamPort_changeProfile_POST, return_type[type[OvhTask]], modifier[public], parameter[serviceName, number, dslamProfileId]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[HashMap], o] call[.addBody, parameter[member[.o], literal["dslamProfileId"], member[.dslamProfileId]]] 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_lines_number_dslamPort_changeProfile_POST] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[number] , identifier[Long] identifier[dslamProfileId] 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] , identifier[number] 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[dslamProfileId] 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] }
private OWLNamedIndividual assignName(OWLIndividual individual) { OWLNamedIndividual freshIndividual = getFreshIndividual(); Set<OWLIndividual> individuals = new HashSet<OWLIndividual>(); individuals.add(individual); individuals.add(freshIndividual); // Set<OWLAnnotation> axiomId = Collections.singleton(currentAxiomAnnotation); // OWLSameIndividualAxiom namingAxiom = dataFactory.getOWLSameIndividualAxiom(individuals, axiomId); OWLSameIndividualAxiom namingAxiom = dataFactory.getOWLSameIndividualAxiom(individuals); namingAxiom2ModalDepth.put(namingAxiom, modalDepth); transformedAxioms.add(namingAxiom); return freshIndividual; }
class class_name[name] begin[{] method[assignName, return_type[type[OWLNamedIndividual]], modifier[private], parameter[individual]] begin[{] local_variable[type[OWLNamedIndividual], freshIndividual] local_variable[type[Set], individuals] call[individuals.add, parameter[member[.individual]]] call[individuals.add, parameter[member[.freshIndividual]]] local_variable[type[OWLSameIndividualAxiom], namingAxiom] call[namingAxiom2ModalDepth.put, parameter[member[.namingAxiom], member[.modalDepth]]] call[transformedAxioms.add, parameter[member[.namingAxiom]]] return[member[.freshIndividual]] end[}] END[}]
Keyword[private] identifier[OWLNamedIndividual] identifier[assignName] operator[SEP] identifier[OWLIndividual] identifier[individual] operator[SEP] { identifier[OWLNamedIndividual] identifier[freshIndividual] operator[=] identifier[getFreshIndividual] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[OWLIndividual] operator[>] identifier[individuals] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[OWLIndividual] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[individuals] operator[SEP] identifier[add] operator[SEP] identifier[individual] operator[SEP] operator[SEP] identifier[individuals] operator[SEP] identifier[add] operator[SEP] identifier[freshIndividual] operator[SEP] operator[SEP] identifier[OWLSameIndividualAxiom] identifier[namingAxiom] operator[=] identifier[dataFactory] operator[SEP] identifier[getOWLSameIndividualAxiom] operator[SEP] identifier[individuals] operator[SEP] operator[SEP] identifier[namingAxiom2ModalDepth] operator[SEP] identifier[put] operator[SEP] identifier[namingAxiom] , identifier[modalDepth] operator[SEP] operator[SEP] identifier[transformedAxioms] operator[SEP] identifier[add] operator[SEP] identifier[namingAxiom] operator[SEP] operator[SEP] Keyword[return] identifier[freshIndividual] operator[SEP] }
@Override protected void visitLetContentNode(LetContentNode node) { String generatedVarName = node.getUniqueVarName(); visitLetParamContentNode(node, generatedVarName); templateTranslationContext .soyToJsVariableMappings() .put(node.getVarName(), id(generatedVarName)); }
class class_name[name] begin[{] method[visitLetContentNode, return_type[void], modifier[protected], parameter[node]] begin[{] local_variable[type[String], generatedVarName] call[.visitLetParamContentNode, parameter[member[.node], member[.generatedVarName]]] call[templateTranslationContext.soyToJsVariableMappings, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[visitLetContentNode] operator[SEP] identifier[LetContentNode] identifier[node] operator[SEP] { identifier[String] identifier[generatedVarName] operator[=] identifier[node] operator[SEP] identifier[getUniqueVarName] operator[SEP] operator[SEP] operator[SEP] identifier[visitLetParamContentNode] operator[SEP] identifier[node] , identifier[generatedVarName] operator[SEP] operator[SEP] identifier[templateTranslationContext] operator[SEP] identifier[soyToJsVariableMappings] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[node] operator[SEP] identifier[getVarName] operator[SEP] operator[SEP] , identifier[id] operator[SEP] identifier[generatedVarName] operator[SEP] operator[SEP] operator[SEP] }
public static <T extends Comparable<? super T>> Integer getSortOrder(final T first, final T second) { if (first == null && second == null) return null; if (first == null && second != null) return -1; if (first != null && second == null) return 1; return first.compareTo(second); }
class class_name[name] begin[{] method[getSortOrder, return_type[type[Integer]], modifier[public static], parameter[first, second]] begin[{] if[binary_operation[binary_operation[member[.first], ==, literal[null]], &&, binary_operation[member[.second], ==, literal[null]]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.first], ==, literal[null]], &&, binary_operation[member[.second], !=, literal[null]]]] begin[{] return[literal[1]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.first], !=, literal[null]], &&, binary_operation[member[.second], ==, literal[null]]]] begin[{] return[literal[1]] else begin[{] None end[}] return[call[first.compareTo, parameter[member[.second]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Comparable] operator[<] operator[?] Keyword[super] identifier[T] operator[>] operator[>] identifier[Integer] identifier[getSortOrder] operator[SEP] Keyword[final] identifier[T] identifier[first] , Keyword[final] identifier[T] identifier[second] operator[SEP] { Keyword[if] operator[SEP] identifier[first] operator[==] Other[null] operator[&&] identifier[second] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[first] operator[==] Other[null] operator[&&] identifier[second] operator[!=] Other[null] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[first] operator[!=] Other[null] operator[&&] identifier[second] operator[==] Other[null] operator[SEP] Keyword[return] Other[1] operator[SEP] Keyword[return] identifier[first] operator[SEP] identifier[compareTo] operator[SEP] identifier[second] operator[SEP] operator[SEP] }
public static Module module(final BeanContainer container) { checkNotNull(container); return (binder -> { binder.bind(BeanContainer.class).toInstance(container); binder.bind(MutableBeanLocator.class).toInstance(container.getBeanLocator()); }); }
class class_name[name] begin[{] method[module, return_type[type[Module]], modifier[public static], parameter[container]] begin[{] call[.checkNotNull, parameter[member[.container]]] return[LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BeanContainer, sub_type=None))], member=bind, postfix_operators=[], prefix_operators=[], qualifier=binder, selectors=[MethodInvocation(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MutableBeanLocator, sub_type=None))], member=bind, postfix_operators=[], prefix_operators=[], qualifier=binder, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBeanLocator, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None)], member=toInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], parameters=[MemberReference(member=binder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])] end[}] END[}]
Keyword[public] Keyword[static] identifier[Module] identifier[module] operator[SEP] Keyword[final] identifier[BeanContainer] identifier[container] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[container] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[binder] operator[->] { identifier[binder] operator[SEP] identifier[bind] operator[SEP] identifier[BeanContainer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[toInstance] operator[SEP] identifier[container] operator[SEP] operator[SEP] identifier[binder] operator[SEP] identifier[bind] operator[SEP] identifier[MutableBeanLocator] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[toInstance] operator[SEP] identifier[container] operator[SEP] identifier[getBeanLocator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] }
public List findByQuery(String query, Map<Parameter, Object> parameterMap, int firstResult, int maxResult) { s = getStatelessSession(); Query q = s.createQuery(query); q.setFirstResult(firstResult); q.setMaxResults(maxResult); setParameters(parameterMap, q); return q.list(); }
class class_name[name] begin[{] method[findByQuery, return_type[type[List]], modifier[public], parameter[query, parameterMap, firstResult, maxResult]] begin[{] assign[member[.s], call[.getStatelessSession, parameter[]]] local_variable[type[Query], q] call[q.setFirstResult, parameter[member[.firstResult]]] call[q.setMaxResults, parameter[member[.maxResult]]] call[.setParameters, parameter[member[.parameterMap], member[.q]]] return[call[q.list, parameter[]]] end[}] END[}]
Keyword[public] identifier[List] identifier[findByQuery] operator[SEP] identifier[String] identifier[query] , identifier[Map] operator[<] identifier[Parameter] , identifier[Object] operator[>] identifier[parameterMap] , Keyword[int] identifier[firstResult] , Keyword[int] identifier[maxResult] operator[SEP] { identifier[s] operator[=] identifier[getStatelessSession] operator[SEP] operator[SEP] operator[SEP] identifier[Query] identifier[q] operator[=] identifier[s] operator[SEP] identifier[createQuery] operator[SEP] identifier[query] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[setFirstResult] operator[SEP] identifier[firstResult] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[setMaxResults] operator[SEP] identifier[maxResult] operator[SEP] operator[SEP] identifier[setParameters] operator[SEP] identifier[parameterMap] , identifier[q] operator[SEP] operator[SEP] Keyword[return] identifier[q] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] }
public void applyPattern(String pttrn) { try { if (msgPattern == null) { msgPattern = new MessagePattern(pttrn); } else { msgPattern.parse(pttrn); } // Cache the formats that are explicitly mentioned in the message pattern. cacheExplicitFormats(); } catch(RuntimeException e) { resetPattern(); throw e; } }
class class_name[name] begin[{] method[applyPattern, return_type[void], modifier[public], parameter[pttrn]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=msgPattern, 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=pttrn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=msgPattern, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msgPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=pttrn, 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=MessagePattern, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=cacheExplicitFormats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=resetPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[applyPattern] operator[SEP] identifier[String] identifier[pttrn] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[msgPattern] operator[==] Other[null] operator[SEP] { identifier[msgPattern] operator[=] Keyword[new] identifier[MessagePattern] operator[SEP] identifier[pttrn] operator[SEP] operator[SEP] } Keyword[else] { identifier[msgPattern] operator[SEP] identifier[parse] operator[SEP] identifier[pttrn] operator[SEP] operator[SEP] } identifier[cacheExplicitFormats] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[e] operator[SEP] { identifier[resetPattern] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } }
private void addParameterToMap(String name, String value) { String[] params = getParameterValues(name); if(params == null) { params = new String[1]; params[0] = value; _queryParameters.put(name, params); } else { int len = params.length; String[] newParams = new String[len + 1]; System.arraycopy(params, 0, newParams, 0, len); newParams[len] = value; _queryParameters.put(name, newParams); } }
class class_name[name] begin[{] method[addParameterToMap, return_type[void], modifier[private], parameter[name, value]] begin[{] local_variable[type[String], params] if[binary_operation[member[.params], ==, literal[null]]] begin[{] assign[member[.params], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] assign[member[.params], member[.value]] call[_queryParameters.put, parameter[member[.name], member[.params]]] else begin[{] local_variable[type[int], len] local_variable[type[String], newParams] call[System.arraycopy, parameter[member[.params], literal[0], member[.newParams], literal[0], member[.len]]] assign[member[.newParams], member[.value]] call[_queryParameters.put, parameter[member[.name], member[.newParams]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[addParameterToMap] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[value] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[params] operator[=] identifier[getParameterValues] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[params] operator[==] Other[null] operator[SEP] { identifier[params] operator[=] Keyword[new] identifier[String] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[params] operator[SEP] Other[0] operator[SEP] operator[=] identifier[value] operator[SEP] identifier[_queryParameters] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[params] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] identifier[len] operator[=] identifier[params] operator[SEP] identifier[length] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[newParams] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[len] operator[+] Other[1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[params] , Other[0] , identifier[newParams] , Other[0] , identifier[len] operator[SEP] operator[SEP] identifier[newParams] operator[SEP] identifier[len] operator[SEP] operator[=] identifier[value] operator[SEP] identifier[_queryParameters] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[newParams] operator[SEP] operator[SEP] } }
public void closePoolTracer() { this.poolWriteLock.lock(); try { for (AbstractTracer tracer : this.tracerPool.values()) { tracer.close(); } } finally { this.poolWriteLock.unlock(); } }
class class_name[name] begin[{] method[closePoolTracer, return_type[void], modifier[public], parameter[]] begin[{] THIS[member[None.poolWriteLock]call[None.lock, parameter[]]] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=tracer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=tracerPool, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tracer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractTracer, sub_type=None))), label=None)], catches=None, finally_block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=poolWriteLock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[closePoolTracer] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[poolWriteLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[AbstractTracer] identifier[tracer] operator[:] Keyword[this] operator[SEP] identifier[tracerPool] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[tracer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { Keyword[this] operator[SEP] identifier[poolWriteLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public static <S, T extends Event, U extends T> InputMapTemplate<S, U> consumeUnless( EventPattern<? super T, ? extends U> eventPattern, Predicate<? super S> condition, BiConsumer<? super S, ? super U> action) { return consumeWhen(eventPattern, condition.negate(), action); }
class class_name[name] begin[{] method[consumeUnless, return_type[type[InputMapTemplate]], modifier[public static], parameter[eventPattern, condition, action]] begin[{] return[call[.consumeWhen, parameter[member[.eventPattern], call[condition.negate, parameter[]], member[.action]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[S] , identifier[T] Keyword[extends] identifier[Event] , identifier[U] Keyword[extends] identifier[T] operator[>] identifier[InputMapTemplate] operator[<] identifier[S] , identifier[U] operator[>] identifier[consumeUnless] operator[SEP] identifier[EventPattern] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[extends] identifier[U] operator[>] identifier[eventPattern] , identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[S] operator[>] identifier[condition] , identifier[BiConsumer] operator[<] operator[?] Keyword[super] identifier[S] , operator[?] Keyword[super] identifier[U] operator[>] identifier[action] operator[SEP] { Keyword[return] identifier[consumeWhen] operator[SEP] identifier[eventPattern] , identifier[condition] operator[SEP] identifier[negate] operator[SEP] operator[SEP] , identifier[action] operator[SEP] operator[SEP] }
@Override public void encode(OutputStream output, String nsURI) { encode(output, new Indenter(0), nsURI); }
class class_name[name] begin[{] method[encode, return_type[void], modifier[public], parameter[output, nsURI]] begin[{] call[.encode, parameter[member[.output], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Indenter, sub_type=None)), member[.nsURI]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[encode] operator[SEP] identifier[OutputStream] identifier[output] , identifier[String] identifier[nsURI] operator[SEP] { identifier[encode] operator[SEP] identifier[output] , Keyword[new] identifier[Indenter] operator[SEP] Other[0] operator[SEP] , identifier[nsURI] operator[SEP] operator[SEP] }
public synchronized Group getGroup(String groupName) { Group result = counters.get(groupName); if (result == null) { result = new Group(groupName); counters.put(groupName, result); } return result; }
class class_name[name] begin[{] method[getGroup, return_type[type[Group]], modifier[synchronized public], parameter[groupName]] begin[{] local_variable[type[Group], result] if[binary_operation[member[.result], ==, literal[null]]] begin[{] assign[member[.result], ClassCreator(arguments=[MemberReference(member=groupName, 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=Group, sub_type=None))] call[counters.put, parameter[member[.groupName], member[.result]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[synchronized] identifier[Group] identifier[getGroup] operator[SEP] identifier[String] identifier[groupName] operator[SEP] { identifier[Group] identifier[result] operator[=] identifier[counters] operator[SEP] identifier[get] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] { identifier[result] operator[=] Keyword[new] identifier[Group] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[counters] operator[SEP] identifier[put] operator[SEP] identifier[groupName] , identifier[result] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public final Mono<T> delaySubscription(Duration delay, Scheduler timer) { return delaySubscription(Mono.delay(delay, timer)); }
class class_name[name] begin[{] method[delaySubscription, return_type[type[Mono]], modifier[final public], parameter[delay, timer]] begin[{] return[call[.delaySubscription, parameter[call[Mono.delay, parameter[member[.delay], member[.timer]]]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[Mono] operator[<] identifier[T] operator[>] identifier[delaySubscription] operator[SEP] identifier[Duration] identifier[delay] , identifier[Scheduler] identifier[timer] operator[SEP] { Keyword[return] identifier[delaySubscription] operator[SEP] identifier[Mono] operator[SEP] identifier[delay] operator[SEP] identifier[delay] , identifier[timer] operator[SEP] operator[SEP] operator[SEP] }
private ExecutionCallback<Boolean> loadingFinishedCallback() { return new ExecutionCallback<Boolean>() { @Override public void onResponse(Boolean loadingFinished) { if (loadingFinished) { updateLocalKeyLoadStatus(null); } } @Override public void onFailure(Throwable t) { updateLocalKeyLoadStatus(t); } }; }
class class_name[name] begin[{] method[loadingFinishedCallback, return_type[type[ExecutionCallback]], modifier[private], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=MemberReference(member=loadingFinished, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=updateLocalKeyLoadStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=onResponse, parameters=[FormalParameter(annotations=[], modifiers=set(), name=loadingFinished, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateLocalKeyLoadStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=ExecutionCallback, sub_type=None))] end[}] END[}]
Keyword[private] identifier[ExecutionCallback] operator[<] identifier[Boolean] operator[>] identifier[loadingFinishedCallback] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[ExecutionCallback] operator[<] identifier[Boolean] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onResponse] operator[SEP] identifier[Boolean] identifier[loadingFinished] operator[SEP] { Keyword[if] operator[SEP] identifier[loadingFinished] operator[SEP] { identifier[updateLocalKeyLoadStatus] operator[SEP] Other[null] operator[SEP] operator[SEP] } } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[updateLocalKeyLoadStatus] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } operator[SEP] }
public static <D, R> Collection<R> apply(final Mapping<? super D, R> mapping, final Collection<? extends D> coll) { return new AbstractCollection<R>() { @Override public Iterator<R> iterator() { return apply(mapping, coll.iterator()); } @Override public int size() { return coll.size(); } }; }
class class_name[name] begin[{] method[apply, return_type[type[Collection]], modifier[public static], parameter[mapping, coll]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=mapping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=coll, selectors=[], type_arguments=None)], member=apply, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=iterator, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=[], name=Iterator, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=coll, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=size, parameters=[], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=None, name=AbstractCollection, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[D] , identifier[R] operator[>] identifier[Collection] operator[<] identifier[R] operator[>] identifier[apply] operator[SEP] Keyword[final] identifier[Mapping] operator[<] operator[?] Keyword[super] identifier[D] , identifier[R] operator[>] identifier[mapping] , Keyword[final] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[D] operator[>] identifier[coll] operator[SEP] { Keyword[return] Keyword[new] identifier[AbstractCollection] operator[<] identifier[R] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[R] operator[>] identifier[iterator] operator[SEP] operator[SEP] { Keyword[return] identifier[apply] operator[SEP] identifier[mapping] , identifier[coll] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[size] operator[SEP] operator[SEP] { Keyword[return] identifier[coll] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public CreateConditionalForwarderRequest withDnsIpAddrs(String... dnsIpAddrs) { if (this.dnsIpAddrs == null) { setDnsIpAddrs(new com.amazonaws.internal.SdkInternalList<String>(dnsIpAddrs.length)); } for (String ele : dnsIpAddrs) { this.dnsIpAddrs.add(ele); } return this; }
class class_name[name] begin[{] method[withDnsIpAddrs, return_type[type[CreateConditionalForwarderRequest]], modifier[public], parameter[dnsIpAddrs]] begin[{] if[binary_operation[THIS[member[None.dnsIpAddrs]], ==, literal[null]]] begin[{] call[.setDnsIpAddrs, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=dnsIpAddrs, 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=String, 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=dnsIpAddrs, 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=dnsIpAddrs, 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[CreateConditionalForwarderRequest] identifier[withDnsIpAddrs] operator[SEP] identifier[String] operator[...] identifier[dnsIpAddrs] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[dnsIpAddrs] operator[==] Other[null] operator[SEP] { identifier[setDnsIpAddrs] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[dnsIpAddrs] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[dnsIpAddrs] operator[SEP] { Keyword[this] operator[SEP] identifier[dnsIpAddrs] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void setTagList(java.util.Collection<Tag> tagList) { if (tagList == null) { this.tagList = null; return; } this.tagList = new com.amazonaws.internal.SdkInternalList<Tag>(tagList); }
class class_name[name] begin[{] method[setTagList, return_type[void], modifier[public], parameter[tagList]] begin[{] if[binary_operation[member[.tagList], ==, literal[null]]] begin[{] assign[THIS[member[None.tagList]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.tagList]], ClassCreator(arguments=[MemberReference(member=tagList, 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=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Tag, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setTagList] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[Tag] operator[>] identifier[tagList] operator[SEP] { Keyword[if] operator[SEP] identifier[tagList] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[tagList] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[tagList] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[Tag] operator[>] operator[SEP] identifier[tagList] operator[SEP] operator[SEP] }
@Produces @RequestScoped public EntityManager getEntityManager(EntityManagerFactory emf) { log.debug("producing EntityManager"); return emf.createEntityManager(); }
class class_name[name] begin[{] method[getEntityManager, return_type[type[EntityManager]], modifier[public], parameter[emf]] begin[{] call[log.debug, parameter[literal["producing EntityManager"]]] return[call[emf.createEntityManager, parameter[]]] end[}] END[}]
annotation[@] identifier[Produces] annotation[@] identifier[RequestScoped] Keyword[public] identifier[EntityManager] identifier[getEntityManager] operator[SEP] identifier[EntityManagerFactory] identifier[emf] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[emf] operator[SEP] identifier[createEntityManager] operator[SEP] operator[SEP] operator[SEP] }
public Texture texture () { if (texture == null || texture.disposed()) texture = createTexture(texconf); return texture; }
class class_name[name] begin[{] method[texture, return_type[type[Texture]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[member[.texture], ==, literal[null]], ||, call[texture.disposed, parameter[]]]] begin[{] assign[member[.texture], call[.createTexture, parameter[member[.texconf]]]] else begin[{] None end[}] return[member[.texture]] end[}] END[}]
Keyword[public] identifier[Texture] identifier[texture] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[texture] operator[==] Other[null] operator[||] identifier[texture] operator[SEP] identifier[disposed] operator[SEP] operator[SEP] operator[SEP] identifier[texture] operator[=] identifier[createTexture] operator[SEP] identifier[texconf] operator[SEP] operator[SEP] Keyword[return] identifier[texture] operator[SEP] }