code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
private void typeCheck(K key) { Class<?> keyClass = key.getClass(); if (keyClass != keyType && keyClass.getSuperclass() != keyType) throw new ClassCastException(keyClass + " != " + keyType); }
class class_name[name] begin[{] method[typeCheck, return_type[void], modifier[private], parameter[key]] begin[{] local_variable[type[Class], keyClass] if[binary_operation[binary_operation[member[.keyClass], !=, member[.keyType]], &&, binary_operation[call[keyClass.getSuperclass, parameter[]], !=, member[.keyType]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=keyClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" != "), operator=+), operandr=MemberReference(member=keyType, 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=ClassCastException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[typeCheck] operator[SEP] identifier[K] identifier[key] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[keyClass] operator[=] identifier[key] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keyClass] operator[!=] identifier[keyType] operator[&&] identifier[keyClass] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[!=] identifier[keyType] operator[SEP] Keyword[throw] Keyword[new] identifier[ClassCastException] operator[SEP] identifier[keyClass] operator[+] literal[String] operator[+] identifier[keyType] operator[SEP] operator[SEP] }
static MessageDigest getSha256Digest() { try { MessageDigest digest = MessageDigest.getInstance("SHA-256"); digest.reset(); return digest; } catch (NoSuchAlgorithmException e) { // ignore, won't happen throw new IllegalStateException(e); } }
class class_name[name] begin[{] method[getSha256Digest, return_type[type[MessageDigest]], modifier[static], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SHA-256")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageDigest, selectors=[], type_arguments=None), name=digest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MessageDigest, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=digest, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=digest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[static] identifier[MessageDigest] identifier[getSha256Digest] operator[SEP] operator[SEP] { Keyword[try] { identifier[MessageDigest] identifier[digest] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[digest] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[digest] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
@SafeVarargs private final Map<String, FieldSpec> buildConditionFields(Map<String, PluralData>... pluralMaps) { Map<String, FieldSpec> index = new LinkedHashMap<>(); int seq = 0; for (Map<String, PluralData> pluralMap : pluralMaps) { for (Map.Entry<String, PluralData> entry : pluralMap.entrySet()) { PluralData data = entry.getValue(); // Iterate over the rules, drilling into the OR conditions and // building a field to evaluate each AND condition. for (Map.Entry<String, PluralData.Rule> rule : data.rules().entrySet()) { Node<PluralType> orCondition = rule.getValue().condition; if (orCondition == null) { continue; } // Render the representation for each AND condition, using that as a // key to map to the corresponding lambda Condition field that // computes it. for (Node<PluralType> andCondition : orCondition.asStruct().nodes()) { String repr = PluralRulePrinter.print(andCondition); if (index.containsKey(repr)) { continue; } // Build the field that represents the evaluation of the AND condition. FieldSpec field = buildConditionField(seq, andCondition.asStruct()); index.put(repr, field); seq++; } } } } return index; }
class class_name[name] begin[{] method[buildConditionFields, return_type[type[Map]], modifier[final private], parameter[pluralMaps]] begin[{] local_variable[type[Map], index] local_variable[type[int], seq] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=data)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PluralData, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[MemberReference(member=condition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), name=orCondition)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PluralType, sub_type=None))], dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=orCondition, 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=[ContinueStatement(goto=None, label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=andCondition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=PluralRulePrinter, selectors=[], type_arguments=None), name=repr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=repr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=asStruct, postfix_operators=[], prefix_operators=[], qualifier=andCondition, selectors=[], type_arguments=None)], member=buildConditionField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FieldSpec, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=repr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=seq, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=asStruct, postfix_operators=[], prefix_operators=[], qualifier=orCondition, selectors=[MethodInvocation(arguments=[], member=nodes, 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=andCondition)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PluralType, sub_type=None))], dimensions=[], name=Node, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=rules, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rule)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PluralData, sub_type=ReferenceType(arguments=None, dimensions=None, name=Rule, sub_type=None)))], dimensions=None, name=Entry, sub_type=None)))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=pluralMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PluralData, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pluralMaps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pluralMap)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PluralData, sub_type=None))], dimensions=[], name=Map, sub_type=None))), label=None) return[member[.index]] end[}] END[}]
annotation[@] identifier[SafeVarargs] Keyword[private] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[FieldSpec] operator[>] identifier[buildConditionFields] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[PluralData] operator[>] operator[...] identifier[pluralMaps] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[FieldSpec] operator[>] identifier[index] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[seq] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[PluralData] operator[>] identifier[pluralMap] operator[:] identifier[pluralMaps] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[PluralData] operator[>] identifier[entry] operator[:] identifier[pluralMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[PluralData] identifier[data] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[PluralData] operator[SEP] identifier[Rule] operator[>] identifier[rule] operator[:] identifier[data] operator[SEP] identifier[rules] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Node] operator[<] identifier[PluralType] operator[>] identifier[orCondition] operator[=] identifier[rule] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[condition] operator[SEP] Keyword[if] operator[SEP] identifier[orCondition] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[for] operator[SEP] identifier[Node] operator[<] identifier[PluralType] operator[>] identifier[andCondition] operator[:] identifier[orCondition] operator[SEP] identifier[asStruct] operator[SEP] operator[SEP] operator[SEP] identifier[nodes] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[repr] operator[=] identifier[PluralRulePrinter] operator[SEP] identifier[print] operator[SEP] identifier[andCondition] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[SEP] identifier[containsKey] operator[SEP] identifier[repr] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[FieldSpec] identifier[field] operator[=] identifier[buildConditionField] operator[SEP] identifier[seq] , identifier[andCondition] operator[SEP] identifier[asStruct] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[SEP] identifier[put] operator[SEP] identifier[repr] , identifier[field] operator[SEP] operator[SEP] identifier[seq] operator[++] operator[SEP] } } } } Keyword[return] identifier[index] operator[SEP] }
@SuppressWarnings("deprecation") public static void writeFlowDetails(JsonGenerator jsonGenerator, Flow aFlow, DetailLevel selectedSerialization, Predicate<String> includeFilter) throws JsonGenerationException, IOException { jsonGenerator.writeStartObject(); // serialize the FlowKey object filteredWrite("flowKey", includeFilter, aFlow.getFlowKey(), jsonGenerator); // serialize individual members of this class filteredWrite("flowName", includeFilter, aFlow.getFlowName(), jsonGenerator); filteredWrite("userName", includeFilter, aFlow.getUserName(), jsonGenerator); filteredWrite("jobCount", includeFilter, aFlow.getJobCount(), jsonGenerator); filteredWrite("totalMaps", includeFilter, aFlow.getTotalMaps(), jsonGenerator); filteredWrite("totalReduces", includeFilter, aFlow.getTotalReduces(), jsonGenerator); filteredWrite("mapFileBytesRead", includeFilter, aFlow.getMapFileBytesRead(), jsonGenerator); filteredWrite("mapFileBytesWritten", includeFilter, aFlow.getMapFileBytesWritten(), jsonGenerator); filteredWrite("reduceFileBytesRead", includeFilter, aFlow.getReduceFileBytesRead(), jsonGenerator); filteredWrite("hdfsBytesRead", includeFilter, aFlow.getHdfsBytesRead(), jsonGenerator); filteredWrite("hdfsBytesWritten", includeFilter, aFlow.getHdfsBytesWritten(), jsonGenerator); filteredWrite("mapSlotMillis", includeFilter, aFlow.getMapSlotMillis(), jsonGenerator); filteredWrite("reduceSlotMillis", includeFilter, aFlow.getReduceSlotMillis(), jsonGenerator); filteredWrite("megabyteMillis", includeFilter, aFlow.getMegabyteMillis(), jsonGenerator); filteredWrite("cost", includeFilter, aFlow.getCost(), jsonGenerator); filteredWrite("reduceShuffleBytes", includeFilter, aFlow.getReduceShuffleBytes(), jsonGenerator); filteredWrite("duration", includeFilter, aFlow.getDuration(), jsonGenerator); filteredWrite("wallClockTime", includeFilter, aFlow.getWallClockTime(), jsonGenerator); filteredWrite("cluster", includeFilter, aFlow.getCluster(), jsonGenerator); filteredWrite("appId", includeFilter, aFlow.getAppId(), jsonGenerator); filteredWrite("runId", includeFilter, aFlow.getRunId(), jsonGenerator); filteredWrite("version", includeFilter, aFlow.getVersion(), jsonGenerator); filteredWrite("hadoopVersion", includeFilter, aFlow.getHadoopVersion(), jsonGenerator); if (selectedSerialization == SerializationContext.DetailLevel.EVERYTHING) { filteredWrite("submitTime", includeFilter, aFlow.getSubmitTime(), jsonGenerator); filteredWrite("launchTime", includeFilter, aFlow.getLaunchTime(), jsonGenerator); filteredWrite("finishTime", includeFilter, aFlow.getFinishTime(), jsonGenerator); } filteredWrite(Constants.HRAVEN_QUEUE, includeFilter, aFlow.getQueue(), jsonGenerator); filteredWrite("counters", includeFilter, aFlow.getCounters(), jsonGenerator); filteredWrite("mapCounters", includeFilter, aFlow.getMapCounters(), jsonGenerator); filteredWrite("reduceCounters", includeFilter, aFlow.getReduceCounters(), jsonGenerator); // if flag, include job details if ((selectedSerialization == SerializationContext.DetailLevel.FLOW_SUMMARY_STATS_WITH_JOB_STATS) || (selectedSerialization == SerializationContext.DetailLevel.EVERYTHING)) { jsonGenerator.writeFieldName("jobs"); jsonGenerator.writeObject(aFlow.getJobs()); } jsonGenerator.writeEndObject(); }
class class_name[name] begin[{] method[writeFlowDetails, return_type[void], modifier[public static], parameter[jsonGenerator, aFlow, selectedSerialization, includeFilter]] begin[{] call[jsonGenerator.writeStartObject, parameter[]] call[.filteredWrite, parameter[literal["flowKey"], member[.includeFilter], call[aFlow.getFlowKey, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["flowName"], member[.includeFilter], call[aFlow.getFlowName, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["userName"], member[.includeFilter], call[aFlow.getUserName, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["jobCount"], member[.includeFilter], call[aFlow.getJobCount, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["totalMaps"], member[.includeFilter], call[aFlow.getTotalMaps, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["totalReduces"], member[.includeFilter], call[aFlow.getTotalReduces, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["mapFileBytesRead"], member[.includeFilter], call[aFlow.getMapFileBytesRead, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["mapFileBytesWritten"], member[.includeFilter], call[aFlow.getMapFileBytesWritten, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["reduceFileBytesRead"], member[.includeFilter], call[aFlow.getReduceFileBytesRead, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["hdfsBytesRead"], member[.includeFilter], call[aFlow.getHdfsBytesRead, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["hdfsBytesWritten"], member[.includeFilter], call[aFlow.getHdfsBytesWritten, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["mapSlotMillis"], member[.includeFilter], call[aFlow.getMapSlotMillis, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["reduceSlotMillis"], member[.includeFilter], call[aFlow.getReduceSlotMillis, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["megabyteMillis"], member[.includeFilter], call[aFlow.getMegabyteMillis, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["cost"], member[.includeFilter], call[aFlow.getCost, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["reduceShuffleBytes"], member[.includeFilter], call[aFlow.getReduceShuffleBytes, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["duration"], member[.includeFilter], call[aFlow.getDuration, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["wallClockTime"], member[.includeFilter], call[aFlow.getWallClockTime, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["cluster"], member[.includeFilter], call[aFlow.getCluster, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["appId"], member[.includeFilter], call[aFlow.getAppId, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["runId"], member[.includeFilter], call[aFlow.getRunId, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["version"], member[.includeFilter], call[aFlow.getVersion, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["hadoopVersion"], member[.includeFilter], call[aFlow.getHadoopVersion, parameter[]], member[.jsonGenerator]]] if[binary_operation[member[.selectedSerialization], ==, member[SerializationContext.DetailLevel.EVERYTHING]]] begin[{] call[.filteredWrite, parameter[literal["submitTime"], member[.includeFilter], call[aFlow.getSubmitTime, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["launchTime"], member[.includeFilter], call[aFlow.getLaunchTime, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["finishTime"], member[.includeFilter], call[aFlow.getFinishTime, parameter[]], member[.jsonGenerator]]] else begin[{] None end[}] call[.filteredWrite, parameter[member[Constants.HRAVEN_QUEUE], member[.includeFilter], call[aFlow.getQueue, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["counters"], member[.includeFilter], call[aFlow.getCounters, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["mapCounters"], member[.includeFilter], call[aFlow.getMapCounters, parameter[]], member[.jsonGenerator]]] call[.filteredWrite, parameter[literal["reduceCounters"], member[.includeFilter], call[aFlow.getReduceCounters, parameter[]], member[.jsonGenerator]]] if[binary_operation[binary_operation[member[.selectedSerialization], ==, member[SerializationContext.DetailLevel.FLOW_SUMMARY_STATS_WITH_JOB_STATS]], ||, binary_operation[member[.selectedSerialization], ==, member[SerializationContext.DetailLevel.EVERYTHING]]]] begin[{] call[jsonGenerator.writeFieldName, parameter[literal["jobs"]]] call[jsonGenerator.writeObject, parameter[call[aFlow.getJobs, parameter[]]]] else begin[{] None end[}] call[jsonGenerator.writeEndObject, parameter[]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] Keyword[void] identifier[writeFlowDetails] operator[SEP] identifier[JsonGenerator] identifier[jsonGenerator] , identifier[Flow] identifier[aFlow] , identifier[DetailLevel] identifier[selectedSerialization] , identifier[Predicate] operator[<] identifier[String] operator[>] identifier[includeFilter] operator[SEP] Keyword[throws] identifier[JsonGenerationException] , identifier[IOException] { identifier[jsonGenerator] operator[SEP] identifier[writeStartObject] operator[SEP] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getFlowKey] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getFlowName] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getUserName] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getJobCount] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getTotalMaps] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getTotalReduces] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getMapFileBytesRead] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getMapFileBytesWritten] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getReduceFileBytesRead] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getHdfsBytesRead] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getHdfsBytesWritten] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getMapSlotMillis] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getReduceSlotMillis] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getMegabyteMillis] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getCost] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getReduceShuffleBytes] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getDuration] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getWallClockTime] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getCluster] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getAppId] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getRunId] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getHadoopVersion] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selectedSerialization] operator[==] identifier[SerializationContext] operator[SEP] identifier[DetailLevel] operator[SEP] identifier[EVERYTHING] operator[SEP] { identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getSubmitTime] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getLaunchTime] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getFinishTime] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] } identifier[filteredWrite] operator[SEP] identifier[Constants] operator[SEP] identifier[HRAVEN_QUEUE] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getQueue] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getCounters] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getMapCounters] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] identifier[filteredWrite] operator[SEP] literal[String] , identifier[includeFilter] , identifier[aFlow] operator[SEP] identifier[getReduceCounters] operator[SEP] operator[SEP] , identifier[jsonGenerator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[selectedSerialization] operator[==] identifier[SerializationContext] operator[SEP] identifier[DetailLevel] operator[SEP] identifier[FLOW_SUMMARY_STATS_WITH_JOB_STATS] operator[SEP] operator[||] operator[SEP] identifier[selectedSerialization] operator[==] identifier[SerializationContext] operator[SEP] identifier[DetailLevel] operator[SEP] identifier[EVERYTHING] operator[SEP] operator[SEP] { identifier[jsonGenerator] operator[SEP] identifier[writeFieldName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[jsonGenerator] operator[SEP] identifier[writeObject] operator[SEP] identifier[aFlow] operator[SEP] identifier[getJobs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[jsonGenerator] operator[SEP] identifier[writeEndObject] operator[SEP] operator[SEP] operator[SEP] }
protected void addDeprecatedInfo(ProgramElementDoc member, Content contentTree) { Content output = (new DeprecatedTaglet()).getTagletOutput(member, writer.getTagletWriterInstance(false)); if (!output.isEmpty()) { Content deprecatedContent = output; Content div = HtmlTree.DIV(HtmlStyle.block, deprecatedContent); contentTree.addContent(div); } }
class class_name[name] begin[{] method[addDeprecatedInfo, return_type[void], modifier[protected], parameter[member, contentTree]] begin[{] local_variable[type[Content], output] if[call[output.isEmpty, parameter[]]] begin[{] local_variable[type[Content], deprecatedContent] local_variable[type[Content], div] call[contentTree.addContent, parameter[member[.div]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[addDeprecatedInfo] operator[SEP] identifier[ProgramElementDoc] identifier[member] , identifier[Content] identifier[contentTree] operator[SEP] { identifier[Content] identifier[output] operator[=] operator[SEP] Keyword[new] identifier[DeprecatedTaglet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getTagletOutput] operator[SEP] identifier[member] , identifier[writer] operator[SEP] identifier[getTagletWriterInstance] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[output] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Content] identifier[deprecatedContent] operator[=] identifier[output] operator[SEP] identifier[Content] identifier[div] operator[=] identifier[HtmlTree] operator[SEP] identifier[DIV] operator[SEP] identifier[HtmlStyle] operator[SEP] identifier[block] , identifier[deprecatedContent] operator[SEP] operator[SEP] identifier[contentTree] operator[SEP] identifier[addContent] operator[SEP] identifier[div] operator[SEP] operator[SEP] } }
private static void genVisits(int noVisits, int noDocs, String path) { Random rand = new Random(Calendar.getInstance().getTimeInMillis()); try (BufferedWriter fw = new BufferedWriter(new FileWriter(path))) { for (int i = 0; i < noVisits; i++) { int year = 2000 + rand.nextInt(10); // yearFilter 3 int month = rand.nextInt(12) + 1; // month between 1 and 12 int day = rand.nextInt(27) + 1; // day between 1 and 28 // IP address StringBuilder visit = new StringBuilder(rand.nextInt(256) + "." + rand.nextInt(256) + "." + rand.nextInt(256) + "." + rand.nextInt(256) + "|"); // URL visit.append("url_" + rand.nextInt(noDocs) + "|"); // Date (format: YYYY-MM-DD) visit.append(year + "-" + month + "-" + day + "|"); // Miscellaneous data, e.g. User-Agent visit.append("0.12|Mozilla Firefox 3.1|de|de|Nothing special|124|\n"); fw.write(visit.toString()); } } catch (IOException e) { e.printStackTrace(); } }
class class_name[name] begin[{] method[genVisits, return_type[void], modifier[private static], parameter[noVisits, noDocs, path]] begin[{] local_variable[type[Random], rand] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2000), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None), operator=+), name=year)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12)], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=month)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=27)], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=day)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256)], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256)], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256)], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256)], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="|"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=visit)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="url_"), operandr=MethodInvocation(arguments=[MemberReference(member=noDocs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=rand, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="|"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=visit, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=year, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), operator=+), operandr=MemberReference(member=month, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), operator=+), operandr=MemberReference(member=day, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="|"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=visit, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0.12|Mozilla Firefox 3.1|de|de|Nothing special|124|\n")], member=append, postfix_operators=[], prefix_operators=[], qualifier=visit, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=visit, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=fw, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=noVisits, 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)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=fw, type=ReferenceType(arguments=None, dimensions=[], name=BufferedWriter, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileWriter, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedWriter, sub_type=None)))]) end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[genVisits] operator[SEP] Keyword[int] identifier[noVisits] , Keyword[int] identifier[noDocs] , identifier[String] identifier[path] operator[SEP] { identifier[Random] identifier[rand] operator[=] Keyword[new] identifier[Random] operator[SEP] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getTimeInMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[BufferedWriter] identifier[fw] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] Keyword[new] identifier[FileWriter] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[noVisits] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[year] operator[=] Other[2000] operator[+] identifier[rand] operator[SEP] identifier[nextInt] operator[SEP] Other[10] operator[SEP] operator[SEP] Keyword[int] identifier[month] operator[=] identifier[rand] operator[SEP] identifier[nextInt] operator[SEP] Other[12] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[int] identifier[day] operator[=] identifier[rand] operator[SEP] identifier[nextInt] operator[SEP] Other[27] operator[SEP] operator[+] Other[1] operator[SEP] identifier[StringBuilder] identifier[visit] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[rand] operator[SEP] identifier[nextInt] operator[SEP] Other[256] operator[SEP] operator[+] literal[String] operator[+] identifier[rand] operator[SEP] identifier[nextInt] operator[SEP] Other[256] operator[SEP] operator[+] literal[String] operator[+] identifier[rand] operator[SEP] identifier[nextInt] operator[SEP] Other[256] operator[SEP] operator[+] literal[String] operator[+] identifier[rand] operator[SEP] identifier[nextInt] operator[SEP] Other[256] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[visit] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[rand] operator[SEP] identifier[nextInt] operator[SEP] identifier[noDocs] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[visit] operator[SEP] identifier[append] operator[SEP] identifier[year] operator[+] literal[String] operator[+] identifier[month] operator[+] literal[String] operator[+] identifier[day] operator[+] literal[String] operator[SEP] operator[SEP] identifier[visit] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[fw] operator[SEP] identifier[write] operator[SEP] identifier[visit] operator[SEP] identifier[toString] operator[SEP] 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] } }
public Observable<OperationStatus> updatePrebuiltEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePrebuiltEntityRoleOptionalParameter updatePrebuiltEntityRoleOptionalParameter) { return updatePrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId, updatePrebuiltEntityRoleOptionalParameter).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() { @Override public OperationStatus call(ServiceResponse<OperationStatus> response) { return response.body(); } }); }
class class_name[name] begin[{] method[updatePrebuiltEntityRoleAsync, return_type[type[Observable]], modifier[public], parameter[appId, versionId, entityId, roleId, updatePrebuiltEntityRoleOptionalParameter]] begin[{] return[call[.updatePrebuiltEntityRoleWithServiceResponseAsync, parameter[member[.appId], member[.versionId], member[.entityId], member[.roleId], member[.updatePrebuiltEntityRoleOptionalParameter]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[OperationStatus] operator[>] identifier[updatePrebuiltEntityRoleAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , identifier[UUID] identifier[entityId] , identifier[UUID] identifier[roleId] , identifier[UpdatePrebuiltEntityRoleOptionalParameter] identifier[updatePrebuiltEntityRoleOptionalParameter] operator[SEP] { Keyword[return] identifier[updatePrebuiltEntityRoleWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[versionId] , identifier[entityId] , identifier[roleId] , identifier[updatePrebuiltEntityRoleOptionalParameter] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[OperationStatus] operator[>] , identifier[OperationStatus] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[OperationStatus] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[OperationStatus] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
private void makePS() { String nproj = gds.getParam(GridDefRecord.NPPROJ); double latOrigin = (nproj == null || nproj.equalsIgnoreCase("true")) ? 90.0 : -90.0; // Why the scale factor?. according to GRIB docs: // "Grid lengths are in units of meters, at the 60 degree latitude circle nearest to the pole" // since the scale factor at 60 degrees = k = 2*k0/(1+sin(60)) [Snyder,Working Manual p157] // then to make scale = 1 at 60 degrees, k0 = (1+sin(60))/2 = .933 double scale; double lad = gds.getDouble(GridDefRecord.LAD); if (Double.isNaN(lad)) { scale = .933; } else { scale = (1.0+Math.sin( Math.toRadians( Math.abs(lad)) ))/2; } proj = new Stereographic(latOrigin, gds.getDouble(GridDefRecord.LOV), scale); // we have to project in order to find the origin ProjectionPointImpl start = (ProjectionPointImpl) proj.latLonToProj( new LatLonPointImpl( gds.getDouble(GridDefRecord.LA1), gds.getDouble(GridDefRecord.LO1))); startx = start.getX(); starty = start.getY(); if (Double.isNaN(getDxInKm())) setDxDy(startx, starty, proj); if (GridServiceProvider.debugProj) { System.out.printf("starting proj coord %s lat/lon %s%n", start, proj.projToLatLon(start)); System.out.println(" should be LA1=" + gds.getDouble(GridDefRecord.LA1) + " l)1=" + gds.getDouble(GridDefRecord.LO1)); } attributes.add(new Attribute(GridCF.GRID_MAPPING_NAME, "polar_stereographic")); //attributes.add(new Attribute("longitude_of_projection_origin", attributes.add(new Attribute(GridCF.LONGITUDE_OF_PROJECTION_ORIGIN, gds.getDouble(GridDefRecord.LOV))); //attributes.add(new Attribute("straight_vertical_longitude_from_pole", attributes.add(new Attribute( GridCF.STRAIGHT_VERTICAL_LONGITUDE_FROM_POLE, gds.getDouble(GridDefRecord.LOV))); //attributes.add(new Attribute("scale_factor_at_projection_origin", attributes.add(new Attribute(GridCF.SCALE_FACTOR_AT_PROJECTION_ORIGIN, scale)); attributes.add(new Attribute(GridCF.LATITUDE_OF_PROJECTION_ORIGIN, latOrigin)); }
class class_name[name] begin[{] method[makePS, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[String], nproj] local_variable[type[double], latOrigin] local_variable[type[double], scale] local_variable[type[double], lad] if[call[Double.isNaN, parameter[member[.lad]]]] begin[{] assign[member[.scale], literal[.933]] else begin[{] assign[member[.scale], binary_operation[binary_operation[literal[1.0], +, call[Math.sin, parameter[call[Math.toRadians, parameter[call[Math.abs, parameter[member[.lad]]]]]]]], /, literal[2]]] end[}] assign[member[.proj], ClassCreator(arguments=[MemberReference(member=latOrigin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=LOV, postfix_operators=[], prefix_operators=[], qualifier=GridDefRecord, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=gds, selectors=[], type_arguments=None), MemberReference(member=scale, 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=Stereographic, sub_type=None))] local_variable[type[ProjectionPointImpl], start] assign[member[.startx], call[start.getX, parameter[]]] assign[member[.starty], call[start.getY, parameter[]]] if[call[Double.isNaN, parameter[call[.getDxInKm, parameter[]]]]] begin[{] call[.setDxDy, parameter[member[.startx], member[.starty], member[.proj]]] else begin[{] None end[}] if[member[GridServiceProvider.debugProj]] begin[{] call[System.out.printf, parameter[literal["starting proj coord %s lat/lon %s%n"], member[.start], call[proj.projToLatLon, parameter[member[.start]]]]] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[literal[" should be LA1="], +, call[gds.getDouble, parameter[member[GridDefRecord.LA1]]]], +, literal[" l)1="]], +, call[gds.getDouble, parameter[member[GridDefRecord.LO1]]]]]] else begin[{] None end[}] call[attributes.add, parameter[ClassCreator(arguments=[MemberReference(member=GRID_MAPPING_NAME, postfix_operators=[], prefix_operators=[], qualifier=GridCF, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="polar_stereographic")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] call[attributes.add, parameter[ClassCreator(arguments=[MemberReference(member=LONGITUDE_OF_PROJECTION_ORIGIN, postfix_operators=[], prefix_operators=[], qualifier=GridCF, selectors=[]), MethodInvocation(arguments=[MemberReference(member=LOV, postfix_operators=[], prefix_operators=[], qualifier=GridDefRecord, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=gds, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] call[attributes.add, parameter[ClassCreator(arguments=[MemberReference(member=STRAIGHT_VERTICAL_LONGITUDE_FROM_POLE, postfix_operators=[], prefix_operators=[], qualifier=GridCF, selectors=[]), MethodInvocation(arguments=[MemberReference(member=LOV, postfix_operators=[], prefix_operators=[], qualifier=GridDefRecord, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=gds, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] call[attributes.add, parameter[ClassCreator(arguments=[MemberReference(member=SCALE_FACTOR_AT_PROJECTION_ORIGIN, postfix_operators=[], prefix_operators=[], qualifier=GridCF, selectors=[]), MemberReference(member=scale, 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=Attribute, sub_type=None))]] call[attributes.add, parameter[ClassCreator(arguments=[MemberReference(member=LATITUDE_OF_PROJECTION_ORIGIN, postfix_operators=[], prefix_operators=[], qualifier=GridCF, selectors=[]), MemberReference(member=latOrigin, 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=Attribute, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[makePS] operator[SEP] operator[SEP] { identifier[String] identifier[nproj] operator[=] identifier[gds] operator[SEP] identifier[getParam] operator[SEP] identifier[GridDefRecord] operator[SEP] identifier[NPPROJ] operator[SEP] operator[SEP] Keyword[double] identifier[latOrigin] operator[=] operator[SEP] identifier[nproj] operator[==] Other[null] operator[||] identifier[nproj] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[?] literal[Float] operator[:] operator[-] literal[Float] operator[SEP] Keyword[double] identifier[scale] operator[SEP] Keyword[double] identifier[lad] operator[=] identifier[gds] operator[SEP] identifier[getDouble] operator[SEP] identifier[GridDefRecord] operator[SEP] identifier[LAD] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[isNaN] operator[SEP] identifier[lad] operator[SEP] operator[SEP] { identifier[scale] operator[=] literal[Float] operator[SEP] } Keyword[else] { identifier[scale] operator[=] operator[SEP] literal[Float] operator[+] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[Math] operator[SEP] identifier[toRadians] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[lad] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[/] Other[2] operator[SEP] } identifier[proj] operator[=] Keyword[new] identifier[Stereographic] operator[SEP] identifier[latOrigin] , identifier[gds] operator[SEP] identifier[getDouble] operator[SEP] identifier[GridDefRecord] operator[SEP] identifier[LOV] operator[SEP] , identifier[scale] operator[SEP] operator[SEP] identifier[ProjectionPointImpl] identifier[start] operator[=] operator[SEP] identifier[ProjectionPointImpl] operator[SEP] identifier[proj] operator[SEP] identifier[latLonToProj] operator[SEP] Keyword[new] identifier[LatLonPointImpl] operator[SEP] identifier[gds] operator[SEP] identifier[getDouble] operator[SEP] identifier[GridDefRecord] operator[SEP] identifier[LA1] operator[SEP] , identifier[gds] operator[SEP] identifier[getDouble] operator[SEP] identifier[GridDefRecord] operator[SEP] identifier[LO1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[startx] operator[=] identifier[start] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP] identifier[starty] operator[=] identifier[start] operator[SEP] identifier[getY] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[isNaN] operator[SEP] identifier[getDxInKm] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setDxDy] operator[SEP] identifier[startx] , identifier[starty] , identifier[proj] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[GridServiceProvider] operator[SEP] identifier[debugProj] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[start] , identifier[proj] operator[SEP] identifier[projToLatLon] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[gds] operator[SEP] identifier[getDouble] operator[SEP] identifier[GridDefRecord] operator[SEP] identifier[LA1] operator[SEP] operator[+] literal[String] operator[+] identifier[gds] operator[SEP] identifier[getDouble] operator[SEP] identifier[GridDefRecord] operator[SEP] identifier[LO1] operator[SEP] operator[SEP] operator[SEP] } identifier[attributes] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[GridCF] operator[SEP] identifier[GRID_MAPPING_NAME] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[GridCF] operator[SEP] identifier[LONGITUDE_OF_PROJECTION_ORIGIN] , identifier[gds] operator[SEP] identifier[getDouble] operator[SEP] identifier[GridDefRecord] operator[SEP] identifier[LOV] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[GridCF] operator[SEP] identifier[STRAIGHT_VERTICAL_LONGITUDE_FROM_POLE] , identifier[gds] operator[SEP] identifier[getDouble] operator[SEP] identifier[GridDefRecord] operator[SEP] identifier[LOV] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[GridCF] operator[SEP] identifier[SCALE_FACTOR_AT_PROJECTION_ORIGIN] , identifier[scale] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[GridCF] operator[SEP] identifier[LATITUDE_OF_PROJECTION_ORIGIN] , identifier[latOrigin] operator[SEP] operator[SEP] operator[SEP] }
@Override public boolean eIsSet(int featureID) { switch (featureID) { case XtextPackage.TERMINAL_RULE__FRAGMENT: return fragment != FRAGMENT_EDEFAULT; } return super.eIsSet(featureID); }
class class_name[name] begin[{] method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=TERMINAL_RULE__FRAGMENT, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], statements=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=fragment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=FRAGMENT_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[XtextPackage] operator[SEP] identifier[TERMINAL_RULE__FRAGMENT] operator[:] Keyword[return] identifier[fragment] operator[!=] identifier[FRAGMENT_EDEFAULT] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
@Override public void visitClassContext(ClassContext classContext) { try { JavaClass cls = classContext.getJavaClass(); int major = cls.getMajor(); if (major >= Const.MAJOR_1_5) { stack = new OpcodeStack(); super.visitClassContext(classContext); } } finally { stack = null; } }
class class_name[name] begin[{] method[visitClassContext, return_type[void], modifier[public], parameter[classContext]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getJavaClass, postfix_operators=[], prefix_operators=[], qualifier=classContext, selectors=[], type_arguments=None), name=cls)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JavaClass, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMajor, postfix_operators=[], prefix_operators=[], qualifier=cls, selectors=[], type_arguments=None), name=major)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=major, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAJOR_1_5, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OpcodeStack, sub_type=None))), label=None), StatementExpression(expression=SuperMethodInvocation(arguments=[MemberReference(member=classContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitClassContext, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visitClassContext] operator[SEP] identifier[ClassContext] identifier[classContext] operator[SEP] { Keyword[try] { identifier[JavaClass] identifier[cls] operator[=] identifier[classContext] operator[SEP] identifier[getJavaClass] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[major] operator[=] identifier[cls] operator[SEP] identifier[getMajor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[major] operator[>=] identifier[Const] operator[SEP] identifier[MAJOR_1_5] operator[SEP] { identifier[stack] operator[=] Keyword[new] identifier[OpcodeStack] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[visitClassContext] operator[SEP] identifier[classContext] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[stack] operator[=] Other[null] operator[SEP] } }
public BigDecimal getInternalBigDecimal(ColumnInformation columnInfo) { if (lastValueWasNull()) { return null; } if (columnInfo.getColumnType() == ColumnType.BIT) { return BigDecimal.valueOf(parseBit()); } return new BigDecimal(new String(buf, pos, length, StandardCharsets.UTF_8)); }
class class_name[name] begin[{] method[getInternalBigDecimal, return_type[type[BigDecimal]], modifier[public], parameter[columnInfo]] begin[{] if[call[.lastValueWasNull, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[call[columnInfo.getColumnType, parameter[]], ==, member[ColumnType.BIT]]] begin[{] return[call[BigDecimal.valueOf, parameter[call[.parseBit, parameter[]]]]] else begin[{] None end[}] return[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=StandardCharsets, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))] end[}] END[}]
Keyword[public] identifier[BigDecimal] identifier[getInternalBigDecimal] operator[SEP] identifier[ColumnInformation] identifier[columnInfo] operator[SEP] { Keyword[if] operator[SEP] identifier[lastValueWasNull] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[columnInfo] operator[SEP] identifier[getColumnType] operator[SEP] operator[SEP] operator[==] identifier[ColumnType] operator[SEP] identifier[BIT] operator[SEP] { Keyword[return] identifier[BigDecimal] operator[SEP] identifier[valueOf] operator[SEP] identifier[parseBit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[BigDecimal] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[buf] , identifier[pos] , identifier[length] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] operator[SEP] }
public String sequence(int hashCode) { if (hashCode <= 0) return null; int state = 0; // If the hash code is larger than the number of suffixes in the start state, // the hash code does not correspond to a sequence. if (hashCode > d_stateNSuffixes.get(state)) return null; StringBuilder wordBuilder = new StringBuilder(); // Stop if we are in a state where we cannot add more characters. while (d_stateOffsets.get(state) != transitionsUpperBound(state)) { // Obtain the next transition, decreasing the hash code by the number of // preceding suffixes. int trans; for (trans = d_stateOffsets.get(state); trans < transitionsUpperBound(state); ++trans) { int stateNSuffixes = d_stateNSuffixes.get(d_transitionTo.get(trans)); if (hashCode - stateNSuffixes <= 0) break; hashCode -= stateNSuffixes; } // Add the character on the given transition and move. wordBuilder.append(d_transitionChars[trans]); state = d_transitionTo.get(trans); // If we encounter a final state, decrease the hash code, since it represents a // suffix. If our hash code is reduced to zero, we have found the sequence. if (d_finalStates.get(state)) { --hashCode; if (hashCode == 0) return wordBuilder.toString(); } } // Bad luck, we cannot really get here! return null; }
class class_name[name] begin[{] method[sequence, return_type[type[String]], modifier[public], parameter[hashCode]] begin[{] if[binary_operation[member[.hashCode], <=, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], state] if[binary_operation[member[.hashCode], >, call[d_stateNSuffixes.get, parameter[member[.state]]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[StringBuilder], wordBuilder] while[binary_operation[call[d_stateOffsets.get, parameter[member[.state]]], !=, call[.transitionsUpperBound, parameter[member[.state]]]]] begin[{] local_variable[type[int], trans] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=trans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=d_transitionTo, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=d_stateNSuffixes, selectors=[], type_arguments=None), name=stateNSuffixes)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=hashCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=stateNSuffixes, 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=BreakStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hashCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=MemberReference(member=stateNSuffixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=trans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transitionsUpperBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=<), init=[Assignment(expressionl=MemberReference(member=trans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=d_stateOffsets, selectors=[], type_arguments=None))], update=[MemberReference(member=trans, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) call[wordBuilder.append, parameter[member[.d_transitionChars]]] assign[member[.state], call[d_transitionTo.get, parameter[member[.trans]]]] if[call[d_finalStates.get, parameter[member[.state]]]] begin[{] member[.hashCode] if[binary_operation[member[.hashCode], ==, literal[0]]] begin[{] return[call[wordBuilder.toString, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[String] identifier[sequence] operator[SEP] Keyword[int] identifier[hashCode] operator[SEP] { Keyword[if] operator[SEP] identifier[hashCode] operator[<=] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[int] identifier[state] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[hashCode] operator[>] identifier[d_stateNSuffixes] operator[SEP] identifier[get] operator[SEP] identifier[state] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[StringBuilder] identifier[wordBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[d_stateOffsets] operator[SEP] identifier[get] operator[SEP] identifier[state] operator[SEP] operator[!=] identifier[transitionsUpperBound] operator[SEP] identifier[state] operator[SEP] operator[SEP] { Keyword[int] identifier[trans] operator[SEP] Keyword[for] operator[SEP] identifier[trans] operator[=] identifier[d_stateOffsets] operator[SEP] identifier[get] operator[SEP] identifier[state] operator[SEP] operator[SEP] identifier[trans] operator[<] identifier[transitionsUpperBound] operator[SEP] identifier[state] operator[SEP] operator[SEP] operator[++] identifier[trans] operator[SEP] { Keyword[int] identifier[stateNSuffixes] operator[=] identifier[d_stateNSuffixes] operator[SEP] identifier[get] operator[SEP] identifier[d_transitionTo] operator[SEP] identifier[get] operator[SEP] identifier[trans] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hashCode] operator[-] identifier[stateNSuffixes] operator[<=] Other[0] operator[SEP] Keyword[break] operator[SEP] identifier[hashCode] operator[-=] identifier[stateNSuffixes] operator[SEP] } identifier[wordBuilder] operator[SEP] identifier[append] operator[SEP] identifier[d_transitionChars] operator[SEP] identifier[trans] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[=] identifier[d_transitionTo] operator[SEP] identifier[get] operator[SEP] identifier[trans] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d_finalStates] operator[SEP] identifier[get] operator[SEP] identifier[state] operator[SEP] operator[SEP] { operator[--] identifier[hashCode] operator[SEP] Keyword[if] operator[SEP] identifier[hashCode] operator[==] Other[0] operator[SEP] Keyword[return] identifier[wordBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public static <T> T min( List<T> list ) { if (list.size()>1) { Sorting.sort(list); return list.get(0); } else { return null; } }
class class_name[name] begin[{] method[min, return_type[type[T]], modifier[public static], parameter[list]] begin[{] if[binary_operation[call[list.size, parameter[]], >, literal[1]]] begin[{] call[Sorting.sort, parameter[member[.list]]] return[call[list.get, parameter[literal[0]]]] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[min] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[list] operator[SEP] { Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[Sorting] operator[SEP] identifier[sort] operator[SEP] identifier[list] operator[SEP] operator[SEP] Keyword[return] identifier[list] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
private void initMBeans(Configuration pConfig) { int maxEntries = pConfig.getAsInt(HISTORY_MAX_ENTRIES); int maxDebugEntries = pConfig.getAsInt(DEBUG_MAX_ENTRIES); historyStore = new HistoryStore(maxEntries); debugStore = new DebugStore(maxDebugEntries, pConfig.getAsBoolean(DEBUG)); try { localDispatcher.initMBeans(historyStore, debugStore); } catch (NotCompliantMBeanException e) { intError("Error registering config MBean: " + e, e); } catch (MBeanRegistrationException e) { intError("Cannot register MBean: " + e, e); } catch (MalformedObjectNameException e) { intError("Invalid name for config MBean: " + e, e); } }
class class_name[name] begin[{] method[initMBeans, return_type[void], modifier[private], parameter[pConfig]] begin[{] local_variable[type[int], maxEntries] local_variable[type[int], maxDebugEntries] assign[member[.historyStore], ClassCreator(arguments=[MemberReference(member=maxEntries, 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=HistoryStore, sub_type=None))] assign[member[.debugStore], ClassCreator(arguments=[MemberReference(member=maxDebugEntries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=DEBUG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAsBoolean, postfix_operators=[], prefix_operators=[], qualifier=pConfig, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DebugStore, sub_type=None))] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=historyStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=debugStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initMBeans, postfix_operators=[], prefix_operators=[], qualifier=localDispatcher, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error registering config MBean: "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=intError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NotCompliantMBeanException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot register MBean: "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=intError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MBeanRegistrationException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid name for config MBean: "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=intError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MalformedObjectNameException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[initMBeans] operator[SEP] identifier[Configuration] identifier[pConfig] operator[SEP] { Keyword[int] identifier[maxEntries] operator[=] identifier[pConfig] operator[SEP] identifier[getAsInt] operator[SEP] identifier[HISTORY_MAX_ENTRIES] operator[SEP] operator[SEP] Keyword[int] identifier[maxDebugEntries] operator[=] identifier[pConfig] operator[SEP] identifier[getAsInt] operator[SEP] identifier[DEBUG_MAX_ENTRIES] operator[SEP] operator[SEP] identifier[historyStore] operator[=] Keyword[new] identifier[HistoryStore] operator[SEP] identifier[maxEntries] operator[SEP] operator[SEP] identifier[debugStore] operator[=] Keyword[new] identifier[DebugStore] operator[SEP] identifier[maxDebugEntries] , identifier[pConfig] operator[SEP] identifier[getAsBoolean] operator[SEP] identifier[DEBUG] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[localDispatcher] operator[SEP] identifier[initMBeans] operator[SEP] identifier[historyStore] , identifier[debugStore] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NotCompliantMBeanException] identifier[e] operator[SEP] { identifier[intError] operator[SEP] literal[String] operator[+] identifier[e] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[MBeanRegistrationException] identifier[e] operator[SEP] { identifier[intError] operator[SEP] literal[String] operator[+] identifier[e] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[MalformedObjectNameException] identifier[e] operator[SEP] { identifier[intError] operator[SEP] literal[String] operator[+] identifier[e] , identifier[e] operator[SEP] operator[SEP] } }
@BetaApi public final AggregatedListForwardingRulesPagedResponse aggregatedListForwardingRules( String project) { AggregatedListForwardingRulesHttpRequest request = AggregatedListForwardingRulesHttpRequest.newBuilder().setProject(project).build(); return aggregatedListForwardingRules(request); }
class class_name[name] begin[{] method[aggregatedListForwardingRules, return_type[type[AggregatedListForwardingRulesPagedResponse]], modifier[final public], parameter[project]] begin[{] local_variable[type[AggregatedListForwardingRulesHttpRequest], request] return[call[.aggregatedListForwardingRules, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[AggregatedListForwardingRulesPagedResponse] identifier[aggregatedListForwardingRules] operator[SEP] identifier[String] identifier[project] operator[SEP] { identifier[AggregatedListForwardingRulesHttpRequest] identifier[request] operator[=] identifier[AggregatedListForwardingRulesHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setProject] operator[SEP] identifier[project] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[aggregatedListForwardingRules] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public ODocument clusterStatus() { ODistributedStatusRequest request = new ODistributedStatusRequest(); ODistributedStatusResponse response = storage.networkOperation(request, "Error on executing Cluster status "); OLogManager.instance().debug(this, "Cluster status %s", response.getClusterConfig().toJSON("prettyPrint")); return response.getClusterConfig(); }
class class_name[name] begin[{] method[clusterStatus, return_type[type[ODocument]], modifier[public], parameter[]] begin[{] local_variable[type[ODistributedStatusRequest], request] local_variable[type[ODistributedStatusResponse], response] call[OLogManager.instance, parameter[]] return[call[response.getClusterConfig, parameter[]]] end[}] END[}]
Keyword[public] identifier[ODocument] identifier[clusterStatus] operator[SEP] operator[SEP] { identifier[ODistributedStatusRequest] identifier[request] operator[=] Keyword[new] identifier[ODistributedStatusRequest] operator[SEP] operator[SEP] operator[SEP] identifier[ODistributedStatusResponse] identifier[response] operator[=] identifier[storage] operator[SEP] identifier[networkOperation] operator[SEP] identifier[request] , literal[String] operator[SEP] operator[SEP] identifier[OLogManager] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , literal[String] , identifier[response] operator[SEP] identifier[getClusterConfig] operator[SEP] operator[SEP] operator[SEP] identifier[toJSON] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] identifier[getClusterConfig] operator[SEP] operator[SEP] operator[SEP] }
@Override public void reloadAllClasses() throws ClassPathException { BshClassPath bcp = new BshClassPath("temp"); bcp.addComponent( baseClassPath ); bcp.addComponent( BshClassPath.getUserClassPath() ); setClassPath( bcp.getPathComponents() ); }
class class_name[name] begin[{] method[reloadAllClasses, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[BshClassPath], bcp] call[bcp.addComponent, parameter[member[.baseClassPath]]] call[bcp.addComponent, parameter[call[BshClassPath.getUserClassPath, parameter[]]]] call[.setClassPath, parameter[call[bcp.getPathComponents, parameter[]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[reloadAllClasses] operator[SEP] operator[SEP] Keyword[throws] identifier[ClassPathException] { identifier[BshClassPath] identifier[bcp] operator[=] Keyword[new] identifier[BshClassPath] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[bcp] operator[SEP] identifier[addComponent] operator[SEP] identifier[baseClassPath] operator[SEP] operator[SEP] identifier[bcp] operator[SEP] identifier[addComponent] operator[SEP] identifier[BshClassPath] operator[SEP] identifier[getUserClassPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setClassPath] operator[SEP] identifier[bcp] operator[SEP] identifier[getPathComponents] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@BetaApi public final Operation getRegionOperation(String operation) { GetRegionOperationHttpRequest request = GetRegionOperationHttpRequest.newBuilder().setOperation(operation).build(); return getRegionOperation(request); }
class class_name[name] begin[{] method[getRegionOperation, return_type[type[Operation]], modifier[final public], parameter[operation]] begin[{] local_variable[type[GetRegionOperationHttpRequest], request] return[call[.getRegionOperation, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Operation] identifier[getRegionOperation] operator[SEP] identifier[String] identifier[operation] operator[SEP] { identifier[GetRegionOperationHttpRequest] identifier[request] operator[=] identifier[GetRegionOperationHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setOperation] operator[SEP] identifier[operation] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getRegionOperation] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void setGroupsForPath(Integer[] groups, int pathId) { String newGroups = Arrays.toString(groups); newGroups = newGroups.substring(1, newGroups.length() - 1).replaceAll("\\s", ""); logger.info("adding groups={}, to pathId={}", newGroups, pathId); EditService.updatePathTable(Constants.PATH_PROFILE_GROUP_IDS, newGroups, pathId); }
class class_name[name] begin[{] method[setGroupsForPath, return_type[void], modifier[public], parameter[groups, pathId]] begin[{] local_variable[type[String], newGroups] assign[member[.newGroups], call[newGroups.substring, parameter[literal[1], binary_operation[call[newGroups.length, parameter[]], -, literal[1]]]]] call[logger.info, parameter[literal["adding groups={}, to pathId={}"], member[.newGroups], member[.pathId]]] call[EditService.updatePathTable, parameter[member[Constants.PATH_PROFILE_GROUP_IDS], member[.newGroups], member[.pathId]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setGroupsForPath] operator[SEP] identifier[Integer] operator[SEP] operator[SEP] identifier[groups] , Keyword[int] identifier[pathId] operator[SEP] { identifier[String] identifier[newGroups] operator[=] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[groups] operator[SEP] operator[SEP] identifier[newGroups] operator[=] identifier[newGroups] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[newGroups] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[newGroups] , identifier[pathId] operator[SEP] operator[SEP] identifier[EditService] operator[SEP] identifier[updatePathTable] operator[SEP] identifier[Constants] operator[SEP] identifier[PATH_PROFILE_GROUP_IDS] , identifier[newGroups] , identifier[pathId] operator[SEP] operator[SEP] }
@Override public void printError(final SourcePosition pos, final String msg) { wrappedRootDoc.printError(pos, msg); }
class class_name[name] begin[{] method[printError, return_type[void], modifier[public], parameter[pos, msg]] begin[{] call[wrappedRootDoc.printError, parameter[member[.pos], member[.msg]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[printError] operator[SEP] Keyword[final] identifier[SourcePosition] identifier[pos] , Keyword[final] identifier[String] identifier[msg] operator[SEP] { identifier[wrappedRootDoc] operator[SEP] identifier[printError] operator[SEP] identifier[pos] , identifier[msg] operator[SEP] operator[SEP] }
public static int update(PreparedStatement stmt) throws SQLException { int rows = stmt.executeUpdate(); stmt.close(); return rows; }
class class_name[name] begin[{] method[update, return_type[type[int]], modifier[public static], parameter[stmt]] begin[{] local_variable[type[int], rows] call[stmt.close, parameter[]] return[member[.rows]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[update] operator[SEP] identifier[PreparedStatement] identifier[stmt] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[int] identifier[rows] operator[=] identifier[stmt] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP] identifier[stmt] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[rows] operator[SEP] }
public void marshall(ListDeploymentTargetsRequest listDeploymentTargetsRequest, ProtocolMarshaller protocolMarshaller) { if (listDeploymentTargetsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listDeploymentTargetsRequest.getDeploymentId(), DEPLOYMENTID_BINDING); protocolMarshaller.marshall(listDeploymentTargetsRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(listDeploymentTargetsRequest.getTargetFilters(), TARGETFILTERS_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[listDeploymentTargetsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.listDeploymentTargetsRequest], ==, 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=getDeploymentId, postfix_operators=[], prefix_operators=[], qualifier=listDeploymentTargetsRequest, selectors=[], type_arguments=None), MemberReference(member=DEPLOYMENTID_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=getNextToken, postfix_operators=[], prefix_operators=[], qualifier=listDeploymentTargetsRequest, selectors=[], type_arguments=None), MemberReference(member=NEXTTOKEN_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=getTargetFilters, postfix_operators=[], prefix_operators=[], qualifier=listDeploymentTargetsRequest, selectors=[], type_arguments=None), MemberReference(member=TARGETFILTERS_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[ListDeploymentTargetsRequest] identifier[listDeploymentTargetsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[listDeploymentTargetsRequest] 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[listDeploymentTargetsRequest] operator[SEP] identifier[getDeploymentId] operator[SEP] operator[SEP] , identifier[DEPLOYMENTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listDeploymentTargetsRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listDeploymentTargetsRequest] operator[SEP] identifier[getTargetFilters] operator[SEP] operator[SEP] , identifier[TARGETFILTERS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static void equalizeSizes(JComponent[] components) { Dimension targetSize = new Dimension(0, 0); for (int i = 0; i < components.length; i++) { JComponent comp = components[i]; Dimension compSize = comp.getPreferredSize(); double width = Math.max(targetSize.getWidth(), compSize.getWidth()); double height = Math.max(targetSize.getHeight(), compSize.getHeight()); targetSize.setSize(width, height); } setSizes(components, targetSize); }
class class_name[name] begin[{] method[equalizeSizes, return_type[void], modifier[public static], parameter[components]] begin[{] local_variable[type[Dimension], targetSize] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=components, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=comp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JComponent, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPreferredSize, postfix_operators=[], prefix_operators=[], qualifier=comp, selectors=[], type_arguments=None), name=compSize)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Dimension, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=targetSize, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=compSize, selectors=[], type_arguments=None)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=width)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=targetSize, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=compSize, selectors=[], type_arguments=None)], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=height)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSize, postfix_operators=[], prefix_operators=[], qualifier=targetSize, 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=components, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[.setSizes, parameter[member[.components], member[.targetSize]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[equalizeSizes] operator[SEP] identifier[JComponent] operator[SEP] operator[SEP] identifier[components] operator[SEP] { identifier[Dimension] identifier[targetSize] operator[=] Keyword[new] identifier[Dimension] operator[SEP] Other[0] , Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[components] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[JComponent] identifier[comp] operator[=] identifier[components] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Dimension] identifier[compSize] operator[=] identifier[comp] operator[SEP] identifier[getPreferredSize] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[width] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[targetSize] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] , identifier[compSize] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[height] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[targetSize] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] , identifier[compSize] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[targetSize] operator[SEP] identifier[setSize] operator[SEP] identifier[width] , identifier[height] operator[SEP] operator[SEP] } identifier[setSizes] operator[SEP] identifier[components] , identifier[targetSize] operator[SEP] operator[SEP] }
@Override protected void _predict(Dataframe newData) { //load all trainables on the bundles initBundle(); List<Double> weakClassifierWeights = knowledgeBase.getModelParameters().getWeakClassifierWeights(); //create a temporary map for the observed probabilities in training set StorageEngine storageEngine = knowledgeBase.getStorageEngine(); Map<Object, DataTable2D> tmp_recordDecisions = storageEngine.getBigMap("tmp_recordDecisions", Object.class, DataTable2D.class, MapType.HASHMAP, StorageHint.IN_DISK, false, true); //initialize array of recordDecisions for(Integer rId : newData.index()) { tmp_recordDecisions.put(rId, new DataTable2D()); } //using the weak classifiers AssociativeArray classifierWeightsArray = new AssociativeArray(); int totalWeakClassifiers = weakClassifierWeights.size(); for(int i=0;i<totalWeakClassifiers;++i) { AbstractClassifier mlclassifier = (AbstractClassifier) bundle.get(STORAGE_INDICATOR + i); mlclassifier.predict(newData); classifierWeightsArray.put(i, weakClassifierWeights.get(i)); for(Map.Entry<Integer, Record> e : newData.entries()) { Integer rId = e.getKey(); Record r = e.getValue(); AssociativeArray classProbabilities = r.getYPredictedProbabilities(); DataTable2D rDecisions = tmp_recordDecisions.get(rId); rDecisions.put(i, classProbabilities); tmp_recordDecisions.put(rId, rDecisions); //WARNING: Do not remove this! We must put it back to the Map to store it on Disk-backed maps } } //for each record find the combined classification by majority vote for(Map.Entry<Integer, Record> e : newData.entries()) { Integer rId = e.getKey(); Record r = e.getValue(); AssociativeArray combinedClassVotes = FixedCombinationRules.weightedAverage(tmp_recordDecisions.get(rId), classifierWeightsArray); Descriptives.normalize(combinedClassVotes); newData._unsafe_set(rId, new Record(r.getX(), r.getY(), MapMethods.selectMaxKeyValue(combinedClassVotes).getKey(), combinedClassVotes)); } //Drop the temporary Collection storageEngine.dropBigMap("tmp_recordDecisions", tmp_recordDecisions); }
class class_name[name] begin[{] method[_predict, return_type[void], modifier[protected], parameter[newData]] begin[{] call[.initBundle, parameter[]] local_variable[type[List], weakClassifierWeights] local_variable[type[StorageEngine], storageEngine] local_variable[type[Map], tmp_recordDecisions] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DataTable2D, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=tmp_recordDecisions, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=index, postfix_operators=[], prefix_operators=[], qualifier=newData, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None) local_variable[type[AssociativeArray], classifierWeightsArray] local_variable[type[int], totalWeakClassifiers] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=STORAGE_INDICATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=bundle, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractClassifier, sub_type=None)), name=mlclassifier)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractClassifier, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=predict, postfix_operators=[], prefix_operators=[], qualifier=mlclassifier, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=weakClassifierWeights, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=classifierWeightsArray, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=rId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getYPredictedProbabilities, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), name=classProbabilities)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AssociativeArray, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=rId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tmp_recordDecisions, selectors=[], type_arguments=None), name=rDecisions)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataTable2D, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classProbabilities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=rDecisions, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rDecisions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=tmp_recordDecisions, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entries, postfix_operators=[], prefix_operators=[], qualifier=newData, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=totalWeakClassifiers, 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) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=rId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=rId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tmp_recordDecisions, selectors=[], type_arguments=None), MemberReference(member=classifierWeightsArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=weightedAverage, postfix_operators=[], prefix_operators=[], qualifier=FixedCombinationRules, selectors=[], type_arguments=None), name=combinedClassVotes)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AssociativeArray, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=combinedClassVotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=normalize, postfix_operators=[], prefix_operators=[], qualifier=Descriptives, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getX, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getY, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=combinedClassVotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=selectMaxKeyValue, postfix_operators=[], prefix_operators=[], qualifier=MapMethods, selectors=[MethodInvocation(arguments=[], member=getKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=combinedClassVotes, 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=Record, sub_type=None))], member=_unsafe_set, postfix_operators=[], prefix_operators=[], qualifier=newData, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entries, postfix_operators=[], prefix_operators=[], qualifier=newData, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Record, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) call[storageEngine.dropBigMap, parameter[literal["tmp_recordDecisions"], member[.tmp_recordDecisions]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[_predict] operator[SEP] identifier[Dataframe] identifier[newData] operator[SEP] { identifier[initBundle] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Double] operator[>] identifier[weakClassifierWeights] operator[=] identifier[knowledgeBase] operator[SEP] identifier[getModelParameters] operator[SEP] operator[SEP] operator[SEP] identifier[getWeakClassifierWeights] operator[SEP] operator[SEP] operator[SEP] identifier[StorageEngine] identifier[storageEngine] operator[=] identifier[knowledgeBase] operator[SEP] identifier[getStorageEngine] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Object] , identifier[DataTable2D] operator[>] identifier[tmp_recordDecisions] operator[=] identifier[storageEngine] operator[SEP] identifier[getBigMap] operator[SEP] literal[String] , identifier[Object] operator[SEP] Keyword[class] , identifier[DataTable2D] operator[SEP] Keyword[class] , identifier[MapType] operator[SEP] identifier[HASHMAP] , identifier[StorageHint] operator[SEP] identifier[IN_DISK] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[rId] operator[:] identifier[newData] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] { identifier[tmp_recordDecisions] operator[SEP] identifier[put] operator[SEP] identifier[rId] , Keyword[new] identifier[DataTable2D] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[AssociativeArray] identifier[classifierWeightsArray] operator[=] Keyword[new] identifier[AssociativeArray] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[totalWeakClassifiers] operator[=] identifier[weakClassifierWeights] 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[totalWeakClassifiers] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[AbstractClassifier] identifier[mlclassifier] operator[=] operator[SEP] identifier[AbstractClassifier] operator[SEP] identifier[bundle] operator[SEP] identifier[get] operator[SEP] identifier[STORAGE_INDICATOR] operator[+] identifier[i] operator[SEP] operator[SEP] identifier[mlclassifier] operator[SEP] identifier[predict] operator[SEP] identifier[newData] operator[SEP] operator[SEP] identifier[classifierWeightsArray] operator[SEP] identifier[put] operator[SEP] identifier[i] , identifier[weakClassifierWeights] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[Record] operator[>] identifier[e] operator[:] identifier[newData] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] { identifier[Integer] identifier[rId] operator[=] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Record] identifier[r] operator[=] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[AssociativeArray] identifier[classProbabilities] operator[=] identifier[r] operator[SEP] identifier[getYPredictedProbabilities] operator[SEP] operator[SEP] operator[SEP] identifier[DataTable2D] identifier[rDecisions] operator[=] identifier[tmp_recordDecisions] operator[SEP] identifier[get] operator[SEP] identifier[rId] operator[SEP] operator[SEP] identifier[rDecisions] operator[SEP] identifier[put] operator[SEP] identifier[i] , identifier[classProbabilities] operator[SEP] operator[SEP] identifier[tmp_recordDecisions] operator[SEP] identifier[put] operator[SEP] identifier[rId] , identifier[rDecisions] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[Record] operator[>] identifier[e] operator[:] identifier[newData] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] { identifier[Integer] identifier[rId] operator[=] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Record] identifier[r] operator[=] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[AssociativeArray] identifier[combinedClassVotes] operator[=] identifier[FixedCombinationRules] operator[SEP] identifier[weightedAverage] operator[SEP] identifier[tmp_recordDecisions] operator[SEP] identifier[get] operator[SEP] identifier[rId] operator[SEP] , identifier[classifierWeightsArray] operator[SEP] operator[SEP] identifier[Descriptives] operator[SEP] identifier[normalize] operator[SEP] identifier[combinedClassVotes] operator[SEP] operator[SEP] identifier[newData] operator[SEP] identifier[_unsafe_set] operator[SEP] identifier[rId] , Keyword[new] identifier[Record] operator[SEP] identifier[r] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[r] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[MapMethods] operator[SEP] identifier[selectMaxKeyValue] operator[SEP] identifier[combinedClassVotes] operator[SEP] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[combinedClassVotes] operator[SEP] operator[SEP] operator[SEP] } identifier[storageEngine] operator[SEP] identifier[dropBigMap] operator[SEP] literal[String] , identifier[tmp_recordDecisions] operator[SEP] operator[SEP] }
public String getDescription(String name, Locale locale) { ResourceBundle rb = rbs.get(locale); if (rb == null) { ResourceBundle newResourceBundle = ResourceBundle.getBundle("poolstatistics", locale, SecurityActions.getClassLoader(PoolStatisticsImpl.class)); if (newResourceBundle != null) rbs.put(locale, newResourceBundle); } if (rb == null) rb = rbs.get(Locale.US); if (rb != null) return rb.getString(name); return ""; }
class class_name[name] begin[{] method[getDescription, return_type[type[String]], modifier[public], parameter[name, locale]] begin[{] local_variable[type[ResourceBundle], rb] if[binary_operation[member[.rb], ==, literal[null]]] begin[{] local_variable[type[ResourceBundle], newResourceBundle] if[binary_operation[member[.newResourceBundle], !=, literal[null]]] begin[{] call[rbs.put, parameter[member[.locale], member[.newResourceBundle]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.rb], ==, literal[null]]] begin[{] assign[member[.rb], call[rbs.get, parameter[member[Locale.US]]]] else begin[{] None end[}] if[binary_operation[member[.rb], !=, literal[null]]] begin[{] return[call[rb.getString, parameter[member[.name]]]] else begin[{] None end[}] return[literal[""]] end[}] END[}]
Keyword[public] identifier[String] identifier[getDescription] operator[SEP] identifier[String] identifier[name] , identifier[Locale] identifier[locale] operator[SEP] { identifier[ResourceBundle] identifier[rb] operator[=] identifier[rbs] operator[SEP] identifier[get] operator[SEP] identifier[locale] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rb] operator[==] Other[null] operator[SEP] { identifier[ResourceBundle] identifier[newResourceBundle] operator[=] identifier[ResourceBundle] operator[SEP] identifier[getBundle] operator[SEP] literal[String] , identifier[locale] , identifier[SecurityActions] operator[SEP] identifier[getClassLoader] operator[SEP] identifier[PoolStatisticsImpl] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newResourceBundle] operator[!=] Other[null] operator[SEP] identifier[rbs] operator[SEP] identifier[put] operator[SEP] identifier[locale] , identifier[newResourceBundle] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[rb] operator[==] Other[null] operator[SEP] identifier[rb] operator[=] identifier[rbs] operator[SEP] identifier[get] operator[SEP] identifier[Locale] operator[SEP] identifier[US] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rb] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[rb] operator[SEP] identifier[getString] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] }
public void start() throws Exception { Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Cannot be started more than once"); client.getConnectionStateListenable().addListener(connectionStateListener); try { client.create().creatingParentContainersIfNeeded().forPath(path, seedValue); } catch ( KeeperException.NodeExistsException ignore ) { // ignore } readValue(); }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[]] begin[{] call[Preconditions.checkState, parameter[call[state.compareAndSet, parameter[member[State.LATENT], member[State.STARTED]]], literal["Cannot be started more than once"]]] call[client.getConnectionStateListenable, parameter[]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=create, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[MethodInvocation(arguments=[], member=creatingParentContainersIfNeeded, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=seedValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forPath, 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=ignore, types=['KeeperException.NodeExistsException']))], finally_block=None, label=None, resources=None) call[.readValue, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[state] operator[SEP] identifier[compareAndSet] operator[SEP] identifier[State] operator[SEP] identifier[LATENT] , identifier[State] operator[SEP] identifier[STARTED] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[getConnectionStateListenable] operator[SEP] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] identifier[connectionStateListener] operator[SEP] operator[SEP] Keyword[try] { identifier[client] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[creatingParentContainersIfNeeded] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] identifier[path] , identifier[seedValue] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[KeeperException] operator[SEP] identifier[NodeExistsException] identifier[ignore] operator[SEP] { } identifier[readValue] operator[SEP] operator[SEP] operator[SEP] }
@Override public Dsp newProcessor() throws InstantiationException, ClassNotFoundException, IllegalAccessException { int numClasses = this.classes.size(); Codec[] codecs = new Codec[numClasses]; for(int i = 0; i < numClasses; i++) { String fqn = this.classes.get(i); Class<?> codecClass = DspFactoryImpl.class.getClassLoader().loadClass(fqn); codecs[i] = (Codec) codecClass.newInstance(); } return new Dsp(codecs); }
class class_name[name] begin[{] method[newProcessor, return_type[type[Dsp]], modifier[public], parameter[]] begin[{] local_variable[type[int], numClasses] local_variable[type[Codec], codecs] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=classes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=fqn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=fqn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=DspFactoryImpl, sub_type=None)), name=codecClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=codecs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=codecClass, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Codec, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numClasses, 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[ClassCreator(arguments=[MemberReference(member=codecs, 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=Dsp, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Dsp] identifier[newProcessor] operator[SEP] operator[SEP] Keyword[throws] identifier[InstantiationException] , identifier[ClassNotFoundException] , identifier[IllegalAccessException] { Keyword[int] identifier[numClasses] operator[=] Keyword[this] operator[SEP] identifier[classes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[Codec] operator[SEP] operator[SEP] identifier[codecs] operator[=] Keyword[new] identifier[Codec] operator[SEP] identifier[numClasses] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numClasses] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[String] identifier[fqn] operator[=] Keyword[this] operator[SEP] identifier[classes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[codecClass] operator[=] identifier[DspFactoryImpl] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[loadClass] operator[SEP] identifier[fqn] operator[SEP] operator[SEP] identifier[codecs] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[Codec] operator[SEP] identifier[codecClass] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Dsp] operator[SEP] identifier[codecs] operator[SEP] operator[SEP] }
public void marshall(SegmentsResponse segmentsResponse, ProtocolMarshaller protocolMarshaller) { if (segmentsResponse == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(segmentsResponse.getItem(), ITEM_BINDING); protocolMarshaller.marshall(segmentsResponse.getNextToken(), NEXTTOKEN_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[segmentsResponse, protocolMarshaller]] begin[{] if[binary_operation[member[.segmentsResponse], ==, 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=getItem, postfix_operators=[], prefix_operators=[], qualifier=segmentsResponse, selectors=[], type_arguments=None), MemberReference(member=ITEM_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=getNextToken, postfix_operators=[], prefix_operators=[], qualifier=segmentsResponse, selectors=[], type_arguments=None), MemberReference(member=NEXTTOKEN_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[SegmentsResponse] identifier[segmentsResponse] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[segmentsResponse] 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[segmentsResponse] operator[SEP] identifier[getItem] operator[SEP] operator[SEP] , identifier[ITEM_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[segmentsResponse] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_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] } }
@Override public Object invoke(MethodInvocation invocation) throws Throwable { Object result = null; Method m = invocation.getMethod(); Annotation[] annotations = m.getAnnotations(); if (annotations.length > 0) { Annotation stepAnnotation = annotations[annotations.length - 1]; for (Annotation a : annotations) { if (a.annotationType().getName().startsWith("cucumber.api.java." + Context.getLocale().getLanguage())) { stepAnnotation = a; break; } } if (stepAnnotation.annotationType().isAnnotationPresent(StepDefAnnotation.class)) { Matcher matcher = Pattern.compile("value=(.*)\\)").matcher(stepAnnotation.toString()); if (matcher.find()) { logger.info( "> " + stepAnnotation.annotationType().getSimpleName() + " " + String.format(matcher.group(1).replace("(.*)", "%s").replace("[\\.|\\?]", ""), invocation.getArguments())); } } } if (m.isAnnotationPresent(RetryOnFailure.class)) { RetryOnFailure retryAnnotation = m.getAnnotation(RetryOnFailure.class); if (retryAnnotation.verbose()) { logger.info("NORAUI StepInterceptor invoke method " + m); } for (int i = 0; i < retryAnnotation.attempts(); i++) { try { if (retryAnnotation.verbose()) { logger.info("NORAUI StepInterceptor attempt n° " + i); } return invocation.proceed(); } catch (FailureException e) { if (retryAnnotation.verbose()) { logger.info("NORAUI StepInterceptor Exception " + e.getMessage()); } if (i == retryAnnotation.attempts() - 1) { e.getFailure().fail(); } Thread.sleep(retryAnnotation.unit().toMillis(retryAnnotation.delay())); } } } else { try { return invocation.proceed(); } catch (FailureException e) { if (Modifier.isPublic(m.getModifiers())) { e.getFailure().fail(); } else { throw e; } } } return result; }
class class_name[name] begin[{] method[invoke, return_type[type[Object]], modifier[public], parameter[invocation]] begin[{] local_variable[type[Object], result] local_variable[type[Method], m] local_variable[type[Annotation], annotations] if[binary_operation[member[annotations.length], >, literal[0]]] begin[{] local_variable[type[Annotation], stepAnnotation] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=annotationType, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cucumber.api.java."), operandr=MethodInvocation(arguments=[], member=getLocale, postfix_operators=[], prefix_operators=[], qualifier=Context, selectors=[MethodInvocation(arguments=[], member=getLanguage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stepAnnotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=annotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=a)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))), label=None) if[call[stepAnnotation.annotationType, parameter[]]] begin[{] local_variable[type[Matcher], matcher] if[call[matcher.find, parameter[]]] begin[{] call[logger.info, parameter[binary_operation[binary_operation[binary_operation[literal["> "], +, call[stepAnnotation.annotationType, parameter[]]], +, literal[" "]], +, call[String.format, parameter[call[matcher.group, parameter[literal[1]]], call[invocation.getArguments, parameter[]]]]]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] if[call[m.isAnnotationPresent, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RetryOnFailure, sub_type=None))]]] begin[{] local_variable[type[RetryOnFailure], retryAnnotation] if[call[retryAnnotation.verbose, parameter[]]] begin[{] call[logger.info, parameter[binary_operation[literal["NORAUI StepInterceptor invoke method "], +, member[.m]]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=verbose, postfix_operators=[], prefix_operators=[], qualifier=retryAnnotation, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NORAUI StepInterceptor attempt n° "), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[], member=proceed, postfix_operators=[], prefix_operators=[], qualifier=invocation, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=verbose, postfix_operators=[], prefix_operators=[], qualifier=retryAnnotation, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NORAUI StepInterceptor Exception "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=attempts, postfix_operators=[], prefix_operators=[], qualifier=retryAnnotation, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getFailure, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=fail, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=unit, postfix_operators=[], prefix_operators=[], qualifier=retryAnnotation, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=delay, postfix_operators=[], prefix_operators=[], qualifier=retryAnnotation, selectors=[], type_arguments=None)], member=toMillis, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FailureException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=attempts, postfix_operators=[], prefix_operators=[], qualifier=retryAnnotation, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=proceed, postfix_operators=[], prefix_operators=[], qualifier=invocation, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=isPublic, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getFailure, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=fail, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FailureException']))], finally_block=None, label=None, resources=None) end[}] return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[invoke] operator[SEP] identifier[MethodInvocation] identifier[invocation] operator[SEP] Keyword[throws] identifier[Throwable] { identifier[Object] identifier[result] operator[=] Other[null] operator[SEP] identifier[Method] identifier[m] operator[=] identifier[invocation] operator[SEP] identifier[getMethod] operator[SEP] operator[SEP] operator[SEP] identifier[Annotation] operator[SEP] operator[SEP] identifier[annotations] operator[=] identifier[m] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[annotations] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[Annotation] identifier[stepAnnotation] operator[=] identifier[annotations] operator[SEP] identifier[annotations] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Annotation] identifier[a] operator[:] identifier[annotations] operator[SEP] { Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[annotationType] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[+] identifier[Context] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[stepAnnotation] operator[=] identifier[a] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[stepAnnotation] operator[SEP] identifier[annotationType] operator[SEP] operator[SEP] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[StepDefAnnotation] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[matcher] operator[SEP] identifier[stepAnnotation] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[stepAnnotation] operator[SEP] identifier[annotationType] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] , identifier[invocation] operator[SEP] identifier[getArguments] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[RetryOnFailure] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[RetryOnFailure] identifier[retryAnnotation] operator[=] identifier[m] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[RetryOnFailure] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[retryAnnotation] operator[SEP] identifier[verbose] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[m] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[retryAnnotation] operator[SEP] identifier[attempts] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[retryAnnotation] operator[SEP] identifier[verbose] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[invocation] operator[SEP] identifier[proceed] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FailureException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[retryAnnotation] operator[SEP] identifier[verbose] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[i] operator[==] identifier[retryAnnotation] operator[SEP] identifier[attempts] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] { identifier[e] operator[SEP] identifier[getFailure] operator[SEP] operator[SEP] operator[SEP] identifier[fail] operator[SEP] operator[SEP] operator[SEP] } identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] identifier[retryAnnotation] operator[SEP] identifier[unit] operator[SEP] operator[SEP] operator[SEP] identifier[toMillis] operator[SEP] identifier[retryAnnotation] operator[SEP] identifier[delay] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] { Keyword[try] { Keyword[return] identifier[invocation] operator[SEP] identifier[proceed] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FailureException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isPublic] operator[SEP] identifier[m] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[e] operator[SEP] identifier[getFailure] operator[SEP] operator[SEP] operator[SEP] identifier[fail] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] identifier[e] operator[SEP] } } } Keyword[return] identifier[result] operator[SEP] }
boolean matches(final char[] value, final int from) { // Check the bounds final int len = myCharacters.length; if (len + from > value.length || from < 0) { return false; } // Bounds are ok, check all characters. // Allow question marks to match any character for (int i = 0; i < len; i++) { if (myCharacters[i] != value[i + from] && myCharacters[i] != '?') { return false; } } // All characters match return true; }
class class_name[name] begin[{] method[matches, return_type[type[boolean]], modifier[default], parameter[value, from]] begin[{] local_variable[type[int], len] if[binary_operation[binary_operation[binary_operation[member[.len], +, member[.from]], >, member[value.length]], ||, binary_operation[member[.from], <, literal[0]]]] begin[{] return[literal[false]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=myCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=from, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=myCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='?'), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, 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[literal[true]] end[}] END[}]
Keyword[boolean] identifier[matches] operator[SEP] Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[value] , Keyword[final] Keyword[int] identifier[from] operator[SEP] { Keyword[final] Keyword[int] identifier[len] operator[=] identifier[myCharacters] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[+] identifier[from] operator[>] identifier[value] operator[SEP] identifier[length] operator[||] identifier[from] operator[<] Other[0] 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[len] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[myCharacters] operator[SEP] identifier[i] operator[SEP] operator[!=] identifier[value] operator[SEP] identifier[i] operator[+] identifier[from] operator[SEP] operator[&&] identifier[myCharacters] operator[SEP] identifier[i] operator[SEP] operator[!=] literal[String] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
@Nonnull public TriggerKey scheduleJob (@Nonnull final String sJobName, @Nonnull final JDK8TriggerBuilder <? extends ITrigger> aTriggerBuilder, @Nonnull final Class <? extends IJob> aJobClass, @Nullable final Map <String, ? extends Object> aJobData) { ValueEnforcer.notNull (sJobName, "JobName"); ValueEnforcer.notNull (aTriggerBuilder, "TriggerBuilder"); ValueEnforcer.notNull (aJobClass, "JobClass"); // what to do final IJobDetail aJobDetail = JobBuilder.newJob (aJobClass).withIdentity (sJobName, m_sGroupName).build (); // add custom parameters aJobDetail.getJobDataMap ().putAllIn (aJobData); try { // Schedule now final ITrigger aTrigger = aTriggerBuilder.build (); m_aScheduler.scheduleJob (aJobDetail, aTrigger); final TriggerKey ret = aTrigger.getKey (); LOGGER.info ("Succesfully scheduled job '" + sJobName + "' with TriggerKey " + ret.toString () + " - starting at " + PDTFactory.createLocalDateTime (aTrigger.getStartTime ())); return ret; } catch (final SchedulerException ex) { throw new RuntimeException (ex); } }
class class_name[name] begin[{] method[scheduleJob, return_type[type[TriggerKey]], modifier[public], parameter[sJobName, aTriggerBuilder, aJobClass, aJobData]] begin[{] call[ValueEnforcer.notNull, parameter[member[.sJobName], literal["JobName"]]] call[ValueEnforcer.notNull, parameter[member[.aTriggerBuilder], literal["TriggerBuilder"]]] call[ValueEnforcer.notNull, parameter[member[.aJobClass], literal["JobClass"]]] local_variable[type[IJobDetail], aJobDetail] call[aJobDetail.getJobDataMap, parameter[]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=aTriggerBuilder, selectors=[], type_arguments=None), name=aTrigger)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ITrigger, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aJobDetail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aTrigger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=scheduleJob, postfix_operators=[], prefix_operators=[], qualifier=m_aScheduler, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=aTrigger, selectors=[], type_arguments=None), name=ret)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TriggerKey, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Succesfully scheduled job '"), operandr=MemberReference(member=sJobName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' with TriggerKey "), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - starting at "), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStartTime, postfix_operators=[], prefix_operators=[], qualifier=aTrigger, selectors=[], type_arguments=None)], member=createLocalDateTime, postfix_operators=[], prefix_operators=[], qualifier=PDTFactory, selectors=[], type_arguments=None), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[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=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SchedulerException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] identifier[TriggerKey] identifier[scheduleJob] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[String] identifier[sJobName] , annotation[@] identifier[Nonnull] Keyword[final] identifier[JDK8TriggerBuilder] operator[<] operator[?] Keyword[extends] identifier[ITrigger] operator[>] identifier[aTriggerBuilder] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[IJob] operator[>] identifier[aJobClass] , annotation[@] identifier[Nullable] Keyword[final] identifier[Map] operator[<] identifier[String] , operator[?] Keyword[extends] identifier[Object] operator[>] identifier[aJobData] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[sJobName] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aTriggerBuilder] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aJobClass] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[IJobDetail] identifier[aJobDetail] operator[=] identifier[JobBuilder] operator[SEP] identifier[newJob] operator[SEP] identifier[aJobClass] operator[SEP] operator[SEP] identifier[withIdentity] operator[SEP] identifier[sJobName] , identifier[m_sGroupName] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[aJobDetail] operator[SEP] identifier[getJobDataMap] operator[SEP] operator[SEP] operator[SEP] identifier[putAllIn] operator[SEP] identifier[aJobData] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[ITrigger] identifier[aTrigger] operator[=] identifier[aTriggerBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[m_aScheduler] operator[SEP] identifier[scheduleJob] operator[SEP] identifier[aJobDetail] , identifier[aTrigger] operator[SEP] operator[SEP] Keyword[final] identifier[TriggerKey] identifier[ret] operator[=] identifier[aTrigger] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[sJobName] operator[+] literal[String] operator[+] identifier[ret] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[PDTFactory] operator[SEP] identifier[createLocalDateTime] operator[SEP] identifier[aTrigger] operator[SEP] identifier[getStartTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[SchedulerException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
public Integer getNumberFor(WebElement element) { Integer number = null; if ("li".equalsIgnoreCase(element.getTagName()) && element.isDisplayed()) { int num; String ownVal = element.getAttribute("value"); if (ownVal != null && !"0".equals(ownVal)) { num = toInt(ownVal, 0); } else { String start = element.findElement(By.xpath("ancestor::ol")).getAttribute("start"); num = toInt(start, 1); List<WebElement> allItems = element.findElements(By.xpath("ancestor::ol/li")); int index = allItems.indexOf(element); for (int i = 0; i < index; i++) { WebElement item = allItems.get(i); if (item.isDisplayed()) { num++; String val = item.getAttribute("value"); int valNum = toInt(val, num); if (valNum != 0) { num = valNum + 1; } } } } number = num; } return number; }
class class_name[name] begin[{] method[getNumberFor, return_type[type[Integer]], modifier[public], parameter[element]] begin[{] local_variable[type[Integer], number] if[binary_operation[literal["li"], &&, call[element.isDisplayed, parameter[]]]] begin[{] local_variable[type[int], num] local_variable[type[String], ownVal] if[binary_operation[binary_operation[member[.ownVal], !=, literal[null]], &&, literal["0"]]] begin[{] assign[member[.num], call[.toInt, parameter[member[.ownVal], literal[0]]]] else begin[{] local_variable[type[String], start] assign[member[.num], call[.toInt, parameter[member[.start], literal[1]]]] local_variable[type[List], allItems] local_variable[type[int], index] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=allItems, selectors=[], type_arguments=None), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WebElement, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDisplayed, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=num, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value")], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=num, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=valNum)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=valNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=num, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=valNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=index, 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) end[}] assign[member[.number], member[.num]] else begin[{] None end[}] return[member[.number]] end[}] END[}]
Keyword[public] identifier[Integer] identifier[getNumberFor] operator[SEP] identifier[WebElement] identifier[element] operator[SEP] { identifier[Integer] identifier[number] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[element] operator[SEP] identifier[getTagName] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[element] operator[SEP] identifier[isDisplayed] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[num] operator[SEP] identifier[String] identifier[ownVal] operator[=] identifier[element] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ownVal] operator[!=] Other[null] operator[&&] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[ownVal] operator[SEP] operator[SEP] { identifier[num] operator[=] identifier[toInt] operator[SEP] identifier[ownVal] , Other[0] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] identifier[start] operator[=] identifier[element] operator[SEP] identifier[findElement] operator[SEP] identifier[By] operator[SEP] identifier[xpath] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[num] operator[=] identifier[toInt] operator[SEP] identifier[start] , Other[1] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[WebElement] operator[>] identifier[allItems] operator[=] identifier[element] operator[SEP] identifier[findElements] operator[SEP] identifier[By] operator[SEP] identifier[xpath] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[allItems] operator[SEP] identifier[indexOf] operator[SEP] identifier[element] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[index] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[WebElement] identifier[item] operator[=] identifier[allItems] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[isDisplayed] operator[SEP] operator[SEP] operator[SEP] { identifier[num] operator[++] operator[SEP] identifier[String] identifier[val] operator[=] identifier[item] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[valNum] operator[=] identifier[toInt] operator[SEP] identifier[val] , identifier[num] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[valNum] operator[!=] Other[0] operator[SEP] { identifier[num] operator[=] identifier[valNum] operator[+] Other[1] operator[SEP] } } } } identifier[number] operator[=] identifier[num] operator[SEP] } Keyword[return] identifier[number] operator[SEP] }
public Bbox getBounds() { Bbox bounds = null; if (!isEmpty()) { for (Polygon polygon : polygons) { if (bounds == null) { bounds = polygon.getBounds(); } else { bounds = bounds.union(polygon.getBounds()); } } } return bounds; }
class class_name[name] begin[{] method[getBounds, return_type[type[Bbox]], modifier[public], parameter[]] begin[{] local_variable[type[Bbox], bounds] if[call[.isEmpty, parameter[]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bounds, 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=Assignment(expressionl=MemberReference(member=bounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBounds, postfix_operators=[], prefix_operators=[], qualifier=polygon, selectors=[], type_arguments=None)], member=union, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getBounds, postfix_operators=[], prefix_operators=[], qualifier=polygon, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=polygons, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=polygon)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Polygon, sub_type=None))), label=None) else begin[{] None end[}] return[member[.bounds]] end[}] END[}]
Keyword[public] identifier[Bbox] identifier[getBounds] operator[SEP] operator[SEP] { identifier[Bbox] identifier[bounds] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Polygon] identifier[polygon] operator[:] identifier[polygons] operator[SEP] { Keyword[if] operator[SEP] identifier[bounds] operator[==] Other[null] operator[SEP] { identifier[bounds] operator[=] identifier[polygon] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[bounds] operator[=] identifier[bounds] operator[SEP] identifier[union] operator[SEP] identifier[polygon] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] identifier[bounds] operator[SEP] }
public void marshall(CreateAppRequest createAppRequest, ProtocolMarshaller protocolMarshaller) { if (createAppRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createAppRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createAppRequest.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(createAppRequest.getRoleName(), ROLENAME_BINDING); protocolMarshaller.marshall(createAppRequest.getClientToken(), CLIENTTOKEN_BINDING); protocolMarshaller.marshall(createAppRequest.getServerGroups(), SERVERGROUPS_BINDING); protocolMarshaller.marshall(createAppRequest.getTags(), TAGS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[createAppRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.createAppRequest], ==, 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=createAppRequest, 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=createAppRequest, 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=getRoleName, postfix_operators=[], prefix_operators=[], qualifier=createAppRequest, selectors=[], type_arguments=None), MemberReference(member=ROLENAME_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=getClientToken, postfix_operators=[], prefix_operators=[], qualifier=createAppRequest, selectors=[], type_arguments=None), MemberReference(member=CLIENTTOKEN_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=getServerGroups, postfix_operators=[], prefix_operators=[], qualifier=createAppRequest, selectors=[], type_arguments=None), MemberReference(member=SERVERGROUPS_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=createAppRequest, selectors=[], type_arguments=None), MemberReference(member=TAGS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[CreateAppRequest] identifier[createAppRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createAppRequest] 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[createAppRequest] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAppRequest] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] , identifier[DESCRIPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAppRequest] operator[SEP] identifier[getRoleName] operator[SEP] operator[SEP] , identifier[ROLENAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAppRequest] operator[SEP] identifier[getClientToken] operator[SEP] operator[SEP] , identifier[CLIENTTOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAppRequest] operator[SEP] identifier[getServerGroups] operator[SEP] operator[SEP] , identifier[SERVERGROUPS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createAppRequest] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] , identifier[TAGS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static IntegerBinding abs(final ObservableIntegerValue a) { return createIntegerBinding(() -> Math.abs(a.get()), a); }
class class_name[name] begin[{] method[abs, return_type[type[IntegerBinding]], modifier[public static], parameter[a]] begin[{] return[call[.createIntegerBinding, parameter[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), parameters=[]), member[.a]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[IntegerBinding] identifier[abs] operator[SEP] Keyword[final] identifier[ObservableIntegerValue] identifier[a] operator[SEP] { Keyword[return] identifier[createIntegerBinding] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[a] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] , identifier[a] operator[SEP] operator[SEP] }
public static synchronized OmemoManager getInstanceFor(XMPPConnection connection) { TreeMap<Integer, OmemoManager> managers = INSTANCES.get(connection); if (managers == null) { managers = new TreeMap<>(); INSTANCES.put(connection, managers); } OmemoManager manager; if (managers.size() == 0) { manager = new OmemoManager(connection, UNKNOWN_DEVICE_ID); managers.put(UNKNOWN_DEVICE_ID, manager); } else { manager = managers.get(managers.firstKey()); } return manager; }
class class_name[name] begin[{] method[getInstanceFor, return_type[type[OmemoManager]], modifier[synchronized public static], parameter[connection]] begin[{] local_variable[type[TreeMap], managers] if[binary_operation[member[.managers], ==, literal[null]]] begin[{] assign[member[.managers], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=TreeMap, sub_type=None))] call[INSTANCES.put, parameter[member[.connection], member[.managers]]] else begin[{] None end[}] local_variable[type[OmemoManager], manager] if[binary_operation[call[managers.size, parameter[]], ==, literal[0]]] begin[{] assign[member[.manager], ClassCreator(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UNKNOWN_DEVICE_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=OmemoManager, sub_type=None))] call[managers.put, parameter[member[.UNKNOWN_DEVICE_ID], member[.manager]]] else begin[{] assign[member[.manager], call[managers.get, parameter[call[managers.firstKey, parameter[]]]]] end[}] return[member[.manager]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[synchronized] identifier[OmemoManager] identifier[getInstanceFor] operator[SEP] identifier[XMPPConnection] identifier[connection] operator[SEP] { identifier[TreeMap] operator[<] identifier[Integer] , identifier[OmemoManager] operator[>] identifier[managers] operator[=] identifier[INSTANCES] operator[SEP] identifier[get] operator[SEP] identifier[connection] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[managers] operator[==] Other[null] operator[SEP] { identifier[managers] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[INSTANCES] operator[SEP] identifier[put] operator[SEP] identifier[connection] , identifier[managers] operator[SEP] operator[SEP] } identifier[OmemoManager] identifier[manager] operator[SEP] Keyword[if] operator[SEP] identifier[managers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[manager] operator[=] Keyword[new] identifier[OmemoManager] operator[SEP] identifier[connection] , identifier[UNKNOWN_DEVICE_ID] operator[SEP] operator[SEP] identifier[managers] operator[SEP] identifier[put] operator[SEP] identifier[UNKNOWN_DEVICE_ID] , identifier[manager] operator[SEP] operator[SEP] } Keyword[else] { identifier[manager] operator[=] identifier[managers] operator[SEP] identifier[get] operator[SEP] identifier[managers] operator[SEP] identifier[firstKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[manager] operator[SEP] }
public List<ConfigElement> getNestedInstances(RegistryEntry re) throws ConfigMergeException { return getNestedInstances(re, new HashSet<RegistryEntry>()); }
class class_name[name] begin[{] method[getNestedInstances, return_type[type[List]], modifier[public], parameter[re]] begin[{] return[call[.getNestedInstances, parameter[member[.re], 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=RegistryEntry, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[ConfigElement] operator[>] identifier[getNestedInstances] operator[SEP] identifier[RegistryEntry] identifier[re] operator[SEP] Keyword[throws] identifier[ConfigMergeException] { Keyword[return] identifier[getNestedInstances] operator[SEP] identifier[re] , Keyword[new] identifier[HashSet] operator[<] identifier[RegistryEntry] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static boolean endObject(JsonParser par) { JsonToken token = par.getCurrentToken(); return token != null && token != JsonToken.END_OBJECT; }
class class_name[name] begin[{] method[endObject, return_type[type[boolean]], modifier[public static], parameter[par]] begin[{] local_variable[type[JsonToken], token] return[binary_operation[binary_operation[member[.token], !=, literal[null]], &&, binary_operation[member[.token], !=, member[JsonToken.END_OBJECT]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[endObject] operator[SEP] identifier[JsonParser] identifier[par] operator[SEP] { identifier[JsonToken] identifier[token] operator[=] identifier[par] operator[SEP] identifier[getCurrentToken] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[token] operator[!=] Other[null] operator[&&] identifier[token] operator[!=] identifier[JsonToken] operator[SEP] identifier[END_OBJECT] operator[SEP] }
@Override public SetSubscriptionAttributesResult setSubscriptionAttributes(SetSubscriptionAttributesRequest request) { request = beforeClientExecution(request); return executeSetSubscriptionAttributes(request); }
class class_name[name] begin[{] method[setSubscriptionAttributes, return_type[type[SetSubscriptionAttributesResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeSetSubscriptionAttributes, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[SetSubscriptionAttributesResult] identifier[setSubscriptionAttributes] operator[SEP] identifier[SetSubscriptionAttributesRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeSetSubscriptionAttributes] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static void setValue(MetaPartition partition, AnyTypeObject dataObject, Object value) { MetaDataObject meta = (MetaDataObject) partition.getMeta(dataObject.getClass()); if (value == null) { for (MetaAttribute attr : meta.getAttributes()) { attr.setValue(dataObject, null); } } else { boolean found = false; for (MetaAttribute attr : meta.getAttributes()) { if (attr.getName().equals(TYPE_ATTRIBUTE)) { continue; } if (attr.getType().getImplementationClass().isAssignableFrom(value.getClass())) { attr.setValue(dataObject, value); found = true; } else { attr.setValue(dataObject, null); } } if (!found) { throw new IllegalStateException("cannot assign " + value + " to " + dataObject); } } }
class class_name[name] begin[{] method[setValue, return_type[void], modifier[public static], parameter[partition, dataObject, value]] begin[{] local_variable[type[MetaDataObject], meta] if[binary_operation[member[.value], ==, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dataObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=meta, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MetaAttribute, sub_type=None))), label=None) else begin[{] local_variable[type[boolean], found] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[MethodInvocation(arguments=[MemberReference(member=TYPE_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[MethodInvocation(arguments=[], member=getImplementationClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dataObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dataObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=meta, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MetaAttribute, sub_type=None))), label=None) if[member[.found]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cannot assign "), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to "), operator=+), operandr=MemberReference(member=dataObject, 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=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setValue] operator[SEP] identifier[MetaPartition] identifier[partition] , identifier[AnyTypeObject] identifier[dataObject] , identifier[Object] identifier[value] operator[SEP] { identifier[MetaDataObject] identifier[meta] operator[=] operator[SEP] identifier[MetaDataObject] operator[SEP] identifier[partition] operator[SEP] identifier[getMeta] operator[SEP] identifier[dataObject] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[MetaAttribute] identifier[attr] operator[:] identifier[meta] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] { identifier[attr] operator[SEP] identifier[setValue] operator[SEP] identifier[dataObject] , Other[null] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[boolean] identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[MetaAttribute] identifier[attr] operator[:] identifier[meta] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[attr] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[TYPE_ATTRIBUTE] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[attr] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[getImplementationClass] operator[SEP] operator[SEP] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[attr] operator[SEP] identifier[setValue] operator[SEP] identifier[dataObject] , identifier[value] operator[SEP] operator[SEP] identifier[found] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[attr] operator[SEP] identifier[setValue] operator[SEP] identifier[dataObject] , Other[null] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[found] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[value] operator[+] literal[String] operator[+] identifier[dataObject] operator[SEP] operator[SEP] } } }
@Override public Set<KamNode> getAdjacentNodes(KamNode kamNode) { return getAdjacentNodes(kamNode, EdgeDirectionType.BOTH, null, null); }
class class_name[name] begin[{] method[getAdjacentNodes, return_type[type[Set]], modifier[public], parameter[kamNode]] begin[{] return[call[.getAdjacentNodes, parameter[member[.kamNode], member[EdgeDirectionType.BOTH], literal[null], literal[null]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[KamNode] operator[>] identifier[getAdjacentNodes] operator[SEP] identifier[KamNode] identifier[kamNode] operator[SEP] { Keyword[return] identifier[getAdjacentNodes] operator[SEP] identifier[kamNode] , identifier[EdgeDirectionType] operator[SEP] identifier[BOTH] , Other[null] , Other[null] operator[SEP] operator[SEP] }
public String getIconPathProjectState() { String iconPath; if (getProjectState() == STATE_MODIFIED_IN_CURRENT_PROJECT) { iconPath = "this.png"; } else if (getProjectState() == STATE_MODIFIED_IN_OTHER_PROJECT) { iconPath = "other.png"; } else if (getProjectState() == STATE_LOCKED_FOR_PUBLISHING) { iconPath = "publish.png"; } else { // STATE_UNLOCKED iconPath = "none.gif"; } return "explorer/project_" + iconPath; }
class class_name[name] begin[{] method[getIconPathProjectState, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], iconPath] if[binary_operation[call[.getProjectState, parameter[]], ==, member[.STATE_MODIFIED_IN_CURRENT_PROJECT]]] begin[{] assign[member[.iconPath], literal["this.png"]] else begin[{] if[binary_operation[call[.getProjectState, parameter[]], ==, member[.STATE_MODIFIED_IN_OTHER_PROJECT]]] begin[{] assign[member[.iconPath], literal["other.png"]] else begin[{] if[binary_operation[call[.getProjectState, parameter[]], ==, member[.STATE_LOCKED_FOR_PUBLISHING]]] begin[{] assign[member[.iconPath], literal["publish.png"]] else begin[{] assign[member[.iconPath], literal["none.gif"]] end[}] end[}] end[}] return[binary_operation[literal["explorer/project_"], +, member[.iconPath]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getIconPathProjectState] operator[SEP] operator[SEP] { identifier[String] identifier[iconPath] operator[SEP] Keyword[if] operator[SEP] identifier[getProjectState] operator[SEP] operator[SEP] operator[==] identifier[STATE_MODIFIED_IN_CURRENT_PROJECT] operator[SEP] { identifier[iconPath] operator[=] literal[String] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[getProjectState] operator[SEP] operator[SEP] operator[==] identifier[STATE_MODIFIED_IN_OTHER_PROJECT] operator[SEP] { identifier[iconPath] operator[=] literal[String] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[getProjectState] operator[SEP] operator[SEP] operator[==] identifier[STATE_LOCKED_FOR_PUBLISHING] operator[SEP] { identifier[iconPath] operator[=] literal[String] operator[SEP] } Keyword[else] { identifier[iconPath] operator[=] literal[String] operator[SEP] } Keyword[return] literal[String] operator[+] identifier[iconPath] operator[SEP] }
public void populateComponent(final ComponentSystemEvent event) { UIComponent component = event.getComponent(); int[] rowcol = CellUtility .getRowColFromComponentAttributes(component); int row = rowcol[0]; int col = rowcol[1]; FacesCell fcell = CellUtility.getFacesCellFromBodyRow(row, col, this.getBodyRows(), this.getCurrent().getCurrentTopRow(), this.getCurrent().getCurrentLeftColumn()); CellControlsUtility.populateAttributes(component, fcell, this.getCellDefaultControl()); }
class class_name[name] begin[{] method[populateComponent, return_type[void], modifier[public], parameter[event]] begin[{] local_variable[type[UIComponent], component] local_variable[type[int], rowcol] local_variable[type[int], row] local_variable[type[int], col] local_variable[type[FacesCell], fcell] call[CellControlsUtility.populateAttributes, parameter[member[.component], member[.fcell], THIS[call[None.getCellDefaultControl, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[populateComponent] operator[SEP] Keyword[final] identifier[ComponentSystemEvent] identifier[event] operator[SEP] { identifier[UIComponent] identifier[component] operator[=] identifier[event] operator[SEP] identifier[getComponent] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[rowcol] operator[=] identifier[CellUtility] operator[SEP] identifier[getRowColFromComponentAttributes] operator[SEP] identifier[component] operator[SEP] operator[SEP] Keyword[int] identifier[row] operator[=] identifier[rowcol] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[col] operator[=] identifier[rowcol] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[FacesCell] identifier[fcell] operator[=] identifier[CellUtility] operator[SEP] identifier[getFacesCellFromBodyRow] operator[SEP] identifier[row] , identifier[col] , Keyword[this] operator[SEP] identifier[getBodyRows] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentTopRow] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentLeftColumn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CellControlsUtility] operator[SEP] identifier[populateAttributes] operator[SEP] identifier[component] , identifier[fcell] , Keyword[this] operator[SEP] identifier[getCellDefaultControl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void newManyToOneRelationship( final Project project, final JavaResource resource, final String fieldName, final String fieldType, final String inverseFieldName, final FetchType fetchType, final boolean required, final Iterable<CascadeType> cascadeTypes) throws FileNotFoundException { JavaSourceFacet java = project.getFacet(JavaSourceFacet.class); JavaClassSource many = getJavaClassFrom(resource); JavaClassSource one; if (areTypesSame(fieldType, many.getCanonicalName())) { one = many; } else { one = findEntity(project, fieldType); many.addImport(one); } if (many.hasField(fieldName)) { throw new IllegalStateException("Entity [" + many.getCanonicalName() + "] already has a field named [" + fieldName + "]"); } if (!Strings.isNullOrEmpty(inverseFieldName) && one.hasField(inverseFieldName)) { throw new IllegalStateException("Entity [" + one.getCanonicalName() + "] already has a field named [" + inverseFieldName + "]"); } FieldSource<JavaClassSource> manyField = many.addField("private " + one.getName() + " " + fieldName + ";"); AnnotationSource<JavaClassSource> manyAnnotation = manyField.addAnnotation(ManyToOne.class); Refactory.createGetterAndSetter(many, manyField); if (!Strings.isNullOrEmpty(inverseFieldName)) { one.addImport(Set.class); one.addImport(HashSet.class); if (!one.getCanonicalName().equals(many.getCanonicalName())) { one.addImport(many.getQualifiedName()); } FieldSource<JavaClassSource> oneField = one.addField("private Set<" + many.getName() + "> " + inverseFieldName + "= new HashSet<" + many.getName() + ">();"); AnnotationSource<JavaClassSource> oneAnnotation = oneField.addAnnotation(OneToMany.class).setStringValue( "mappedBy", fieldName); oneAnnotation.setLiteralValue("cascade", "CascadeType.ALL"); oneAnnotation.getOrigin().addImport(CascadeType.class); Refactory.createGetterAndSetter(one, oneField); java.saveJavaSource(one); } if (fetchType != null && fetchType != FetchType.EAGER) { manyAnnotation.setEnumValue("fetch", fetchType); } if (required) { // Set the optional attribute of @OneToOne/@ManyToOne only when false, since the default value is true manyAnnotation.setLiteralValue("optional", "false"); } addCascade(cascadeTypes, manyAnnotation); java.saveJavaSource(many); }
class class_name[name] begin[{] method[newManyToOneRelationship, return_type[void], modifier[public], parameter[project, resource, fieldName, fieldType, inverseFieldName, fetchType, required, cascadeTypes]] begin[{] local_variable[type[JavaSourceFacet], java] local_variable[type[JavaClassSource], many] local_variable[type[JavaClassSource], one] if[call[.areTypesSame, parameter[member[.fieldType], call[many.getCanonicalName, parameter[]]]]] begin[{] assign[member[.one], member[.many]] else begin[{] assign[member[.one], call[.findEntity, parameter[member[.project], member[.fieldType]]]] call[many.addImport, parameter[member[.one]]] end[}] if[call[many.hasField, parameter[member[.fieldName]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Entity ["), operandr=MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=many, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] already has a field named ["), operator=+), operandr=MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[call[Strings.isNullOrEmpty, parameter[member[.inverseFieldName]]], &&, call[one.hasField, parameter[member[.inverseFieldName]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Entity ["), operandr=MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=one, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] already has a field named ["), operator=+), operandr=MemberReference(member=inverseFieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[FieldSource], manyField] local_variable[type[AnnotationSource], manyAnnotation] call[Refactory.createGetterAndSetter, parameter[member[.many], member[.manyField]]] if[call[Strings.isNullOrEmpty, parameter[member[.inverseFieldName]]]] begin[{] call[one.addImport, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Set, sub_type=None))]] call[one.addImport, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashSet, sub_type=None))]] if[call[one.getCanonicalName, parameter[]]] begin[{] call[one.addImport, parameter[call[many.getQualifiedName, parameter[]]]] else begin[{] None end[}] local_variable[type[FieldSource], oneField] local_variable[type[AnnotationSource], oneAnnotation] call[oneAnnotation.setLiteralValue, parameter[literal["cascade"], literal["CascadeType.ALL"]]] call[oneAnnotation.getOrigin, parameter[]] call[Refactory.createGetterAndSetter, parameter[member[.one], member[.oneField]]] call[java.saveJavaSource, parameter[member[.one]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.fetchType], !=, literal[null]], &&, binary_operation[member[.fetchType], !=, member[FetchType.EAGER]]]] begin[{] call[manyAnnotation.setEnumValue, parameter[literal["fetch"], member[.fetchType]]] else begin[{] None end[}] if[member[.required]] begin[{] call[manyAnnotation.setLiteralValue, parameter[literal["optional"], literal["false"]]] else begin[{] None end[}] call[.addCascade, parameter[member[.cascadeTypes], member[.manyAnnotation]]] call[java.saveJavaSource, parameter[member[.many]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[newManyToOneRelationship] operator[SEP] Keyword[final] identifier[Project] identifier[project] , Keyword[final] identifier[JavaResource] identifier[resource] , Keyword[final] identifier[String] identifier[fieldName] , Keyword[final] identifier[String] identifier[fieldType] , Keyword[final] identifier[String] identifier[inverseFieldName] , Keyword[final] identifier[FetchType] identifier[fetchType] , Keyword[final] Keyword[boolean] identifier[required] , Keyword[final] identifier[Iterable] operator[<] identifier[CascadeType] operator[>] identifier[cascadeTypes] operator[SEP] Keyword[throws] identifier[FileNotFoundException] { identifier[JavaSourceFacet] identifier[java] operator[=] identifier[project] operator[SEP] identifier[getFacet] operator[SEP] identifier[JavaSourceFacet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[JavaClassSource] identifier[many] operator[=] identifier[getJavaClassFrom] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[JavaClassSource] identifier[one] operator[SEP] Keyword[if] operator[SEP] identifier[areTypesSame] operator[SEP] identifier[fieldType] , identifier[many] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[one] operator[=] identifier[many] operator[SEP] } Keyword[else] { identifier[one] operator[=] identifier[findEntity] operator[SEP] identifier[project] , identifier[fieldType] operator[SEP] operator[SEP] identifier[many] operator[SEP] identifier[addImport] operator[SEP] identifier[one] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[many] operator[SEP] identifier[hasField] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[many] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[fieldName] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[inverseFieldName] operator[SEP] operator[&&] identifier[one] operator[SEP] identifier[hasField] operator[SEP] identifier[inverseFieldName] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[one] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[inverseFieldName] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[FieldSource] operator[<] identifier[JavaClassSource] operator[>] identifier[manyField] operator[=] identifier[many] operator[SEP] identifier[addField] operator[SEP] literal[String] operator[+] identifier[one] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[fieldName] operator[+] literal[String] operator[SEP] operator[SEP] identifier[AnnotationSource] operator[<] identifier[JavaClassSource] operator[>] identifier[manyAnnotation] operator[=] identifier[manyField] operator[SEP] identifier[addAnnotation] operator[SEP] identifier[ManyToOne] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Refactory] operator[SEP] identifier[createGetterAndSetter] operator[SEP] identifier[many] , identifier[manyField] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[inverseFieldName] operator[SEP] operator[SEP] { identifier[one] operator[SEP] identifier[addImport] operator[SEP] identifier[Set] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[one] operator[SEP] identifier[addImport] operator[SEP] identifier[HashSet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[one] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[many] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[one] operator[SEP] identifier[addImport] operator[SEP] identifier[many] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[FieldSource] operator[<] identifier[JavaClassSource] operator[>] identifier[oneField] operator[=] identifier[one] operator[SEP] identifier[addField] operator[SEP] literal[String] operator[+] identifier[many] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[inverseFieldName] operator[+] literal[String] operator[+] identifier[many] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[AnnotationSource] operator[<] identifier[JavaClassSource] operator[>] identifier[oneAnnotation] operator[=] identifier[oneField] operator[SEP] identifier[addAnnotation] operator[SEP] identifier[OneToMany] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[setStringValue] operator[SEP] literal[String] , identifier[fieldName] operator[SEP] operator[SEP] identifier[oneAnnotation] operator[SEP] identifier[setLiteralValue] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[oneAnnotation] operator[SEP] identifier[getOrigin] operator[SEP] operator[SEP] operator[SEP] identifier[addImport] operator[SEP] identifier[CascadeType] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Refactory] operator[SEP] identifier[createGetterAndSetter] operator[SEP] identifier[one] , identifier[oneField] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[saveJavaSource] operator[SEP] identifier[one] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[fetchType] operator[!=] Other[null] operator[&&] identifier[fetchType] operator[!=] identifier[FetchType] operator[SEP] identifier[EAGER] operator[SEP] { identifier[manyAnnotation] operator[SEP] identifier[setEnumValue] operator[SEP] literal[String] , identifier[fetchType] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[required] operator[SEP] { identifier[manyAnnotation] operator[SEP] identifier[setLiteralValue] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] } identifier[addCascade] operator[SEP] identifier[cascadeTypes] , identifier[manyAnnotation] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[saveJavaSource] operator[SEP] identifier[many] operator[SEP] operator[SEP] }
private void renderInstructions(Iterable<WAMInstruction> instructions, int row, int address) { for (WAMInstruction instruction : instructions) { WAMLabel label = instruction.getLabel(); labeledTable.put(ADDRESS, row, String.format("%08X", address)); labeledTable.put(LABEL, row, (label == null) ? "" : (label.toPrettyString() + ":")); labeledTable.put(MNEMONIC, row, instruction.getMnemonic().getPretty()); int fieldMask = instruction.getMnemonic().getFieldMask(); String arg = ""; for (int i = 2; i < 32; i = i * 2) { if ((fieldMask & i) != 0) { if (!"".equals(arg)) { arg += ", "; } switch (i) { case 2: arg += Integer.toString(instruction.getReg1()); break; case 4: arg += Integer.toString(instruction.getReg2()); break; case 8: FunctorName fn = instruction.getFn(); if (fn != null) { arg += fn.getName() + "/" + fn.getArity(); } break; case 16: WAMLabel target1 = instruction.getTarget1(); if (target1 != null) { arg += target1.getName() + "/" + target1.getArity() + "_" + target1.getId(); } break; } } } labeledTable.put(ARG_1, row, arg); row++; address += instruction.sizeof(); } }
class class_name[name] begin[{] method[renderInstructions, return_type[void], modifier[private], parameter[instructions, row, address]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=instruction, selectors=[], type_arguments=None), name=label)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WAMLabel, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ADDRESS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%08X"), MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=labeledTable, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LABEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=BinaryOperation(operandl=MethodInvocation(arguments=[], member=toPrettyString, postfix_operators=[], prefix_operators=[], qualifier=label, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))], member=put, postfix_operators=[], prefix_operators=[], qualifier=labeledTable, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MNEMONIC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMnemonic, postfix_operators=[], prefix_operators=[], qualifier=instruction, selectors=[MethodInvocation(arguments=[], member=getPretty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=labeledTable, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMnemonic, postfix_operators=[], prefix_operators=[], qualifier=instruction, selectors=[MethodInvocation(arguments=[], member=getFieldMask, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=fieldMask)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=fieldMask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", ")), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getReg1, postfix_operators=[], prefix_operators=[], qualifier=instruction, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getReg2, postfix_operators=[], prefix_operators=[], qualifier=instruction, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8)], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFn, postfix_operators=[], prefix_operators=[], qualifier=instruction, selectors=[], type_arguments=None), name=fn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FunctorName, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fn, 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=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=fn, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MethodInvocation(arguments=[], member=getArity, postfix_operators=[], prefix_operators=[], qualifier=fn, selectors=[], type_arguments=None), operator=+)), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16)], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTarget1, postfix_operators=[], prefix_operators=[], qualifier=instruction, selectors=[], type_arguments=None), name=target1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WAMLabel, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=target1, 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=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=target1, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MethodInvocation(arguments=[], member=getArity, postfix_operators=[], prefix_operators=[], qualifier=target1, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_"), operator=+), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=target1, selectors=[], type_arguments=None), operator=+)), label=None)])), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*))]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ARG_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=labeledTable, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=row, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=sizeof, postfix_operators=[], prefix_operators=[], qualifier=instruction, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=instructions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=instruction)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WAMInstruction, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[renderInstructions] operator[SEP] identifier[Iterable] operator[<] identifier[WAMInstruction] operator[>] identifier[instructions] , Keyword[int] identifier[row] , Keyword[int] identifier[address] operator[SEP] { Keyword[for] operator[SEP] identifier[WAMInstruction] identifier[instruction] operator[:] identifier[instructions] operator[SEP] { identifier[WAMLabel] identifier[label] operator[=] identifier[instruction] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP] identifier[labeledTable] operator[SEP] identifier[put] operator[SEP] identifier[ADDRESS] , identifier[row] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[address] operator[SEP] operator[SEP] operator[SEP] identifier[labeledTable] operator[SEP] identifier[put] operator[SEP] identifier[LABEL] , identifier[row] , operator[SEP] identifier[label] operator[==] Other[null] operator[SEP] operator[?] literal[String] operator[:] operator[SEP] identifier[label] operator[SEP] identifier[toPrettyString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[labeledTable] operator[SEP] identifier[put] operator[SEP] identifier[MNEMONIC] , identifier[row] , identifier[instruction] operator[SEP] identifier[getMnemonic] operator[SEP] operator[SEP] operator[SEP] identifier[getPretty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[fieldMask] operator[=] identifier[instruction] operator[SEP] identifier[getMnemonic] operator[SEP] operator[SEP] operator[SEP] identifier[getFieldMask] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[arg] operator[=] literal[String] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[2] operator[SEP] identifier[i] operator[<] Other[32] operator[SEP] identifier[i] operator[=] identifier[i] operator[*] Other[2] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[fieldMask] operator[&] identifier[i] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[arg] operator[SEP] operator[SEP] { identifier[arg] operator[+=] literal[String] operator[SEP] } Keyword[switch] operator[SEP] identifier[i] operator[SEP] { Keyword[case] Other[2] operator[:] identifier[arg] operator[+=] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[instruction] operator[SEP] identifier[getReg1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[4] operator[:] identifier[arg] operator[+=] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[instruction] operator[SEP] identifier[getReg2] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[8] operator[:] identifier[FunctorName] identifier[fn] operator[=] identifier[instruction] operator[SEP] identifier[getFn] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fn] operator[!=] Other[null] operator[SEP] { identifier[arg] operator[+=] identifier[fn] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[fn] operator[SEP] identifier[getArity] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] Other[16] operator[:] identifier[WAMLabel] identifier[target1] operator[=] identifier[instruction] operator[SEP] identifier[getTarget1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[target1] operator[!=] Other[null] operator[SEP] { identifier[arg] operator[+=] identifier[target1] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[target1] operator[SEP] identifier[getArity] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[target1] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } } } identifier[labeledTable] operator[SEP] identifier[put] operator[SEP] identifier[ARG_1] , identifier[row] , identifier[arg] operator[SEP] operator[SEP] identifier[row] operator[++] operator[SEP] identifier[address] operator[+=] identifier[instruction] operator[SEP] identifier[sizeof] operator[SEP] operator[SEP] operator[SEP] } }
public Content getPropertyDetailsTreeHeader(ClassDoc classDoc, Content memberDetailsTree) { memberDetailsTree.addContent(HtmlConstants.START_OF_PROPERTY_DETAILS); Content propertyDetailsTree = writer.getMemberTreeHeader(); propertyDetailsTree.addContent(writer.getMarkerAnchor( SectionName.PROPERTY_DETAIL)); Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, writer.propertyDetailsLabel); propertyDetailsTree.addContent(heading); return propertyDetailsTree; }
class class_name[name] begin[{] method[getPropertyDetailsTreeHeader, return_type[type[Content]], modifier[public], parameter[classDoc, memberDetailsTree]] begin[{] call[memberDetailsTree.addContent, parameter[member[HtmlConstants.START_OF_PROPERTY_DETAILS]]] local_variable[type[Content], propertyDetailsTree] call[propertyDetailsTree.addContent, parameter[call[writer.getMarkerAnchor, parameter[member[SectionName.PROPERTY_DETAIL]]]]] local_variable[type[Content], heading] call[propertyDetailsTree.addContent, parameter[member[.heading]]] return[member[.propertyDetailsTree]] end[}] END[}]
Keyword[public] identifier[Content] identifier[getPropertyDetailsTreeHeader] operator[SEP] identifier[ClassDoc] identifier[classDoc] , identifier[Content] identifier[memberDetailsTree] operator[SEP] { identifier[memberDetailsTree] operator[SEP] identifier[addContent] operator[SEP] identifier[HtmlConstants] operator[SEP] identifier[START_OF_PROPERTY_DETAILS] operator[SEP] operator[SEP] identifier[Content] identifier[propertyDetailsTree] operator[=] identifier[writer] operator[SEP] identifier[getMemberTreeHeader] operator[SEP] operator[SEP] operator[SEP] identifier[propertyDetailsTree] operator[SEP] identifier[addContent] operator[SEP] identifier[writer] operator[SEP] identifier[getMarkerAnchor] operator[SEP] identifier[SectionName] operator[SEP] identifier[PROPERTY_DETAIL] operator[SEP] operator[SEP] operator[SEP] identifier[Content] identifier[heading] operator[=] identifier[HtmlTree] operator[SEP] identifier[HEADING] operator[SEP] identifier[HtmlConstants] operator[SEP] identifier[DETAILS_HEADING] , identifier[writer] operator[SEP] identifier[propertyDetailsLabel] operator[SEP] operator[SEP] identifier[propertyDetailsTree] operator[SEP] identifier[addContent] operator[SEP] identifier[heading] operator[SEP] operator[SEP] Keyword[return] identifier[propertyDetailsTree] operator[SEP] }
public ContainerDefinition withDockerSecurityOptions(String... dockerSecurityOptions) { if (this.dockerSecurityOptions == null) { setDockerSecurityOptions(new com.amazonaws.internal.SdkInternalList<String>(dockerSecurityOptions.length)); } for (String ele : dockerSecurityOptions) { this.dockerSecurityOptions.add(ele); } return this; }
class class_name[name] begin[{] method[withDockerSecurityOptions, return_type[type[ContainerDefinition]], modifier[public], parameter[dockerSecurityOptions]] begin[{] if[binary_operation[THIS[member[None.dockerSecurityOptions]], ==, literal[null]]] begin[{] call[.setDockerSecurityOptions, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=dockerSecurityOptions, 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=dockerSecurityOptions, 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=dockerSecurityOptions, 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[ContainerDefinition] identifier[withDockerSecurityOptions] operator[SEP] identifier[String] operator[...] identifier[dockerSecurityOptions] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[dockerSecurityOptions] operator[==] Other[null] operator[SEP] { identifier[setDockerSecurityOptions] 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[dockerSecurityOptions] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[dockerSecurityOptions] operator[SEP] { Keyword[this] operator[SEP] identifier[dockerSecurityOptions] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void entering(String sourceClass, String sourceMethod) { if (Level.FINER.intValue() < levelValue) { return; } logp(Level.FINER, sourceClass, sourceMethod, "ENTRY"); }
class class_name[name] begin[{] method[entering, return_type[void], modifier[public], parameter[sourceClass, sourceMethod]] begin[{] if[binary_operation[call[Level.FINER.intValue, parameter[]], <, member[.levelValue]]] begin[{] return[None] else begin[{] None end[}] call[.logp, parameter[member[Level.FINER], member[.sourceClass], member[.sourceMethod], literal["ENTRY"]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[entering] operator[SEP] identifier[String] identifier[sourceClass] , identifier[String] identifier[sourceMethod] operator[SEP] { Keyword[if] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[<] identifier[levelValue] operator[SEP] { Keyword[return] operator[SEP] } identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] , identifier[sourceClass] , identifier[sourceMethod] , literal[String] operator[SEP] operator[SEP] }
public int nextToken() throws IOException { if (pushBackToken) { pushBackToken = false; if (ttype != TT_UNKNOWN) { return ttype; } } sval = null; // Always reset sval to null int currentChar = peekChar == -2 ? read() : peekChar; if (lastCr && currentChar == '\n') { lastCr = false; currentChar = read(); } if (currentChar == -1) { return (ttype = TT_EOF); } byte currentType = currentChar > 255 ? TOKEN_WORD : tokenTypes[currentChar]; while ((currentType & TOKEN_WHITE) != 0) { /** * Skip over white space until we hit a new line or a real token */ if (currentChar == '\r') { lineNumber++; if (isEOLSignificant) { lastCr = true; peekChar = -2; return (ttype = TT_EOL); } if ((currentChar = read()) == '\n') { currentChar = read(); } } else if (currentChar == '\n') { lineNumber++; if (isEOLSignificant) { peekChar = -2; return (ttype = TT_EOL); } currentChar = read(); } else { // Advance over this white space character and try again. currentChar = read(); } if (currentChar == -1) { return (ttype = TT_EOF); } currentType = currentChar > 255 ? TOKEN_WORD : tokenTypes[currentChar]; } /** * Check for digits before checking for words since digits can be * contained within words. */ if ((currentType & TOKEN_DIGIT) != 0) { StringBuilder digits = new StringBuilder(20); boolean haveDecimal = false, checkJustNegative = currentChar == '-'; while (true) { if (currentChar == '.') { haveDecimal = true; } digits.append((char) currentChar); currentChar = read(); if ((currentChar < '0' || currentChar > '9') && (haveDecimal || currentChar != '.')) { break; } } peekChar = currentChar; if (checkJustNegative && digits.length() == 1) { // Didn't get any other digits other than '-' return (ttype = '-'); } try { nval = Double.valueOf(digits.toString()).doubleValue(); } catch (NumberFormatException e) { // Unsure what to do, will write test. nval = 0; } return (ttype = TT_NUMBER); } // Check for words if ((currentType & TOKEN_WORD) != 0) { StringBuilder word = new StringBuilder(20); while (true) { word.append((char) currentChar); currentChar = read(); if (currentChar == -1 || (currentChar < 256 && (tokenTypes[currentChar] & (TOKEN_WORD | TOKEN_DIGIT)) == 0)) { break; } } peekChar = currentChar; sval = word.toString(); if (forceLowercase) { sval = sval.toLowerCase(Locale.getDefault()); } return (ttype = TT_WORD); } // Check for quoted character if (currentType == TOKEN_QUOTE) { int matchQuote = currentChar; StringBuilder quoteString = new StringBuilder(); int peekOne = read(); while (peekOne >= 0 && peekOne != matchQuote && peekOne != '\r' && peekOne != '\n') { boolean readPeek = true; if (peekOne == '\\') { int c1 = read(); // Check for quoted octal IE: \377 if (c1 <= '7' && c1 >= '0') { int digitValue = c1 - '0'; c1 = read(); if (c1 > '7' || c1 < '0') { readPeek = false; } else { digitValue = digitValue * 8 + (c1 - '0'); c1 = read(); // limit the digit value to a byte if (digitValue > 037 || c1 > '7' || c1 < '0') { readPeek = false; } else { digitValue = digitValue * 8 + (c1 - '0'); } } if (!readPeek) { // We've consumed one to many quoteString.append((char) digitValue); peekOne = c1; } else { peekOne = digitValue; } } else { switch (c1) { case 'a': peekOne = 0x7; break; case 'b': peekOne = 0x8; break; case 'f': peekOne = 0xc; break; case 'n': peekOne = 0xA; break; case 'r': peekOne = 0xD; break; case 't': peekOne = 0x9; break; case 'v': peekOne = 0xB; break; default: peekOne = c1; } } } if (readPeek) { quoteString.append((char) peekOne); peekOne = read(); } } if (peekOne == matchQuote) { peekOne = read(); } peekChar = peekOne; ttype = matchQuote; sval = quoteString.toString(); return ttype; } // Do comments, both "//" and "/*stuff*/" if (currentChar == '/' && (slashSlashComments || slashStarComments)) { if ((currentChar = read()) == '*' && slashStarComments) { int peekOne = read(); while (true) { currentChar = peekOne; peekOne = read(); if (currentChar == -1) { peekChar = -1; return (ttype = TT_EOF); } if (currentChar == '\r') { if (peekOne == '\n') { peekOne = read(); } lineNumber++; } else if (currentChar == '\n') { lineNumber++; } else if (currentChar == '*' && peekOne == '/') { peekChar = read(); return nextToken(); } } } else if (currentChar == '/' && slashSlashComments) { // Skip to EOF or new line then return the next token while ((currentChar = read()) >= 0 && currentChar != '\r' && currentChar != '\n') { // Intentionally empty } peekChar = currentChar; return nextToken(); } else if (currentType != TOKEN_COMMENT) { // Was just a slash by itself peekChar = currentChar; return (ttype = '/'); } } // Check for comment character if (currentType == TOKEN_COMMENT) { // Skip to EOF or new line then return the next token while ((currentChar = read()) >= 0 && currentChar != '\r' && currentChar != '\n') { // Intentionally empty } peekChar = currentChar; return nextToken(); } peekChar = read(); return (ttype = currentChar); }
class class_name[name] begin[{] method[nextToken, return_type[type[int]], modifier[public], parameter[]] begin[{] if[member[.pushBackToken]] begin[{] assign[member[.pushBackToken], literal[false]] if[binary_operation[member[.ttype], !=, member[.TT_UNKNOWN]]] begin[{] return[member[.ttype]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.sval], literal[null]] local_variable[type[int], currentChar] if[binary_operation[member[.lastCr], &&, binary_operation[member[.currentChar], ==, literal['\n']]]] begin[{] assign[member[.lastCr], literal[false]] assign[member[.currentChar], call[.read, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.currentChar], ==, literal[1]]] begin[{] return[assign[member[.ttype], member[.TT_EOF]]] else begin[{] None end[}] local_variable[type[byte], currentType] while[binary_operation[binary_operation[member[.currentType], &, member[.TOKEN_WHITE]], !=, literal[0]]] begin[{] if[binary_operation[member[.currentChar], ==, literal['\r']]] begin[{] member[.lineNumber] if[member[.isEOLSignificant]] begin[{] assign[member[.lastCr], literal[true]] assign[member[.peekChar], literal[2]] return[assign[member[.ttype], member[.TT_EOL]]] else begin[{] None end[}] if[binary_operation[assign[member[.currentChar], call[.read, parameter[]]], ==, literal['\n']]] begin[{] assign[member[.currentChar], call[.read, parameter[]]] else begin[{] None end[}] else begin[{] if[binary_operation[member[.currentChar], ==, literal['\n']]] begin[{] member[.lineNumber] if[member[.isEOLSignificant]] begin[{] assign[member[.peekChar], literal[2]] return[assign[member[.ttype], member[.TT_EOL]]] else begin[{] None end[}] assign[member[.currentChar], call[.read, parameter[]]] else begin[{] assign[member[.currentChar], call[.read, parameter[]]] end[}] end[}] if[binary_operation[member[.currentChar], ==, literal[1]]] begin[{] return[assign[member[.ttype], member[.TT_EOF]]] else begin[{] None end[}] assign[member[.currentType], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=currentChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255), operator=>), if_false=MemberReference(member=tokenTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=currentChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=MemberReference(member=TOKEN_WORD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] if[binary_operation[binary_operation[member[.currentType], &, member[.TOKEN_DIGIT]], !=, literal[0]]] begin[{] local_variable[type[StringBuilder], digits] local_variable[type[boolean], haveDecimal] while[literal[true]] begin[{] if[binary_operation[member[.currentChar], ==, literal['.']]] begin[{] assign[member[.haveDecimal], literal[true]] else begin[{] None end[}] call[digits.append, parameter[Cast(expression=MemberReference(member=currentChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))]] assign[member[.currentChar], call[.read, parameter[]]] if[binary_operation[binary_operation[binary_operation[member[.currentChar], <, literal['0']], ||, binary_operation[member[.currentChar], >, literal['9']]], &&, binary_operation[member[.haveDecimal], ||, binary_operation[member[.currentChar], !=, literal['.']]]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] end[}] assign[member[.peekChar], member[.currentChar]] if[binary_operation[member[.checkJustNegative], &&, binary_operation[call[digits.length, parameter[]], ==, literal[1]]]] begin[{] return[assign[member[.ttype], literal['-']]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=digits, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[MethodInvocation(arguments=[], member=doubleValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) return[assign[member[.ttype], member[.TT_NUMBER]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.currentType], &, member[.TOKEN_WORD]], !=, literal[0]]] begin[{] local_variable[type[StringBuilder], word] while[literal[true]] begin[{] call[word.append, parameter[Cast(expression=MemberReference(member=currentChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))]] assign[member[.currentChar], call[.read, parameter[]]] if[binary_operation[binary_operation[member[.currentChar], ==, literal[1]], ||, binary_operation[binary_operation[member[.currentChar], <, literal[256]], &&, binary_operation[binary_operation[member[.tokenTypes], &, binary_operation[member[.TOKEN_WORD], |, member[.TOKEN_DIGIT]]], ==, literal[0]]]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] end[}] assign[member[.peekChar], member[.currentChar]] assign[member[.sval], call[word.toString, parameter[]]] if[member[.forceLowercase]] begin[{] assign[member[.sval], call[sval.toLowerCase, parameter[call[Locale.getDefault, parameter[]]]]] else begin[{] None end[}] return[assign[member[.ttype], member[.TT_WORD]]] else begin[{] None end[}] if[binary_operation[member[.currentType], ==, member[.TOKEN_QUOTE]]] begin[{] local_variable[type[int], matchQuote] local_variable[type[StringBuilder], quoteString] local_variable[type[int], peekOne] while[binary_operation[binary_operation[binary_operation[binary_operation[member[.peekOne], >=, literal[0]], &&, binary_operation[member[.peekOne], !=, member[.matchQuote]]], &&, binary_operation[member[.peekOne], !=, literal['\r']]], &&, binary_operation[member[.peekOne], !=, literal['\n']]]] begin[{] local_variable[type[boolean], readPeek] if[binary_operation[member[.peekOne], ==, literal['\\']]] begin[{] local_variable[type[int], c1] if[binary_operation[binary_operation[member[.c1], <=, literal['7']], &&, binary_operation[member[.c1], >=, literal['0']]]] begin[{] local_variable[type[int], digitValue] assign[member[.c1], call[.read, parameter[]]] if[binary_operation[binary_operation[member[.c1], >, literal['7']], ||, binary_operation[member[.c1], <, literal['0']]]] begin[{] assign[member[.readPeek], literal[false]] else begin[{] assign[member[.digitValue], binary_operation[binary_operation[member[.digitValue], *, literal[8]], +, binary_operation[member[.c1], -, literal['0']]]] assign[member[.c1], call[.read, parameter[]]] if[binary_operation[binary_operation[binary_operation[member[.digitValue], >, literal[037]], ||, binary_operation[member[.c1], >, literal['7']]], ||, binary_operation[member[.c1], <, literal['0']]]] begin[{] assign[member[.readPeek], literal[false]] else begin[{] assign[member[.digitValue], binary_operation[binary_operation[member[.digitValue], *, literal[8]], +, binary_operation[member[.c1], -, literal['0']]]] end[}] end[}] if[member[.readPeek]] begin[{] call[quoteString.append, parameter[Cast(expression=MemberReference(member=digitValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))]] assign[member[.peekOne], member[.c1]] else begin[{] assign[member[.peekOne], member[.digitValue]] end[}] else begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=peekOne, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x7)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='b')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=peekOne, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x8)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=peekOne, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xc)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='n')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=peekOne, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xA)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='r')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=peekOne, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xD)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='t')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=peekOne, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x9)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='v')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=peekOne, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xB)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=peekOne, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=c1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])], expression=MemberReference(member=c1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] else begin[{] None end[}] if[member[.readPeek]] begin[{] call[quoteString.append, parameter[Cast(expression=MemberReference(member=peekOne, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))]] assign[member[.peekOne], call[.read, parameter[]]] else begin[{] None end[}] end[}] if[binary_operation[member[.peekOne], ==, member[.matchQuote]]] begin[{] assign[member[.peekOne], call[.read, parameter[]]] else begin[{] None end[}] assign[member[.peekChar], member[.peekOne]] assign[member[.ttype], member[.matchQuote]] assign[member[.sval], call[quoteString.toString, parameter[]]] return[member[.ttype]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.currentChar], ==, literal['/']], &&, binary_operation[member[.slashSlashComments], ||, member[.slashStarComments]]]] begin[{] if[binary_operation[binary_operation[assign[member[.currentChar], call[.read, parameter[]]], ==, literal['*']], &&, member[.slashStarComments]]] begin[{] local_variable[type[int], peekOne] while[literal[true]] begin[{] assign[member[.currentChar], member[.peekOne]] assign[member[.peekOne], call[.read, parameter[]]] if[binary_operation[member[.currentChar], ==, literal[1]]] begin[{] assign[member[.peekChar], literal[1]] return[assign[member[.ttype], member[.TT_EOF]]] else begin[{] None end[}] if[binary_operation[member[.currentChar], ==, literal['\r']]] begin[{] if[binary_operation[member[.peekOne], ==, literal['\n']]] begin[{] assign[member[.peekOne], call[.read, parameter[]]] else begin[{] None end[}] member[.lineNumber] else begin[{] if[binary_operation[member[.currentChar], ==, literal['\n']]] begin[{] member[.lineNumber] else begin[{] if[binary_operation[binary_operation[member[.currentChar], ==, literal['*']], &&, binary_operation[member[.peekOne], ==, literal['/']]]] begin[{] assign[member[.peekChar], call[.read, parameter[]]] return[call[.nextToken, parameter[]]] else begin[{] None end[}] end[}] end[}] end[}] else begin[{] if[binary_operation[binary_operation[member[.currentChar], ==, literal['/']], &&, member[.slashSlashComments]]] begin[{] while[binary_operation[binary_operation[binary_operation[assign[member[.currentChar], call[.read, parameter[]]], >=, literal[0]], &&, binary_operation[member[.currentChar], !=, literal['\r']]], &&, binary_operation[member[.currentChar], !=, literal['\n']]]] begin[{] end[}] assign[member[.peekChar], member[.currentChar]] return[call[.nextToken, parameter[]]] else begin[{] if[binary_operation[member[.currentType], !=, member[.TOKEN_COMMENT]]] begin[{] assign[member[.peekChar], member[.currentChar]] return[assign[member[.ttype], literal['/']]] else begin[{] None end[}] end[}] end[}] else begin[{] None end[}] if[binary_operation[member[.currentType], ==, member[.TOKEN_COMMENT]]] begin[{] while[binary_operation[binary_operation[binary_operation[assign[member[.currentChar], call[.read, parameter[]]], >=, literal[0]], &&, binary_operation[member[.currentChar], !=, literal['\r']]], &&, binary_operation[member[.currentChar], !=, literal['\n']]]] begin[{] end[}] assign[member[.peekChar], member[.currentChar]] return[call[.nextToken, parameter[]]] else begin[{] None end[}] assign[member[.peekChar], call[.read, parameter[]]] return[assign[member[.ttype], member[.currentChar]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[nextToken] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[pushBackToken] operator[SEP] { identifier[pushBackToken] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[ttype] operator[!=] identifier[TT_UNKNOWN] operator[SEP] { Keyword[return] identifier[ttype] operator[SEP] } } identifier[sval] operator[=] Other[null] operator[SEP] Keyword[int] identifier[currentChar] operator[=] identifier[peekChar] operator[==] operator[-] Other[2] operator[?] identifier[read] operator[SEP] operator[SEP] operator[:] identifier[peekChar] operator[SEP] Keyword[if] operator[SEP] identifier[lastCr] operator[&&] identifier[currentChar] operator[==] literal[String] operator[SEP] { identifier[lastCr] operator[=] literal[boolean] operator[SEP] identifier[currentChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[currentChar] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] operator[SEP] identifier[ttype] operator[=] identifier[TT_EOF] operator[SEP] operator[SEP] } Keyword[byte] identifier[currentType] operator[=] identifier[currentChar] operator[>] Other[255] operator[?] identifier[TOKEN_WORD] operator[:] identifier[tokenTypes] operator[SEP] identifier[currentChar] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[currentType] operator[&] identifier[TOKEN_WHITE] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[currentChar] operator[==] literal[String] operator[SEP] { identifier[lineNumber] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[isEOLSignificant] operator[SEP] { identifier[lastCr] operator[=] literal[boolean] operator[SEP] identifier[peekChar] operator[=] operator[-] Other[2] operator[SEP] Keyword[return] operator[SEP] identifier[ttype] operator[=] identifier[TT_EOL] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[currentChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[==] literal[String] operator[SEP] { identifier[currentChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[currentChar] operator[==] literal[String] operator[SEP] { identifier[lineNumber] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[isEOLSignificant] operator[SEP] { identifier[peekChar] operator[=] operator[-] Other[2] operator[SEP] Keyword[return] operator[SEP] identifier[ttype] operator[=] identifier[TT_EOL] operator[SEP] operator[SEP] } identifier[currentChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[currentChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[currentChar] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] operator[SEP] identifier[ttype] operator[=] identifier[TT_EOF] operator[SEP] operator[SEP] } identifier[currentType] operator[=] identifier[currentChar] operator[>] Other[255] operator[?] identifier[TOKEN_WORD] operator[:] identifier[tokenTypes] operator[SEP] identifier[currentChar] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[currentType] operator[&] identifier[TOKEN_DIGIT] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[StringBuilder] identifier[digits] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[20] operator[SEP] operator[SEP] Keyword[boolean] identifier[haveDecimal] operator[=] literal[boolean] , identifier[checkJustNegative] operator[=] identifier[currentChar] operator[==] literal[String] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[currentChar] operator[==] literal[String] operator[SEP] { identifier[haveDecimal] operator[=] literal[boolean] operator[SEP] } identifier[digits] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[currentChar] operator[SEP] operator[SEP] identifier[currentChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[currentChar] operator[<] literal[String] operator[||] identifier[currentChar] operator[>] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[haveDecimal] operator[||] identifier[currentChar] operator[!=] literal[String] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } } identifier[peekChar] operator[=] identifier[currentChar] operator[SEP] Keyword[if] operator[SEP] identifier[checkJustNegative] operator[&&] identifier[digits] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { Keyword[return] operator[SEP] identifier[ttype] operator[=] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[nval] operator[=] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[digits] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { identifier[nval] operator[=] Other[0] operator[SEP] } Keyword[return] operator[SEP] identifier[ttype] operator[=] identifier[TT_NUMBER] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[currentType] operator[&] identifier[TOKEN_WORD] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[StringBuilder] identifier[word] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[20] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { identifier[word] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[currentChar] operator[SEP] operator[SEP] identifier[currentChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentChar] operator[==] operator[-] Other[1] operator[||] operator[SEP] identifier[currentChar] operator[<] Other[256] operator[&&] operator[SEP] identifier[tokenTypes] operator[SEP] identifier[currentChar] operator[SEP] operator[&] operator[SEP] identifier[TOKEN_WORD] operator[|] identifier[TOKEN_DIGIT] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } } identifier[peekChar] operator[=] identifier[currentChar] operator[SEP] identifier[sval] operator[=] identifier[word] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[forceLowercase] operator[SEP] { identifier[sval] operator[=] identifier[sval] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[ttype] operator[=] identifier[TT_WORD] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[currentType] operator[==] identifier[TOKEN_QUOTE] operator[SEP] { Keyword[int] identifier[matchQuote] operator[=] identifier[currentChar] operator[SEP] identifier[StringBuilder] identifier[quoteString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[peekOne] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[peekOne] operator[>=] Other[0] operator[&&] identifier[peekOne] operator[!=] identifier[matchQuote] operator[&&] identifier[peekOne] operator[!=] literal[String] operator[&&] identifier[peekOne] operator[!=] literal[String] operator[SEP] { Keyword[boolean] identifier[readPeek] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[peekOne] operator[==] literal[String] operator[SEP] { Keyword[int] identifier[c1] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c1] operator[<=] literal[String] operator[&&] identifier[c1] operator[>=] literal[String] operator[SEP] { Keyword[int] identifier[digitValue] operator[=] identifier[c1] operator[-] literal[String] operator[SEP] identifier[c1] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c1] operator[>] literal[String] operator[||] identifier[c1] operator[<] literal[String] operator[SEP] { identifier[readPeek] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[digitValue] operator[=] identifier[digitValue] operator[*] Other[8] operator[+] operator[SEP] identifier[c1] operator[-] literal[String] operator[SEP] operator[SEP] identifier[c1] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[digitValue] operator[>] literal[Integer] operator[||] identifier[c1] operator[>] literal[String] operator[||] identifier[c1] operator[<] literal[String] operator[SEP] { identifier[readPeek] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[digitValue] operator[=] identifier[digitValue] operator[*] Other[8] operator[+] operator[SEP] identifier[c1] operator[-] literal[String] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[readPeek] operator[SEP] { identifier[quoteString] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[digitValue] operator[SEP] operator[SEP] identifier[peekOne] operator[=] identifier[c1] operator[SEP] } Keyword[else] { identifier[peekOne] operator[=] identifier[digitValue] operator[SEP] } } Keyword[else] { Keyword[switch] operator[SEP] identifier[c1] operator[SEP] { Keyword[case] literal[String] operator[:] identifier[peekOne] operator[=] literal[Integer] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[peekOne] operator[=] literal[Integer] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[peekOne] operator[=] literal[Integer] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[peekOne] operator[=] literal[Integer] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[peekOne] operator[=] literal[Integer] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[peekOne] operator[=] literal[Integer] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[peekOne] operator[=] literal[Integer] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[peekOne] operator[=] identifier[c1] operator[SEP] } } } Keyword[if] operator[SEP] identifier[readPeek] operator[SEP] { identifier[quoteString] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[peekOne] operator[SEP] operator[SEP] identifier[peekOne] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[peekOne] operator[==] identifier[matchQuote] operator[SEP] { identifier[peekOne] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] } identifier[peekChar] operator[=] identifier[peekOne] operator[SEP] identifier[ttype] operator[=] identifier[matchQuote] operator[SEP] identifier[sval] operator[=] identifier[quoteString] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ttype] operator[SEP] } Keyword[if] operator[SEP] identifier[currentChar] operator[==] literal[String] operator[&&] operator[SEP] identifier[slashSlashComments] operator[||] identifier[slashStarComments] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[currentChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[==] literal[String] operator[&&] identifier[slashStarComments] operator[SEP] { Keyword[int] identifier[peekOne] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { identifier[currentChar] operator[=] identifier[peekOne] operator[SEP] identifier[peekOne] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentChar] operator[==] operator[-] Other[1] operator[SEP] { identifier[peekChar] operator[=] operator[-] Other[1] operator[SEP] Keyword[return] operator[SEP] identifier[ttype] operator[=] identifier[TT_EOF] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[currentChar] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[peekOne] operator[==] literal[String] operator[SEP] { identifier[peekOne] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] } identifier[lineNumber] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[currentChar] operator[==] literal[String] operator[SEP] { identifier[lineNumber] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[currentChar] operator[==] literal[String] operator[&&] identifier[peekOne] operator[==] literal[String] operator[SEP] { identifier[peekChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[currentChar] operator[==] literal[String] operator[&&] identifier[slashSlashComments] operator[SEP] { Keyword[while] operator[SEP] operator[SEP] identifier[currentChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[&&] identifier[currentChar] operator[!=] literal[String] operator[&&] identifier[currentChar] operator[!=] literal[String] operator[SEP] { } identifier[peekChar] operator[=] identifier[currentChar] operator[SEP] Keyword[return] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[currentType] operator[!=] identifier[TOKEN_COMMENT] operator[SEP] { identifier[peekChar] operator[=] identifier[currentChar] operator[SEP] Keyword[return] operator[SEP] identifier[ttype] operator[=] literal[String] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[currentType] operator[==] identifier[TOKEN_COMMENT] operator[SEP] { Keyword[while] operator[SEP] operator[SEP] identifier[currentChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[&&] identifier[currentChar] operator[!=] literal[String] operator[&&] identifier[currentChar] operator[!=] literal[String] operator[SEP] { } identifier[peekChar] operator[=] identifier[currentChar] operator[SEP] Keyword[return] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] } identifier[peekChar] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[ttype] operator[=] identifier[currentChar] operator[SEP] operator[SEP] }
public static HashingReader createHashingReader( String digestName, Reader reader, Charset charset ) throws NoSuchAlgorithmException { MessageDigest digest = MessageDigest.getInstance(digestName); return new HashingReader(digest, reader, charset); }
class class_name[name] begin[{] method[createHashingReader, return_type[type[HashingReader]], modifier[public static], parameter[digestName, reader, charset]] begin[{] local_variable[type[MessageDigest], digest] return[ClassCreator(arguments=[MemberReference(member=digest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=charset, 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=HashingReader, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[HashingReader] identifier[createHashingReader] operator[SEP] identifier[String] identifier[digestName] , identifier[Reader] identifier[reader] , identifier[Charset] identifier[charset] operator[SEP] Keyword[throws] identifier[NoSuchAlgorithmException] { identifier[MessageDigest] identifier[digest] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] identifier[digestName] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[HashingReader] operator[SEP] identifier[digest] , identifier[reader] , identifier[charset] operator[SEP] operator[SEP] }
@Override public EClass getIfcMaterialProfileWithOffsets() { if (ifcMaterialProfileWithOffsetsEClass == null) { ifcMaterialProfileWithOffsetsEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(371); } return ifcMaterialProfileWithOffsetsEClass; }
class class_name[name] begin[{] method[getIfcMaterialProfileWithOffsets, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcMaterialProfileWithOffsetsEClass], ==, literal[null]]] begin[{] assign[member[.ifcMaterialProfileWithOffsetsEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=371)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcMaterialProfileWithOffsetsEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcMaterialProfileWithOffsets] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcMaterialProfileWithOffsetsEClass] operator[==] Other[null] operator[SEP] { identifier[ifcMaterialProfileWithOffsetsEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[371] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcMaterialProfileWithOffsetsEClass] operator[SEP] }
@Override public String generateKey(HttpServletRequest request) { Features features = (Features) request .getAttribute(IHttpTransport.FEATUREMAP_REQATTRNAME); if (features == null) { features = Features.emptyFeatures; } IAggregator aggr = (IAggregator) request .getAttribute(IAggregator.AGGREGATOR_REQATTRNAME); IConfig config = aggr.getConfig(); // First, create a sorted map from the provided feature map and then // trim unused features. We use a sorted map to ensure consistency // in the order that the feature names appear within the key. SortedMap<String, Boolean> map = new TreeMap<String, Boolean>(); for (String featureName : features.featureNames()) { map.put(featureName, features.isFeature(featureName)); } if (depFeatures != null) { // If features we depend that are not specified in the request should // be regarded as being false, then add them to the request feature map. if (config.isCoerceUndefinedToFalse()) { for (String s : depFeatures) { if (!map.keySet().contains(s)) { map.put(s, false); } } } // Remove from the map all the features that this generator doesn't // depend on. map.keySet().retainAll(depFeatures); } StringBuffer sb = new StringBuffer(); // Now build the key from the defined pruned feature set. for (Map.Entry<String, Boolean> entry : map.entrySet()) { if (sb.length() > 1) { sb.append(","); //$NON-NLS-1$ } sb.append(entry.getValue() ? "" : "!"); //$NON-NLS-1$ //$NON-NLS-2$ sb.append(entry.getKey()); } sb.insert(0, eyecatcher + "{").append("}").toString(); //$NON-NLS-1$ //$NON-NLS-2$ return sb.toString(); }
class class_name[name] begin[{] method[generateKey, return_type[type[String]], modifier[public], parameter[request]] begin[{] local_variable[type[Features], features] if[binary_operation[member[.features], ==, literal[null]]] begin[{] assign[member[.features], member[Features.emptyFeatures]] else begin[{] None end[}] local_variable[type[IAggregator], aggr] local_variable[type[IConfig], config] local_variable[type[SortedMap], map] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=featureName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=featureName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isFeature, postfix_operators=[], prefix_operators=[], qualifier=features, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=featureNames, postfix_operators=[], prefix_operators=[], qualifier=features, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=featureName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[binary_operation[member[.depFeatures], !=, literal[null]]] begin[{] if[call[config.isCoerceUndefinedToFalse, parameter[]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=['!'], qualifier=map, selectors=[MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=depFeatures, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] call[map.keySet, parameter[]] else begin[{] None end[}] local_variable[type[StringBuffer], sb] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="!"), if_true=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=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) call[sb.insert, parameter[literal[0], binary_operation[member[.eyecatcher], +, literal["{"]]]] return[call[sb.toString, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[generateKey] operator[SEP] identifier[HttpServletRequest] identifier[request] operator[SEP] { identifier[Features] identifier[features] operator[=] operator[SEP] identifier[Features] operator[SEP] identifier[request] operator[SEP] identifier[getAttribute] operator[SEP] identifier[IHttpTransport] operator[SEP] identifier[FEATUREMAP_REQATTRNAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[features] operator[==] Other[null] operator[SEP] { identifier[features] operator[=] identifier[Features] operator[SEP] identifier[emptyFeatures] operator[SEP] } identifier[IAggregator] identifier[aggr] operator[=] operator[SEP] identifier[IAggregator] operator[SEP] identifier[request] operator[SEP] identifier[getAttribute] operator[SEP] identifier[IAggregator] operator[SEP] identifier[AGGREGATOR_REQATTRNAME] operator[SEP] operator[SEP] identifier[IConfig] identifier[config] operator[=] identifier[aggr] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[SortedMap] operator[<] identifier[String] , identifier[Boolean] operator[>] identifier[map] operator[=] Keyword[new] identifier[TreeMap] operator[<] identifier[String] , identifier[Boolean] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[featureName] operator[:] identifier[features] operator[SEP] identifier[featureNames] operator[SEP] operator[SEP] operator[SEP] { identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[featureName] , identifier[features] operator[SEP] identifier[isFeature] operator[SEP] identifier[featureName] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[depFeatures] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[isCoerceUndefinedToFalse] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[depFeatures] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[s] operator[SEP] operator[SEP] { identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[s] , literal[boolean] operator[SEP] operator[SEP] } } } identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[retainAll] operator[SEP] identifier[depFeatures] operator[SEP] operator[SEP] } identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Boolean] operator[>] identifier[entry] operator[:] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[1] 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[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[insert] operator[SEP] Other[0] , identifier[eyecatcher] operator[+] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static void cublasZrotg(Pointer host_ca, cuDoubleComplex cb, Pointer host_sc, Pointer host_cs) { cublasZrotgNative(host_ca, cb, host_sc, host_cs); checkResultBLAS(); }
class class_name[name] begin[{] method[cublasZrotg, return_type[void], modifier[public static], parameter[host_ca, cb, host_sc, host_cs]] begin[{] call[.cublasZrotgNative, parameter[member[.host_ca], member[.cb], member[.host_sc], member[.host_cs]]] call[.checkResultBLAS, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[cublasZrotg] operator[SEP] identifier[Pointer] identifier[host_ca] , identifier[cuDoubleComplex] identifier[cb] , identifier[Pointer] identifier[host_sc] , identifier[Pointer] identifier[host_cs] operator[SEP] { identifier[cublasZrotgNative] operator[SEP] identifier[host_ca] , identifier[cb] , identifier[host_sc] , identifier[host_cs] operator[SEP] operator[SEP] identifier[checkResultBLAS] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isEnabled(String property, DatasetDescriptor descriptor) { if (descriptor.hasProperty(property)) { // return true if and only if the property value is "true" return Boolean.valueOf(descriptor.getProperty(property)); } return false; }
class class_name[name] begin[{] method[isEnabled, return_type[type[boolean]], modifier[public static], parameter[property, descriptor]] begin[{] if[call[descriptor.hasProperty, parameter[member[.property]]]] begin[{] return[call[Boolean.valueOf, parameter[call[descriptor.getProperty, parameter[member[.property]]]]]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isEnabled] operator[SEP] identifier[String] identifier[property] , identifier[DatasetDescriptor] identifier[descriptor] operator[SEP] { Keyword[if] operator[SEP] identifier[descriptor] operator[SEP] identifier[hasProperty] operator[SEP] identifier[property] operator[SEP] operator[SEP] { Keyword[return] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[descriptor] operator[SEP] identifier[getProperty] operator[SEP] identifier[property] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public int readMarker(SequenceFile.Reader reader) throws IOException { if (valueBytes == null) { valueBytes = reader.createValueBytes(); } rawKey.reset(); rawValue.reset(); // valueBytes need not be reset since nextRaw call does it (and it is a private method) int status = reader.nextRaw(rawKey, valueBytes); // if we reach EOF, return -1 if (status == -1) { return -1; } // Check if the marker key is valid and return the count if (isMarkerValid()) { valueBytes.writeUncompressedBytes(rawValue); rawValue.flush(); // rawValue.getData() may return a larger byte array but Ints.fromByteArray will only read the first four bytes return Ints.fromByteArray(rawValue.getData()); } // EOF not reached and marker is not valid, then thrown an IOException since we can't make progress throw new IOException(String.format("Invalid key for num entries appended found %s, expected : %s", new String(rawKey.getData()), TxConstants.TransactionLog.NUM_ENTRIES_APPENDED)); }
class class_name[name] begin[{] method[readMarker, return_type[type[int]], modifier[public], parameter[reader]] begin[{] if[binary_operation[member[.valueBytes], ==, literal[null]]] begin[{] assign[member[.valueBytes], call[reader.createValueBytes, parameter[]]] else begin[{] None end[}] call[rawKey.reset, parameter[]] call[rawValue.reset, parameter[]] local_variable[type[int], status] if[binary_operation[member[.status], ==, literal[1]]] begin[{] return[literal[1]] else begin[{] None end[}] if[call[.isMarkerValid, parameter[]]] begin[{] call[valueBytes.writeUncompressedBytes, parameter[member[.rawValue]]] call[rawValue.flush, parameter[]] return[call[Ints.fromByteArray, parameter[call[rawValue.getData, parameter[]]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid key for num entries appended found %s, expected : %s"), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=rawKey, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), MemberReference(member=NUM_ENTRIES_APPENDED, postfix_operators=[], prefix_operators=[], qualifier=TxConstants.TransactionLog, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[int] identifier[readMarker] operator[SEP] identifier[SequenceFile] operator[SEP] identifier[Reader] identifier[reader] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[valueBytes] operator[==] Other[null] operator[SEP] { identifier[valueBytes] operator[=] identifier[reader] operator[SEP] identifier[createValueBytes] operator[SEP] operator[SEP] operator[SEP] } identifier[rawKey] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[rawValue] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[status] operator[=] identifier[reader] operator[SEP] identifier[nextRaw] operator[SEP] identifier[rawKey] , identifier[valueBytes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[status] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } Keyword[if] operator[SEP] identifier[isMarkerValid] operator[SEP] operator[SEP] operator[SEP] { identifier[valueBytes] operator[SEP] identifier[writeUncompressedBytes] operator[SEP] identifier[rawValue] operator[SEP] operator[SEP] identifier[rawValue] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Ints] operator[SEP] identifier[fromByteArray] operator[SEP] identifier[rawValue] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[new] identifier[String] operator[SEP] identifier[rawKey] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] , identifier[TxConstants] operator[SEP] identifier[TransactionLog] operator[SEP] identifier[NUM_ENTRIES_APPENDED] operator[SEP] operator[SEP] operator[SEP] }
private boolean internalPut( SIMPMessage msg, TransactionCommon tran, InputHandlerStore inputHandlerStore, boolean storedByIH, boolean storedByCD, boolean firstPut) throws SIResourceException, SIDiscriminatorSyntaxException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "internalPut", new Object[] { msg, tran, inputHandlerStore, Boolean.valueOf(storedByIH), Boolean.valueOf(storedByCD), Boolean.valueOf(firstPut), msg.getMessage().getSystemMessageId() }); long lastSpecificVersion = 0; // Used to determine if the consumer set has changed boolean finalMatch = false; // Once this is true it doesn't matter if the consumers change boolean continueSearch = true; DispatchableKey readyConsumer = null; boolean newMatchRequired = false; boolean grabCurrentReadyVersion = false; boolean statsNeedUpdating = firstPut; // Stats are only updated if firstPut long newestReadyVersion = Long.MAX_VALUE; // The newest ready consumer we're interested in MatchingConsumerPoint[] matchResults = null; // The search results object is used to retrieve the list of matching consumer keys // if needed and the result is stored in the matchResults object. MessageProcessorSearchResults searchResults = null; boolean specificConsumer = false; // Used to determine what kind of consumer we have boolean eligibleForDelivery = true; // Set to false if our noLocal check means we don`t dispatch the msg boolean shortLivedProducerSeedIncremented = false; // Set to true to ensure we do not double-increment the shortLivedProducerSeed // Private list of ready forward scanning consumers java.util.ArrayList<DispatchableKey> forwardScanningReadyConsumers = null; // Indicates that a messageItemReference was created early before the message // was stored. boolean referenceCreatedEarly = false; if (storedByCD) { // As we've already stored the message we only need to check the consumers that // were ready at the time (actually just after) we stored it. Any consumers // becoming ready since then will have to have checked the message store on // the way in and will see the message if its still there. grabCurrentReadyVersion = true; } while (continueSearch) { synchronized (_baseDestHandler.getReadyConsumerPointLock()) { //Once the message has been stored there is no need in trying to give a message //to a newly ready consumer (in fact it could cause us to loop indefinitely). So //once we've stored the message we grab the ready consumer set version (updated //everytime a consumer goes from notready to ready) if (grabCurrentReadyVersion) { newestReadyVersion = readyConsumerVersion; grabCurrentReadyVersion = false; } //Search the non-specific ready list (performed under the lock to ensure we //see the current ready consumers). popFirstReadyConsumer() will only return //a consumer that was made ready as or before readyConsumerVersion exceeded //the newestReadyVersion value. //readyConsumer = nonSpecificReadyConsumerPoints.pop(newestReadyVersion); readyConsumer = (DispatchableKey) nonSpecificReadyCPs.getFirst(); if (readyConsumer != null) { if (readyConsumer.getVersion() > newestReadyVersion) { readyConsumer = null; } } if (readyConsumer != null) { // We have a nonSpecificReadyConsumer specificConsumer = false; // We may have a key group in our hands. This is a good point to resolve // down to an individual member of the group readyConsumer = readyConsumer.resolvedKey(); // We have a ready consumer, we have to release the readyList lock before // we can try to deliver the message as this will attempt to get the // consumer's lock and a consumer can hold this while trying to add // themselves to the QP's ready list. This would cause deadlock. // popFirstReadyConsumer() will have removed this consumer from the ready // list as there are only two possible outcomes, either they take the // message or they're no longer ready. In either case they can be removed // from the list. // As we've set readyConsumer we need do nothing here, just drop through } else { // We try for a specificReadyConsumer specificConsumer = true; // Otherwise, look to see if there are any ready specific consumers (performed // under the lock to ensure we see the correct value) if (specificReadyConsumerCount > 0) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "sepcificReadyConsumerCount:" + specificReadyConsumerCount); // If the specific consumer set has changed since the last time we were // here (or if it's our first time) then we have to get matchspace to // re-parse the message. Otherwise we can use the results from the // previous time round the loop. Again, this is under the lock to make sure // we see the right version). if ((specificConsumerVersion != lastSpecificVersion) && (!finalMatch)) { if ((lastSpecificVersion > 0) // i.e. we've matched before && (!storedByCD)) { // If we already have a set of match results and the consumer set has changed // since then but we haven't put the message into the Message Store yet we may as // well skip the match here and store the message otherwise, if the consumer // set keeps changing, we'll go round this match loop forever. } else { newMatchRequired = true; lastSpecificVersion = specificConsumerVersion; // If the message is already in the Message Store it is visible to new consumers // therefore, once we've performed this match it doesn't matter if new consumers // come along later as they'll have the chance to see the message without our // help. So this match can be our last. if (storedByCD) finalMatch = true; } } else { // If we are here and matchResults are null, then we'll have // driven the MatchSpace to analyseMessages for XD but have yet // to extract ConsumerPoint results from the SearchResults if (matchResults == null) { // Extract the ConsumerPoint results Object allResults[] = searchResults.getResults(_baseDestHandler.getName()); Set matchSet = (Set) allResults[MessageProcessorMatchTarget.JS_CONSUMER_TYPE]; matchResults = (MatchingConsumerPoint[]) matchSet.toArray(new MatchingConsumerPoint[0]); } // Now process the matchResults if (matchResults.length > 0) { // We probably have ready specific consumers and we have a valid set // of matchspace results so we need to pick one to deliver the // message to. // We need a seed to allow us to attempt a round-robin selection // from the set of ready consumers. For a long lived producer, // this is based on the number of messages produced in the session. int seed = msg.getProducerSeed(); // When the producer is short lived (common in J2EE) we cannot use // the count of messages from that producer to provide even distribution. // In this case we increment our own dispatcher-wide seed count. // Negative counts mean an producer which has wrapped passed maxint. if (seed < SIMPConstants.LONG_LIVED_PRODUCER_THRESHOLD && seed >= 0) { // PK74905 This producer has sent few messages - use local seed count. seed = shortLivedProducerSeed; // Ensure we only increment the seed once, as we might go round // the loop again and re-drive this logic (for a non-transacted // send where we find we need to call store before we deliver). // 630988.1 defect information // Let us increment the seed value only if the match results return more than 1. // When there are two MDB instances (two WPS app servers in a cluster), each // matching request message would have two waiting consumers, but each reply message // would only have one matching consumer, And as they arrive interleaved, incrementing // the seed for every message would always result in the same request message consumer being // chosen first. As there is no need to use the seed when there is only one matching consumer // (the reply messages), then avoiding the seed increment would prevent this anomaly if (!shortLivedProducerSeedIncremented && matchResults.length > 1) { // 630988.1 shortLivedProducerSeed++; shortLivedProducerSeedIncremented = true; } } // Use the seed to determine the startpoint in the matchspace results array int startPoint = seed % matchResults.length; // Protect against a negative index. Mod can give negative so we need // this here, but we don't have to worry about Integer.MIN_VALUE problems. if (startPoint < 0) startPoint = (0 - startPoint); int index = startPoint; // Check for a ready consumer while (readyConsumer == null) { // Retrieve the DispatchableKey from the match result. final DispatchableKey match = matchResults[index]. getConsumerPointData(); // Find a ready consumer that is old enough for us if ((match.isKeyReady()) && (match.getVersion() <= newestReadyVersion)) { // Remember this consumer but we won't try to deliver the message // until the lock is released. readyConsumer = match; } else { // Move on to the next consumer but check we haven't looped round // to the start. index = (index + 1) % matchResults.length; if (index == startPoint) break; } } } } } } // If we have a consumer, and while we still have the lock, we need to check if // the consumer has specified noLocal and is still eligible for the message. (i.e. // it is not on the same connection as the producer). If ineligible then we // stop looking for consumers, do not store, and drop through to the end of the // method. if (readyConsumer != null) { // If noLocal is set to true and... // If the ProducerConnectionID is the same as the ConsumerConnection ID then we // do not deliver or store this message. if (dispatcherState.isNoLocal() && readyConsumer.getConnectionUuid().equals(msg.getProducerConnectionUuid())) { // We don`t want to deliver to the consumer since the message was // produced on the same connection. Therefore flag that we want to // "drop" the message from this consumer eligibleForDelivery = false; continueSearch = false; } else { // If we haven`t stored the message yet, check whether we need to. if ((!storedByCD) && (readyConsumer.requiresRecovery(msg) || msg.isTransacted())) { // If we have a transacted consumer or producer and we haven`t stored the message yet, // then do not deliver yet. Wait until the message is stored. readyConsumer = null; if (msg.isTransacted()) { // If producer transacted then drop out. We don`t want to deliver yet, // we leave this until the postCommit call. We know that there is an eligible // consumer (after the noLocal checks) and we therefore need to store the message. continueSearch = false; } } else { // Make the consumer unready because we are going to use it. readyConsumer.markNotReady(); // and forget about them for now removeReadyConsumer(readyConsumer.getParent(), specificConsumer); // PM31067 start // If we are pub/sub and we have an unrecoverable message (BENP) or not transacted // then we will be trying to give the message straight to the consumers rather than storing // the message first. This means we will be bypassing the storeMessage method which // would have created the MessageItemReference, this also means we don't reply on any // transactional callbacks, such as in the BENP transacted case. // We need to create a MsgItemReference for each interested consumer as when we deliver // the message to the consumer the LCP will be registering for message events. If each // LCP (consumer) does this on the same MessageItem then we throw an InternalException. // We need each LCP to register for message events on there own MessageItemReference. // // If we do the below but then the consumer does not take the message (giveMessagetoConsumer // returns false) then we will store the message. In this case we need to revert back to the // original messageItem to store rather than this new messageItemReference. if (isPubSub()) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "An non-recoverable or non-transacted pubsub message, create MsgReference"); // there is a chance that we might be passed in a MessageItemReference to start with if // we have gone down this path before but the consumer became unready to take the message if (msg instanceof MessageItem) { referenceCreatedEarly = true; MessageItemReference msgRef = new MessageItemReference((MessageItem) msg, true); msg = msgRef; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "MsgReference created: " + msg); } else { // the msg is probably already a msgItemReference so no need to do anything } } } } } // If we have no normal consumer ready we can see if there are any forward scanning // consumers ready. If there are and the message is already in the message store we // can just wake them all up and let them fight for the message. // We have to wake them all up as we don't know which if any of them has a cursor // behind this message, if we picked one and their cursor was already ahead of the message // the consumer would accept the put but not see the message and this method would // assume it had sccessfully given the message to someone and not try another // forward scanning consumer. So instead by waking them all up and they // all check for the message and at most one locks it. If this consumer then chooses // not to keep it they will unlock it and this method will be redriven, giving the // other consumers a chance. //TODO Currently the MS cursor will actually move all cursors over the new message // so when we wake them up the second time they won't see the message. MS promise // to fix this soon. else { if (storedByCD) { // We don't hold the list lock while we wake up the consumers so we have to // make a copy of the list of ready forward scanning consumers while we still hold // the lock. DispatchableKey readyFSConsumer = (DispatchableKey) readyFwdScanningCPs.getFirst(); if (readyFSConsumer != null) { DispatchableKey nextReadyFSConsumer; // Make the copy list forwardScanningReadyConsumers = new java.util.ArrayList<DispatchableKey>(); while (readyFSConsumer != null) { // Remember the next entry in the list nextReadyFSConsumer = (DispatchableKey) ((SimpleEntry) readyFSConsumer).next(); // Add the current entry to the copy list forwardScanningReadyConsumers.add(readyFSConsumer); // Mark this consumer as no longer ready readyFSConsumer.markNotReady(); //Remove them from the ready list ((SimpleEntry) readyFSConsumer).remove(); // Move the cursor on to the next entry readyFSConsumer = nextReadyFSConsumer; } } } } } // synchronized // Now we are no longer synchronized we can do the actual work... // If our noLocal check showed that we don`t want to deliver to this // consumer, then drop out of the method. if (eligibleForDelivery) { // If we managed to find a ready consumer we can try to deliver it to them. // It is possible that they are no longer interested so we'll have to do all // the above again. if (readyConsumer != null) { // We must NOT hold the readyList lock as this method will attempt to lock // the consumer. The consumer can attempt to lock the readyList while it // holds this lock. This prevents deadlock if (!giveMessageToConsumer(msg, tran, readyConsumer.getConsumerPoint(), storedByCD)) { continueSearch = true; } else { continueSearch = false; } // If the consumer rejects the message (they are no longer ready) we need // to do it all over again. if (continueSearch) { readyConsumer = null; } } // If we have a set of forward scanning consumers we can wake them all up now // and let them fight for the message. else if (forwardScanningReadyConsumers != null) { Iterator<DispatchableKey> consumerIterator = forwardScanningReadyConsumers.iterator(); while (consumerIterator.hasNext()) { giveMessageToConsumer( msg, tran, (consumerIterator.next()).getConsumerPoint(), storedByCD); } continueSearch = false; } // If we need matchspace to parse the message to get a set of matching // consumers we should do it now, then we can go back round and see if any // of the matching consumers are ready. else if (newMatchRequired) { // Get a search results object to use searchResults = (MessageProcessorSearchResults) _messageProcessor .getSearchResultsObjectPool() .remove(); // Search the MatchSpace to find the set of matching consumers searchMatchSpace(msg, searchResults); // Extract the ConsumerPoint results Object allResults[] = searchResults.getResults(_baseDestHandler.getName()); Set matchSet = (Set) allResults[MessageProcessorMatchTarget.JS_CONSUMER_TYPE]; matchResults = (MatchingConsumerPoint[]) matchSet.toArray(new MatchingConsumerPoint[0]); newMatchRequired = false; } // If neither of the above were true we have checked all consumers and none // of them were ready. If we haven't yet written the message out to the // message store we should do so now, then we need to go back round to see // if anyone became ready while we were doing it. else if (!storedByCD) { if (referenceCreatedEarly) { try { msg = (MessageItem) ((MessageItemReference) msg).getReferredItem(); } catch (SevereMessageStoreException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.ConsumerDispatcher.internalPut", "1:1553:1.280.5.25", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "internalPut", "SevereMessageStoreException"); throw new SIResourceException(e); } } storedByIH = storeMessage( (MessageItem) msg, tran, inputHandlerStore, storedByIH); storedByCD = true; // As we've now stored the message we only need to check the consumers that // were ready at the time (actually just after) we stored it. Any consumers // becoming ready since then will have to have checked the message store on // the way in and will see the message if its still there. grabCurrentReadyVersion = true; // If we have stored the message as part of a transaction we have to drop // out of the search and wait until the message has been committed before // we can choose a consumer for it. // A transaction = null means that it is Auto Commit if (tran != null && !tran.isAutoCommit()) continueSearch = false; } // Otherwise we've checked everyone was ready after we'd written the // message to the message store so we can stop trying. If a consumer comes // along now ooking for a message it will find it in the message store with // no help from us. else { continueSearch = false; } } } // If a MessageProcessorSearchResults object was created, add it back into the pool // at this point as it is now safe to do so. if (searchResults != null) _messageProcessor.getSearchResultsObjectPool().add(searchResults); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "internalPut", Boolean.valueOf(storedByIH)); return storedByIH; }
class class_name[name] begin[{] method[internalPut, return_type[type[boolean]], modifier[private], parameter[msg, tran, inputHandlerStore, storedByIH, storedByCD, firstPut]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["internalPut"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tran, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inputHandlerStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=storedByIH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=storedByCD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=firstPut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[MethodInvocation(arguments=[], member=getSystemMessageId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=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[long], lastSpecificVersion] local_variable[type[boolean], finalMatch] local_variable[type[boolean], continueSearch] local_variable[type[DispatchableKey], readyConsumer] local_variable[type[boolean], newMatchRequired] local_variable[type[boolean], grabCurrentReadyVersion] local_variable[type[boolean], statsNeedUpdating] local_variable[type[long], newestReadyVersion] local_variable[type[MatchingConsumerPoint], matchResults] local_variable[type[MessageProcessorSearchResults], searchResults] local_variable[type[boolean], specificConsumer] local_variable[type[boolean], eligibleForDelivery] local_variable[type[boolean], shortLivedProducerSeedIncremented] local_variable[type[java], forwardScanningReadyConsumers] local_variable[type[boolean], referenceCreatedEarly] if[member[.storedByCD]] begin[{] assign[member[.grabCurrentReadyVersion], literal[true]] else begin[{] None end[}] while[member[.continueSearch]] begin[{] SYNCHRONIZED[call[_baseDestHandler.getReadyConsumerPointLock, parameter[]]] BEGIN[{] if[member[.grabCurrentReadyVersion]] begin[{] assign[member[.newestReadyVersion], member[.readyConsumerVersion]] assign[member[.grabCurrentReadyVersion], literal[false]] else begin[{] None end[}] assign[member[.readyConsumer], Cast(expression=MethodInvocation(arguments=[], member=getFirst, postfix_operators=[], prefix_operators=[], qualifier=nonSpecificReadyCPs, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DispatchableKey, sub_type=None))] if[binary_operation[member[.readyConsumer], !=, literal[null]]] begin[{] if[binary_operation[call[readyConsumer.getVersion, parameter[]], >, member[.newestReadyVersion]]] begin[{] assign[member[.readyConsumer], literal[null]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.readyConsumer], !=, literal[null]]] begin[{] assign[member[.specificConsumer], literal[false]] assign[member[.readyConsumer], call[readyConsumer.resolvedKey, parameter[]]] else begin[{] assign[member[.specificConsumer], literal[true]] if[binary_operation[member[.specificReadyConsumerCount], >, literal[0]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[SibTr.debug, parameter[member[.tc], binary_operation[literal["sepcificReadyConsumerCount:"], +, member[.specificReadyConsumerCount]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.specificConsumerVersion], !=, member[.lastSpecificVersion]], &&, member[.finalMatch]]] begin[{] if[binary_operation[binary_operation[member[.lastSpecificVersion], >, literal[0]], &&, member[.storedByCD]]] begin[{] else begin[{] assign[member[.newMatchRequired], literal[true]] assign[member[.lastSpecificVersion], member[.specificConsumerVersion]] if[member[.storedByCD]] begin[{] assign[member[.finalMatch], literal[true]] else begin[{] None end[}] end[}] else begin[{] if[binary_operation[member[.matchResults], ==, literal[null]]] begin[{] local_variable[type[Object], allResults] local_variable[type[Set], matchSet] assign[member[.matchResults], Cast(expression=MethodInvocation(arguments=[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MatchingConsumerPoint, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=matchSet, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=MatchingConsumerPoint, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[matchResults.length], >, literal[0]]] begin[{] local_variable[type[int], seed] if[binary_operation[binary_operation[member[.seed], <, member[SIMPConstants.LONG_LIVED_PRODUCER_THRESHOLD]], &&, binary_operation[member[.seed], >=, literal[0]]]] begin[{] assign[member[.seed], member[.shortLivedProducerSeed]] if[binary_operation[member[.shortLivedProducerSeedIncremented], &&, binary_operation[member[matchResults.length], >, literal[1]]]] begin[{] member[.shortLivedProducerSeed] assign[member[.shortLivedProducerSeedIncremented], literal[true]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[int], startPoint] if[binary_operation[member[.startPoint], <, literal[0]]] begin[{] assign[member[.startPoint], binary_operation[literal[0], -, member[.startPoint]]] else begin[{] None end[}] local_variable[type[int], index] while[binary_operation[member[.readyConsumer], ==, literal[null]]] begin[{] local_variable[type[DispatchableKey], match] if[binary_operation[call[match.isKeyReady, parameter[]], &&, binary_operation[call[match.getVersion, parameter[]], <=, member[.newestReadyVersion]]]] begin[{] assign[member[.readyConsumer], member[.match]] else begin[{] assign[member[.index], binary_operation[binary_operation[member[.index], +, literal[1]], %, member[matchResults.length]]] if[binary_operation[member[.index], ==, member[.startPoint]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] end[}] end[}] else begin[{] None end[}] end[}] else begin[{] None end[}] end[}] if[binary_operation[member[.readyConsumer], !=, literal[null]]] begin[{] if[binary_operation[call[dispatcherState.isNoLocal, parameter[]], &&, call[readyConsumer.getConnectionUuid, parameter[]]]] begin[{] assign[member[.eligibleForDelivery], literal[false]] assign[member[.continueSearch], literal[false]] else begin[{] if[binary_operation[member[.storedByCD], &&, binary_operation[call[readyConsumer.requiresRecovery, parameter[member[.msg]]], ||, call[msg.isTransacted, parameter[]]]]] begin[{] assign[member[.readyConsumer], literal[null]] if[call[msg.isTransacted, parameter[]]] begin[{] assign[member[.continueSearch], literal[false]] else begin[{] None end[}] else begin[{] call[readyConsumer.markNotReady, parameter[]] call[.removeReadyConsumer, parameter[call[readyConsumer.getParent, parameter[]], member[.specificConsumer]]] if[call[.isPubSub, parameter[]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[SibTr.debug, parameter[member[.tc], literal["An non-recoverable or non-transacted pubsub message, create MsgReference"]]] else begin[{] None end[}] if[binary_operation[member[.msg], instanceof, type[MessageItem]]] begin[{] assign[member[.referenceCreatedEarly], literal[true]] local_variable[type[MessageItemReference], msgRef] assign[member[.msg], member[.msgRef]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[SibTr.debug, parameter[member[.tc], binary_operation[literal["MsgReference created: "], +, member[.msg]]]] else begin[{] None end[}] else begin[{] end[}] else begin[{] None end[}] end[}] end[}] else begin[{] if[member[.storedByCD]] begin[{] local_variable[type[DispatchableKey], readyFSConsumer] if[binary_operation[member[.readyFSConsumer], !=, literal[null]]] begin[{] local_variable[type[DispatchableKey], nextReadyFSConsumer] assign[member[.forwardScanningReadyConsumers], ClassCreator(arguments=[], 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=DispatchableKey, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] while[binary_operation[member[.readyFSConsumer], !=, literal[null]]] begin[{] assign[member[.nextReadyFSConsumer], Cast(expression=Cast(expression=MemberReference(member=readyFSConsumer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SimpleEntry, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=DispatchableKey, sub_type=None))] call[forwardScanningReadyConsumers.add, parameter[member[.readyFSConsumer]]] call[readyFSConsumer.markNotReady, parameter[]] Cast(expression=MemberReference(member=readyFSConsumer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SimpleEntry, sub_type=None)) assign[member[.readyFSConsumer], member[.nextReadyFSConsumer]] end[}] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}] if[member[.eligibleForDelivery]] begin[{] if[binary_operation[member[.readyConsumer], !=, literal[null]]] begin[{] if[call[.giveMessageToConsumer, parameter[member[.msg], member[.tran], call[readyConsumer.getConsumerPoint, parameter[]], member[.storedByCD]]]] begin[{] assign[member[.continueSearch], literal[true]] else begin[{] assign[member[.continueSearch], literal[false]] end[}] if[member[.continueSearch]] begin[{] assign[member[.readyConsumer], literal[null]] else begin[{] None end[}] else begin[{] if[binary_operation[member[.forwardScanningReadyConsumers], !=, literal[null]]] begin[{] local_variable[type[Iterator], consumerIterator] while[call[consumerIterator.hasNext, parameter[]]] begin[{] call[.giveMessageToConsumer, parameter[member[.msg], member[.tran], call[consumerIterator.next, parameter[]], member[.storedByCD]]] end[}] assign[member[.continueSearch], literal[false]] else begin[{] if[member[.newMatchRequired]] begin[{] assign[member[.searchResults], Cast(expression=MethodInvocation(arguments=[], member=getSearchResultsObjectPool, postfix_operators=[], prefix_operators=[], qualifier=_messageProcessor, selectors=[MethodInvocation(arguments=[], member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=MessageProcessorSearchResults, sub_type=None))] call[.searchMatchSpace, parameter[member[.msg], member[.searchResults]]] local_variable[type[Object], allResults] local_variable[type[Set], matchSet] assign[member[.matchResults], Cast(expression=MethodInvocation(arguments=[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MatchingConsumerPoint, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=matchSet, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=MatchingConsumerPoint, sub_type=None))] assign[member[.newMatchRequired], literal[false]] else begin[{] if[member[.storedByCD]] begin[{] if[member[.referenceCreatedEarly]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=Cast(expression=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MessageItemReference, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=MessageItem, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.ConsumerDispatcher.internalPut"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:1553:1.280.5.25"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="internalPut"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SevereMessageStoreException")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIResourceException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SevereMessageStoreException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] assign[member[.storedByIH], call[.storeMessage, parameter[Cast(expression=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MessageItem, sub_type=None)), member[.tran], member[.inputHandlerStore], member[.storedByIH]]]] assign[member[.storedByCD], literal[true]] assign[member[.grabCurrentReadyVersion], literal[true]] if[binary_operation[binary_operation[member[.tran], !=, literal[null]], &&, call[tran.isAutoCommit, parameter[]]]] begin[{] assign[member[.continueSearch], literal[false]] else begin[{] None end[}] else begin[{] assign[member[.continueSearch], literal[false]] end[}] end[}] end[}] end[}] else begin[{] None end[}] end[}] if[binary_operation[member[.searchResults], !=, literal[null]]] begin[{] call[_messageProcessor.getSearchResultsObjectPool, parameter[]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["internalPut"], call[Boolean.valueOf, parameter[member[.storedByIH]]]]] else begin[{] None end[}] return[member[.storedByIH]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[internalPut] operator[SEP] identifier[SIMPMessage] identifier[msg] , identifier[TransactionCommon] identifier[tran] , identifier[InputHandlerStore] identifier[inputHandlerStore] , Keyword[boolean] identifier[storedByIH] , Keyword[boolean] identifier[storedByCD] , Keyword[boolean] identifier[firstPut] operator[SEP] Keyword[throws] identifier[SIResourceException] , identifier[SIDiscriminatorSyntaxException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[msg] , identifier[tran] , identifier[inputHandlerStore] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[storedByIH] operator[SEP] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[storedByCD] operator[SEP] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[firstPut] operator[SEP] , identifier[msg] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] identifier[getSystemMessageId] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] Keyword[long] identifier[lastSpecificVersion] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[finalMatch] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[continueSearch] operator[=] literal[boolean] operator[SEP] identifier[DispatchableKey] identifier[readyConsumer] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[newMatchRequired] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[grabCurrentReadyVersion] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[statsNeedUpdating] operator[=] identifier[firstPut] operator[SEP] Keyword[long] identifier[newestReadyVersion] operator[=] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[SEP] identifier[MatchingConsumerPoint] operator[SEP] operator[SEP] identifier[matchResults] operator[=] Other[null] operator[SEP] identifier[MessageProcessorSearchResults] identifier[searchResults] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[specificConsumer] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[eligibleForDelivery] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[shortLivedProducerSeedIncremented] operator[=] literal[boolean] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[DispatchableKey] operator[>] identifier[forwardScanningReadyConsumers] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[referenceCreatedEarly] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[storedByCD] operator[SEP] { identifier[grabCurrentReadyVersion] operator[=] literal[boolean] operator[SEP] } Keyword[while] operator[SEP] identifier[continueSearch] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[_baseDestHandler] operator[SEP] identifier[getReadyConsumerPointLock] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[grabCurrentReadyVersion] operator[SEP] { identifier[newestReadyVersion] operator[=] identifier[readyConsumerVersion] operator[SEP] identifier[grabCurrentReadyVersion] operator[=] literal[boolean] operator[SEP] } identifier[readyConsumer] operator[=] operator[SEP] identifier[DispatchableKey] operator[SEP] identifier[nonSpecificReadyCPs] operator[SEP] identifier[getFirst] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readyConsumer] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[readyConsumer] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[>] identifier[newestReadyVersion] operator[SEP] { identifier[readyConsumer] operator[=] Other[null] operator[SEP] } } Keyword[if] operator[SEP] identifier[readyConsumer] operator[!=] Other[null] operator[SEP] { identifier[specificConsumer] operator[=] literal[boolean] operator[SEP] identifier[readyConsumer] operator[=] identifier[readyConsumer] operator[SEP] identifier[resolvedKey] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[specificConsumer] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[specificReadyConsumerCount] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[specificReadyConsumerCount] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[specificConsumerVersion] operator[!=] identifier[lastSpecificVersion] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[finalMatch] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[lastSpecificVersion] operator[>] Other[0] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[storedByCD] operator[SEP] operator[SEP] { } Keyword[else] { identifier[newMatchRequired] operator[=] literal[boolean] operator[SEP] identifier[lastSpecificVersion] operator[=] identifier[specificConsumerVersion] operator[SEP] Keyword[if] operator[SEP] identifier[storedByCD] operator[SEP] identifier[finalMatch] operator[=] literal[boolean] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[matchResults] operator[==] Other[null] operator[SEP] { identifier[Object] identifier[allResults] operator[SEP] operator[SEP] operator[=] identifier[searchResults] operator[SEP] identifier[getResults] operator[SEP] identifier[_baseDestHandler] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] identifier[matchSet] operator[=] operator[SEP] identifier[Set] operator[SEP] identifier[allResults] operator[SEP] identifier[MessageProcessorMatchTarget] operator[SEP] identifier[JS_CONSUMER_TYPE] operator[SEP] operator[SEP] identifier[matchResults] operator[=] operator[SEP] identifier[MatchingConsumerPoint] operator[SEP] operator[SEP] operator[SEP] identifier[matchSet] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[MatchingConsumerPoint] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[matchResults] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[seed] operator[=] identifier[msg] operator[SEP] identifier[getProducerSeed] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[seed] operator[<] identifier[SIMPConstants] operator[SEP] identifier[LONG_LIVED_PRODUCER_THRESHOLD] operator[&&] identifier[seed] operator[>=] Other[0] operator[SEP] { identifier[seed] operator[=] identifier[shortLivedProducerSeed] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[shortLivedProducerSeedIncremented] operator[&&] identifier[matchResults] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] { identifier[shortLivedProducerSeed] operator[++] operator[SEP] identifier[shortLivedProducerSeedIncremented] operator[=] literal[boolean] operator[SEP] } } Keyword[int] identifier[startPoint] operator[=] identifier[seed] operator[%] identifier[matchResults] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[startPoint] operator[<] Other[0] operator[SEP] identifier[startPoint] operator[=] operator[SEP] Other[0] operator[-] identifier[startPoint] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[startPoint] operator[SEP] Keyword[while] operator[SEP] identifier[readyConsumer] operator[==] Other[null] operator[SEP] { Keyword[final] identifier[DispatchableKey] identifier[match] operator[=] identifier[matchResults] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[getConsumerPointData] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[match] operator[SEP] identifier[isKeyReady] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[match] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[<=] identifier[newestReadyVersion] operator[SEP] operator[SEP] { identifier[readyConsumer] operator[=] identifier[match] operator[SEP] } Keyword[else] { identifier[index] operator[=] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[%] identifier[matchResults] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] identifier[startPoint] operator[SEP] Keyword[break] operator[SEP] } } } } } } Keyword[if] operator[SEP] identifier[readyConsumer] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[dispatcherState] operator[SEP] identifier[isNoLocal] operator[SEP] operator[SEP] operator[&&] identifier[readyConsumer] operator[SEP] identifier[getConnectionUuid] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[msg] operator[SEP] identifier[getProducerConnectionUuid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[eligibleForDelivery] operator[=] literal[boolean] operator[SEP] identifier[continueSearch] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[SEP] operator[!] identifier[storedByCD] operator[SEP] operator[&&] operator[SEP] identifier[readyConsumer] operator[SEP] identifier[requiresRecovery] operator[SEP] identifier[msg] operator[SEP] operator[||] identifier[msg] operator[SEP] identifier[isTransacted] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[readyConsumer] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[msg] operator[SEP] identifier[isTransacted] operator[SEP] operator[SEP] operator[SEP] { identifier[continueSearch] operator[=] literal[boolean] operator[SEP] } } Keyword[else] { identifier[readyConsumer] operator[SEP] identifier[markNotReady] operator[SEP] operator[SEP] operator[SEP] identifier[removeReadyConsumer] operator[SEP] identifier[readyConsumer] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] , identifier[specificConsumer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isPubSub] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msg] Keyword[instanceof] identifier[MessageItem] operator[SEP] { identifier[referenceCreatedEarly] operator[=] literal[boolean] operator[SEP] identifier[MessageItemReference] identifier[msgRef] operator[=] Keyword[new] identifier[MessageItemReference] operator[SEP] operator[SEP] identifier[MessageItem] operator[SEP] identifier[msg] , literal[boolean] operator[SEP] operator[SEP] identifier[msg] operator[=] identifier[msgRef] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[msg] operator[SEP] operator[SEP] } Keyword[else] { } } } } } Keyword[else] { Keyword[if] operator[SEP] identifier[storedByCD] operator[SEP] { identifier[DispatchableKey] identifier[readyFSConsumer] operator[=] operator[SEP] identifier[DispatchableKey] operator[SEP] identifier[readyFwdScanningCPs] operator[SEP] identifier[getFirst] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readyFSConsumer] operator[!=] Other[null] operator[SEP] { identifier[DispatchableKey] identifier[nextReadyFSConsumer] operator[SEP] identifier[forwardScanningReadyConsumers] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[DispatchableKey] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[readyFSConsumer] operator[!=] Other[null] operator[SEP] { identifier[nextReadyFSConsumer] operator[=] operator[SEP] identifier[DispatchableKey] operator[SEP] operator[SEP] operator[SEP] identifier[SimpleEntry] operator[SEP] identifier[readyFSConsumer] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[forwardScanningReadyConsumers] operator[SEP] identifier[add] operator[SEP] identifier[readyFSConsumer] operator[SEP] operator[SEP] identifier[readyFSConsumer] operator[SEP] identifier[markNotReady] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SimpleEntry] operator[SEP] identifier[readyFSConsumer] operator[SEP] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[readyFSConsumer] operator[=] identifier[nextReadyFSConsumer] operator[SEP] } } } } } Keyword[if] operator[SEP] identifier[eligibleForDelivery] operator[SEP] { Keyword[if] operator[SEP] identifier[readyConsumer] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[giveMessageToConsumer] operator[SEP] identifier[msg] , identifier[tran] , identifier[readyConsumer] operator[SEP] identifier[getConsumerPoint] operator[SEP] operator[SEP] , identifier[storedByCD] operator[SEP] operator[SEP] { identifier[continueSearch] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[continueSearch] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[continueSearch] operator[SEP] { identifier[readyConsumer] operator[=] Other[null] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[forwardScanningReadyConsumers] operator[!=] Other[null] operator[SEP] { identifier[Iterator] operator[<] identifier[DispatchableKey] operator[>] identifier[consumerIterator] operator[=] identifier[forwardScanningReadyConsumers] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[consumerIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[giveMessageToConsumer] operator[SEP] identifier[msg] , identifier[tran] , operator[SEP] identifier[consumerIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getConsumerPoint] operator[SEP] operator[SEP] , identifier[storedByCD] operator[SEP] operator[SEP] } identifier[continueSearch] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[newMatchRequired] operator[SEP] { identifier[searchResults] operator[=] operator[SEP] identifier[MessageProcessorSearchResults] operator[SEP] identifier[_messageProcessor] operator[SEP] identifier[getSearchResultsObjectPool] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[searchMatchSpace] operator[SEP] identifier[msg] , identifier[searchResults] operator[SEP] operator[SEP] identifier[Object] identifier[allResults] operator[SEP] operator[SEP] operator[=] identifier[searchResults] operator[SEP] identifier[getResults] operator[SEP] identifier[_baseDestHandler] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] identifier[matchSet] operator[=] operator[SEP] identifier[Set] operator[SEP] identifier[allResults] operator[SEP] identifier[MessageProcessorMatchTarget] operator[SEP] identifier[JS_CONSUMER_TYPE] operator[SEP] operator[SEP] identifier[matchResults] operator[=] operator[SEP] identifier[MatchingConsumerPoint] operator[SEP] operator[SEP] operator[SEP] identifier[matchSet] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[MatchingConsumerPoint] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[newMatchRequired] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[storedByCD] operator[SEP] { Keyword[if] operator[SEP] identifier[referenceCreatedEarly] operator[SEP] { Keyword[try] { identifier[msg] operator[=] operator[SEP] identifier[MessageItem] operator[SEP] operator[SEP] operator[SEP] identifier[MessageItemReference] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[getReferredItem] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SevereMessageStoreException] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SIResourceException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } identifier[storedByIH] operator[=] identifier[storeMessage] operator[SEP] operator[SEP] identifier[MessageItem] operator[SEP] identifier[msg] , identifier[tran] , identifier[inputHandlerStore] , identifier[storedByIH] operator[SEP] operator[SEP] identifier[storedByCD] operator[=] literal[boolean] operator[SEP] identifier[grabCurrentReadyVersion] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[tran] operator[!=] Other[null] operator[&&] operator[!] identifier[tran] operator[SEP] identifier[isAutoCommit] operator[SEP] operator[SEP] operator[SEP] identifier[continueSearch] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[continueSearch] operator[=] literal[boolean] operator[SEP] } } } Keyword[if] operator[SEP] identifier[searchResults] operator[!=] Other[null] operator[SEP] identifier[_messageProcessor] operator[SEP] identifier[getSearchResultsObjectPool] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[searchResults] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[storedByIH] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[storedByIH] operator[SEP] }
public ServiceFuture<Void> beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); }
class class_name[name] begin[{] method[beginEnableMonitoringAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, clusterName, parameters, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.beginEnableMonitoringWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.clusterName], member[.parameters]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[Void] operator[>] identifier[beginEnableMonitoringAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[clusterName] , identifier[ClusterMonitoringRequest] identifier[parameters] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[Void] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[beginEnableMonitoringWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[clusterName] , identifier[parameters] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public LogBufferManager<D,T> installManager() { LogBufferManager<D,T> manager = factory.apply(charset.get()); this.manager.set(manager); return manager; }
class class_name[name] begin[{] method[installManager, return_type[type[LogBufferManager]], modifier[public], parameter[]] begin[{] local_variable[type[LogBufferManager], manager] THIS[member[None.manager]call[None.set, parameter[member[.manager]]]] return[member[.manager]] end[}] END[}]
Keyword[public] identifier[LogBufferManager] operator[<] identifier[D] , identifier[T] operator[>] identifier[installManager] operator[SEP] operator[SEP] { identifier[LogBufferManager] operator[<] identifier[D] , identifier[T] operator[>] identifier[manager] operator[=] identifier[factory] operator[SEP] identifier[apply] operator[SEP] identifier[charset] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[manager] operator[SEP] identifier[set] operator[SEP] identifier[manager] operator[SEP] operator[SEP] Keyword[return] identifier[manager] operator[SEP] }
public AddlBio getAddlBio(String candidateId) throws VoteSmartException, VoteSmartErrorException { return api.query("CandidateBio.getAddlBio", new ArgMap("candidateId", candidateId), AddlBio.class ); }
class class_name[name] begin[{] method[getAddlBio, return_type[type[AddlBio]], modifier[public], parameter[candidateId]] begin[{] return[call[api.query, parameter[literal["CandidateBio.getAddlBio"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="candidateId"), MemberReference(member=candidateId, 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=ArgMap, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AddlBio, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[AddlBio] identifier[getAddlBio] operator[SEP] identifier[String] identifier[candidateId] operator[SEP] Keyword[throws] identifier[VoteSmartException] , identifier[VoteSmartErrorException] { Keyword[return] identifier[api] operator[SEP] identifier[query] operator[SEP] literal[String] , Keyword[new] identifier[ArgMap] operator[SEP] literal[String] , identifier[candidateId] operator[SEP] , identifier[AddlBio] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public void setRolloverPeriod(Duration period) { _rolloverPeriod = period.toMillis(); if (_rolloverPeriod > 0) { _rolloverPeriod += 3600000L - 1; _rolloverPeriod -= _rolloverPeriod % 3600000L; } else _rolloverPeriod = Integer.MAX_VALUE; // Period.INFINITE; }
class class_name[name] begin[{] method[setRolloverPeriod, return_type[void], modifier[public], parameter[period]] begin[{] assign[member[._rolloverPeriod], call[period.toMillis, parameter[]]] if[binary_operation[member[._rolloverPeriod], >, literal[0]]] begin[{] assign[member[._rolloverPeriod], binary_operation[literal[3600000L], -, literal[1]]] assign[member[._rolloverPeriod], binary_operation[member[._rolloverPeriod], %, literal[3600000L]]] else begin[{] assign[member[._rolloverPeriod], member[Integer.MAX_VALUE]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setRolloverPeriod] operator[SEP] identifier[Duration] identifier[period] operator[SEP] { identifier[_rolloverPeriod] operator[=] identifier[period] operator[SEP] identifier[toMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_rolloverPeriod] operator[>] Other[0] operator[SEP] { identifier[_rolloverPeriod] operator[+=] Other[3600000L] operator[-] Other[1] operator[SEP] identifier[_rolloverPeriod] operator[-=] identifier[_rolloverPeriod] operator[%] Other[3600000L] operator[SEP] } Keyword[else] identifier[_rolloverPeriod] operator[=] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] }
private static Collection<Locale> getAllLocales() { Set<Locale> result = new HashSet<Locale>(); result.addAll(OpenCms.getWorkplaceManager().getLocales()); result.addAll(OpenCms.getLocaleManager().getAvailableLocales()); return result; }
class class_name[name] begin[{] method[getAllLocales, return_type[type[Collection]], modifier[private static], parameter[]] begin[{] local_variable[type[Set], result] call[result.addAll, parameter[call[OpenCms.getWorkplaceManager, parameter[]]]] call[result.addAll, parameter[call[OpenCms.getLocaleManager, parameter[]]]] return[member[.result]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Collection] operator[<] identifier[Locale] operator[>] identifier[getAllLocales] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[Locale] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Locale] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getLocales] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getLocaleManager] operator[SEP] operator[SEP] operator[SEP] identifier[getAvailableLocales] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static base_response unset(nitro_service client, vpathparam resource, String[] args) throws Exception{ vpathparam unsetresource = new vpathparam(); return unsetresource.unset_resource(client,args); }
class class_name[name] begin[{] method[unset, return_type[type[base_response]], modifier[public static], parameter[client, resource, args]] begin[{] local_variable[type[vpathparam], unsetresource] return[call[unsetresource.unset_resource, parameter[member[.client], member[.args]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[base_response] identifier[unset] operator[SEP] identifier[nitro_service] identifier[client] , identifier[vpathparam] identifier[resource] , identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] { identifier[vpathparam] identifier[unsetresource] operator[=] Keyword[new] identifier[vpathparam] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[unsetresource] operator[SEP] identifier[unset_resource] operator[SEP] identifier[client] , identifier[args] operator[SEP] operator[SEP] }
private void authorizationRequestSend(final Context context, String path, AuthorizationRequestManager.RequestOptions options, ResponseListener listener) { try { AuthorizationRequestManager authorizationRequestManager = new AuthorizationRequestManager(); authorizationRequestManager.initialize(context, listener); authorizationRequestManager.sendRequest(path, options); } catch (Exception e) { throw new RuntimeException("Failed to send authorization request", e); } }
class class_name[name] begin[{] method[authorizationRequestSend, return_type[void], modifier[private], parameter[context, path, options, listener]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuthorizationRequestManager, sub_type=None)), name=authorizationRequestManager)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AuthorizationRequestManager, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initialize, postfix_operators=[], prefix_operators=[], qualifier=authorizationRequestManager, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendRequest, postfix_operators=[], prefix_operators=[], qualifier=authorizationRequestManager, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to send authorization request"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[authorizationRequestSend] operator[SEP] Keyword[final] identifier[Context] identifier[context] , identifier[String] identifier[path] , identifier[AuthorizationRequestManager] operator[SEP] identifier[RequestOptions] identifier[options] , identifier[ResponseListener] identifier[listener] operator[SEP] { Keyword[try] { identifier[AuthorizationRequestManager] identifier[authorizationRequestManager] operator[=] Keyword[new] identifier[AuthorizationRequestManager] operator[SEP] operator[SEP] operator[SEP] identifier[authorizationRequestManager] operator[SEP] identifier[initialize] operator[SEP] identifier[context] , identifier[listener] operator[SEP] operator[SEP] identifier[authorizationRequestManager] operator[SEP] identifier[sendRequest] operator[SEP] identifier[path] , identifier[options] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public Map<String, URL> nextImageSet() { return buildImageSet(dirs.get(random.nextInt(dirs.size()))); }
class class_name[name] begin[{] method[nextImageSet, return_type[type[Map]], modifier[public], parameter[]] begin[{] return[call[.buildImageSet, parameter[call[dirs.get, parameter[call[random.nextInt, parameter[call[dirs.size, parameter[]]]]]]]]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[URL] operator[>] identifier[nextImageSet] operator[SEP] operator[SEP] { Keyword[return] identifier[buildImageSet] operator[SEP] identifier[dirs] operator[SEP] identifier[get] operator[SEP] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] identifier[dirs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private static String superMethodName(Method method) { String returnType = method.getReturnType().getName(); return "super$" + method.getName() + "$" + returnType.replace('.', '_').replace('[', '_').replace(';', '_'); }
class class_name[name] begin[{] method[superMethodName, return_type[type[String]], modifier[private static], parameter[method]] begin[{] local_variable[type[String], returnType] return[binary_operation[binary_operation[binary_operation[literal["super$"], +, call[method.getName, parameter[]]], +, literal["$"]], +, call[returnType.replace, parameter[literal['.'], literal['_']]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[superMethodName] operator[SEP] identifier[Method] identifier[method] operator[SEP] { identifier[String] identifier[returnType] operator[=] identifier[method] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[+] identifier[method] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[returnType] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] }
private int resolveFieldIndex(TypeElement declaringClass, String name, String descriptor) { int size = 0; int index = 0; constantReadLock.lock(); try { size = getConstantPoolSize(); index = getRefIndex(Fieldref.class, declaringClass.getQualifiedName().toString(), name, descriptor); } finally { constantReadLock.unlock(); } if (index == -1) { // add entry to constant pool int ci = resolveClassIndex(declaringClass); int nati = resolveNameAndTypeIndex(name, descriptor); return addConstantInfo(new Fieldref(ci, nati), size); } return index; }
class class_name[name] begin[{] method[resolveFieldIndex, return_type[type[int]], modifier[private], parameter[declaringClass, name, descriptor]] begin[{] local_variable[type[int], size] local_variable[type[int], index] call[constantReadLock.lock, parameter[]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConstantPoolSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Fieldref, sub_type=None)), MethodInvocation(arguments=[], member=getQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=declaringClass, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=descriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRefIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=constantReadLock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) if[binary_operation[member[.index], ==, literal[1]]] begin[{] local_variable[type[int], ci] local_variable[type[int], nati] return[call[.addConstantInfo, parameter[ClassCreator(arguments=[MemberReference(member=ci, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nati, 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=Fieldref, sub_type=None)), member[.size]]]] else begin[{] None end[}] return[member[.index]] end[}] END[}]
Keyword[private] Keyword[int] identifier[resolveFieldIndex] operator[SEP] identifier[TypeElement] identifier[declaringClass] , identifier[String] identifier[name] , identifier[String] identifier[descriptor] operator[SEP] { Keyword[int] identifier[size] operator[=] Other[0] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] identifier[constantReadLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[size] operator[=] identifier[getConstantPoolSize] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[=] identifier[getRefIndex] operator[SEP] identifier[Fieldref] operator[SEP] Keyword[class] , identifier[declaringClass] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[name] , identifier[descriptor] operator[SEP] operator[SEP] } Keyword[finally] { identifier[constantReadLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] { Keyword[int] identifier[ci] operator[=] identifier[resolveClassIndex] operator[SEP] identifier[declaringClass] operator[SEP] operator[SEP] Keyword[int] identifier[nati] operator[=] identifier[resolveNameAndTypeIndex] operator[SEP] identifier[name] , identifier[descriptor] operator[SEP] operator[SEP] Keyword[return] identifier[addConstantInfo] operator[SEP] Keyword[new] identifier[Fieldref] operator[SEP] identifier[ci] , identifier[nati] operator[SEP] , identifier[size] operator[SEP] operator[SEP] } Keyword[return] identifier[index] operator[SEP] }
public Object match(CharSequence text, int startIndex){ int p = getLastAcceptedState(text, startIndex); return (p == -1) ? null : attachments[p]; }
class class_name[name] begin[{] method[match, return_type[type[Object]], modifier[public], parameter[text, startIndex]] begin[{] local_variable[type[int], p] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), if_false=MemberReference(member=attachments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[Object] identifier[match] operator[SEP] identifier[CharSequence] identifier[text] , Keyword[int] identifier[startIndex] operator[SEP] { Keyword[int] identifier[p] operator[=] identifier[getLastAcceptedState] operator[SEP] identifier[text] , identifier[startIndex] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[p] operator[==] operator[-] Other[1] operator[SEP] operator[?] Other[null] operator[:] identifier[attachments] operator[SEP] identifier[p] operator[SEP] operator[SEP] }
public User getUser(String fieldName, String fieldValue){ Select q = new Select().from(User.class); String nameColumn = ModelReflector.instance(User.class).getColumnDescriptor(fieldName).getName(); q.where(new Expression(q.getPool(),nameColumn,Operator.EQ,new BindVariable(q.getPool(),fieldValue))); List<? extends User> users = q.execute(User.class); if (users.size() == 1){ return users.get(0); } return null; }
class class_name[name] begin[{] method[getUser, return_type[type[User]], modifier[public], parameter[fieldName, fieldValue]] begin[{] local_variable[type[Select], q] local_variable[type[String], nameColumn] call[q.where, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPool, postfix_operators=[], prefix_operators=[], qualifier=q, selectors=[], type_arguments=None), MemberReference(member=nameColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EQ, postfix_operators=[], prefix_operators=[], qualifier=Operator, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPool, postfix_operators=[], prefix_operators=[], qualifier=q, selectors=[], type_arguments=None), MemberReference(member=fieldValue, 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=BindVariable, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Expression, sub_type=None))]] local_variable[type[List], users] if[binary_operation[call[users.size, parameter[]], ==, literal[1]]] begin[{] return[call[users.get, parameter[literal[0]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[User] identifier[getUser] operator[SEP] identifier[String] identifier[fieldName] , identifier[String] identifier[fieldValue] operator[SEP] { identifier[Select] identifier[q] operator[=] Keyword[new] identifier[Select] operator[SEP] operator[SEP] operator[SEP] identifier[from] operator[SEP] identifier[User] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[String] identifier[nameColumn] operator[=] identifier[ModelReflector] operator[SEP] identifier[instance] operator[SEP] identifier[User] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[getColumnDescriptor] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[where] operator[SEP] Keyword[new] identifier[Expression] operator[SEP] identifier[q] operator[SEP] identifier[getPool] operator[SEP] operator[SEP] , identifier[nameColumn] , identifier[Operator] operator[SEP] identifier[EQ] , Keyword[new] identifier[BindVariable] operator[SEP] identifier[q] operator[SEP] identifier[getPool] operator[SEP] operator[SEP] , identifier[fieldValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[User] operator[>] identifier[users] operator[=] identifier[q] operator[SEP] identifier[execute] operator[SEP] identifier[User] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[users] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { Keyword[return] identifier[users] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public static boolean isIdentifier(String key) { if (SKIP_IDENTIFIER_CHECK) { return true; } // Should not be the case but check to be sure if (key == null || key.length() == 0) { return false; } // Check the list of known invalid values int i = 0; int j = invalidIdentifiers.length; while (i < j) { int k = (i + j) >>> 1; // Avoid overflow int result = invalidIdentifiers[k].compareTo(key); if (result == 0) { return false; } if (result < 0) { i = k + 1; } else { j = k; } } // Check the start character that has more restrictions if (!Character.isJavaIdentifierStart(key.charAt(0))) { return false; } // Check each remaining character used is permitted for (int idx = 1; idx < key.length(); idx++) { if (!Character.isJavaIdentifierPart(key.charAt(idx))) { return false; } } return true; }
class class_name[name] begin[{] method[isIdentifier, return_type[type[boolean]], modifier[public static], parameter[key]] begin[{] if[member[.SKIP_IDENTIFIER_CHECK]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.key], ==, literal[null]], ||, binary_operation[call[key.length, parameter[]], ==, literal[0]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[int], i] local_variable[type[int], j] while[binary_operation[member[.i], <, member[.j]]] begin[{] local_variable[type[int], k] local_variable[type[int], result] if[binary_operation[member[.result], ==, literal[0]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.result], <, literal[0]]] begin[{] assign[member[.i], binary_operation[member[.k], +, literal[1]]] else begin[{] assign[member[.j], member[.k]] end[}] end[}] if[call[Character.isJavaIdentifierStart, parameter[call[key.charAt, parameter[literal[0]]]]]] begin[{] return[literal[false]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None)], member=isJavaIdentifierPart, postfix_operators=[], prefix_operators=['!'], qualifier=Character, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=idx, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isIdentifier] operator[SEP] identifier[String] identifier[key] operator[SEP] { Keyword[if] operator[SEP] identifier[SKIP_IDENTIFIER_CHECK] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[||] identifier[key] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[invalidIdentifiers] operator[SEP] identifier[length] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[<] identifier[j] operator[SEP] { Keyword[int] identifier[k] operator[=] operator[SEP] identifier[i] operator[+] identifier[j] operator[SEP] operator[>] operator[>] operator[>] Other[1] operator[SEP] Keyword[int] identifier[result] operator[=] identifier[invalidIdentifiers] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[result] operator[<] Other[0] operator[SEP] { identifier[i] operator[=] identifier[k] operator[+] Other[1] operator[SEP] } Keyword[else] { identifier[j] operator[=] identifier[k] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[Character] operator[SEP] identifier[isJavaIdentifierStart] operator[SEP] identifier[key] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[idx] operator[=] Other[1] operator[SEP] identifier[idx] operator[<] identifier[key] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[idx] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[Character] operator[SEP] identifier[isJavaIdentifierPart] operator[SEP] identifier[key] operator[SEP] identifier[charAt] operator[SEP] identifier[idx] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
@Override public void doSerialize( JsonWriter writer, T[][] values, JsonSerializationContext ctx, JsonSerializerParameters params ) { if ( !ctx.isWriteEmptyJsonArrays() && values.length == 0 ) { writer.cancelName(); return; } writer.beginArray(); for ( T[] array : values ) { writer.beginArray(); for ( T value : array ) { serializer.serialize( writer, value, ctx, params ); } writer.endArray(); } writer.endArray(); }
class class_name[name] begin[{] method[doSerialize, return_type[void], modifier[public], parameter[writer, values, ctx, params]] begin[{] if[binary_operation[call[ctx.isWriteEmptyJsonArrays, parameter[]], &&, binary_operation[member[values.length], ==, literal[0]]]] begin[{] call[writer.cancelName, parameter[]] return[None] else begin[{] None end[}] call[writer.beginArray, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=beginArray, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=serializer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=endArray, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=array)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=T, sub_type=None))), label=None) call[writer.endArray, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doSerialize] operator[SEP] identifier[JsonWriter] identifier[writer] , identifier[T] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[values] , identifier[JsonSerializationContext] identifier[ctx] , identifier[JsonSerializerParameters] identifier[params] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[ctx] operator[SEP] identifier[isWriteEmptyJsonArrays] operator[SEP] operator[SEP] operator[&&] identifier[values] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[writer] operator[SEP] identifier[cancelName] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[writer] operator[SEP] identifier[beginArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[array] operator[:] identifier[values] operator[SEP] { identifier[writer] operator[SEP] identifier[beginArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[T] identifier[value] operator[:] identifier[array] operator[SEP] { identifier[serializer] operator[SEP] identifier[serialize] operator[SEP] identifier[writer] , identifier[value] , identifier[ctx] , identifier[params] operator[SEP] operator[SEP] } identifier[writer] operator[SEP] identifier[endArray] operator[SEP] operator[SEP] operator[SEP] } identifier[writer] operator[SEP] identifier[endArray] operator[SEP] operator[SEP] operator[SEP] }
public synchronized void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final DeploymentUnit parent = deploymentUnit.getParent(); final DeploymentUnit topLevelDeployment = parent == null ? deploymentUnit : parent; final VirtualFile topLevelRoot = topLevelDeployment.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); final ExternalModuleService externalModuleService = topLevelDeployment.getAttachment(Attachments.EXTERNAL_MODULE_SERVICE); final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); //These are resource roots that are already accessible by default //such as ear/lib jars an web-inf/lib jars final Set<VirtualFile> existingAccessibleRoots = new HashSet<VirtualFile>(); final Map<VirtualFile, ResourceRoot> subDeployments = new HashMap<VirtualFile, ResourceRoot>(); for (ResourceRoot root : DeploymentUtils.allResourceRoots(topLevelDeployment)) { if (SubDeploymentMarker.isSubDeployment(root)) { subDeployments.put(root.getRoot(), root); } else if (ModuleRootMarker.isModuleRoot(root)) { //top level module roots are already accessible, as they are either //ear/lib jars, or jars that are already part of the deployment existingAccessibleRoots.add(root.getRoot()); } } final ArrayDeque<RootEntry> resourceRoots = new ArrayDeque<RootEntry>(); if (deploymentUnit.getParent() != null) { //top level deployments already had their exiting roots processed above for (ResourceRoot root : DeploymentUtils.allResourceRoots(deploymentUnit)) { if (ModuleRootMarker.isModuleRoot(root)) { //if this is a sub deployment of an ear we need to make sure we don't //re-add existing module roots as class path entries //this will mainly be WEB-INF/(lib|classes) entries existingAccessibleRoots.add(root.getRoot()); } } } for (ResourceRoot root : DeploymentUtils.allResourceRoots(deploymentUnit)) { //add this to the list of roots to be processed resourceRoots.add(new RootEntry(deploymentUnit, root)); } // build a map of the additional module locations // note that if a resource root has been added to two different additional modules // and is then referenced via a Class-Path entry the behaviour is undefined final Map<VirtualFile, AdditionalModuleSpecification> additionalModules = new HashMap<VirtualFile, AdditionalModuleSpecification>(); for (AdditionalModuleSpecification module : topLevelDeployment.getAttachmentList(Attachments.ADDITIONAL_MODULES)) { for (ResourceRoot additionalModuleResourceRoot : module.getResourceRoots()) { additionalModules.put(additionalModuleResourceRoot.getRoot(), module); } } //additional resource roots may be added as while (!resourceRoots.isEmpty()) { final RootEntry entry = resourceRoots.pop(); final ResourceRoot resourceRoot = entry.resourceRoot; final Attachable target = entry.target; //if this is a top level deployment we do not want to process sub deployments if (SubDeploymentMarker.isSubDeployment(resourceRoot) && resourceRoot != deploymentRoot) { continue; } final String[] items = getClassPathEntries(resourceRoot); for (final String item : items) { if (item.isEmpty() || item.equals(".")) { //a class path of . causes problems and is unnecessary, see WFLY-2725 continue; } //first try and resolve relative to the manifest resource root final VirtualFile classPathFile = resourceRoot.getRoot().getParent().getChild(item); //then resolve relative to the deployment root final VirtualFile topLevelClassPathFile = deploymentRoot.getRoot().getParent().getChild(item); if (item.startsWith("/")) { if (externalModuleService.isValid(item)) { final ModuleIdentifier moduleIdentifier = externalModuleService.addExternalModule(item); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleIdentifier); ServerLogger.DEPLOYMENT_LOGGER.debugf("Resource %s added as external jar %s", classPathFile, resourceRoot.getRoot()); } else { ServerLogger.DEPLOYMENT_LOGGER.classPathEntryNotValid(item, resourceRoot.getRoot().getPathName()); } } else { if (classPathFile.exists()) { //we need to check that this class path item actually lies within the deployment boolean found = false; VirtualFile file = classPathFile.getParent(); while (file != null) { if (file.equals(topLevelRoot)) { found = true; } file = file.getParent(); } if (!found) { ServerLogger.DEPLOYMENT_LOGGER.classPathEntryNotValid(item, resourceRoot.getRoot().getPathName()); } else { handlingExistingClassPathEntry(resourceRoots, topLevelDeployment, topLevelRoot, subDeployments, additionalModules, existingAccessibleRoots, resourceRoot, target, classPathFile); } } else if (topLevelClassPathFile.exists()) { boolean found = false; VirtualFile file = topLevelClassPathFile.getParent(); while (file != null) { if (file.equals(topLevelRoot)) { found = true; } file = file.getParent(); } if (!found) { ServerLogger.DEPLOYMENT_LOGGER.classPathEntryNotValid(item, resourceRoot.getRoot().getPathName()); } else { handlingExistingClassPathEntry(resourceRoots, topLevelDeployment, topLevelRoot, subDeployments, additionalModules, existingAccessibleRoots, resourceRoot, target, topLevelClassPathFile); } } else { ServerLogger.DEPLOYMENT_LOGGER.classPathEntryNotValid(item, resourceRoot.getRoot().getPathName()); } } } } }
class class_name[name] begin[{] method[deploy, return_type[void], modifier[synchronized public], parameter[phaseContext]] begin[{] local_variable[type[DeploymentUnit], deploymentUnit] local_variable[type[DeploymentUnit], parent] local_variable[type[DeploymentUnit], topLevelDeployment] local_variable[type[VirtualFile], topLevelRoot] local_variable[type[ExternalModuleService], externalModuleService] local_variable[type[ResourceRoot], deploymentRoot] local_variable[type[Set], existingAccessibleRoots] local_variable[type[Map], subDeployments] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSubDeployment, postfix_operators=[], prefix_operators=[], qualifier=SubDeploymentMarker, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isModuleRoot, postfix_operators=[], prefix_operators=[], qualifier=ModuleRootMarker, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=existingAccessibleRoots, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=subDeployments, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=topLevelDeployment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=allResourceRoots, postfix_operators=[], prefix_operators=[], qualifier=DeploymentUtils, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceRoot, sub_type=None))), label=None) local_variable[type[ArrayDeque], resourceRoots] if[binary_operation[call[deploymentUnit.getParent, parameter[]], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isModuleRoot, postfix_operators=[], prefix_operators=[], qualifier=ModuleRootMarker, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=existingAccessibleRoots, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=deploymentUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=allResourceRoots, postfix_operators=[], prefix_operators=[], qualifier=DeploymentUtils, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceRoot, sub_type=None))), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=deploymentUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=root, 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=RootEntry, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=resourceRoots, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=deploymentUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=allResourceRoots, postfix_operators=[], prefix_operators=[], qualifier=DeploymentUtils, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceRoot, sub_type=None))), label=None) local_variable[type[Map], additionalModules] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=additionalModuleResourceRoot, selectors=[], type_arguments=None), MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=additionalModules, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getResourceRoots, postfix_operators=[], prefix_operators=[], qualifier=module, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=additionalModuleResourceRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceRoot, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=ADDITIONAL_MODULES, postfix_operators=[], prefix_operators=[], qualifier=Attachments, selectors=[])], member=getAttachmentList, postfix_operators=[], prefix_operators=[], qualifier=topLevelDeployment, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=module)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AdditionalModuleSpecification, sub_type=None))), label=None) while[call[resourceRoots.isEmpty, parameter[]]] begin[{] local_variable[type[RootEntry], entry] local_variable[type[ResourceRoot], resourceRoot] local_variable[type[Attachable], target] if[binary_operation[call[SubDeploymentMarker.isSubDeployment, parameter[member[.resourceRoot]]], &&, binary_operation[member[.resourceRoot], !=, member[.deploymentRoot]]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[String], items] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=resourceRoot, selectors=[MethodInvocation(arguments=[], member=getParent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChild, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=classPathFile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=VirtualFile, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=deploymentRoot, selectors=[MethodInvocation(arguments=[], member=getParent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChild, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=topLevelClassPathFile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=VirtualFile, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=classPathFile, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=topLevelClassPathFile, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=resourceRoot, selectors=[MethodInvocation(arguments=[], member=getPathName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=classPathEntryNotValid, postfix_operators=[], prefix_operators=[], qualifier=ServerLogger.DEPLOYMENT_LOGGER, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=found)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=topLevelClassPathFile, selectors=[], type_arguments=None), name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VirtualFile, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=topLevelRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), IfStatement(condition=MemberReference(member=found, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourceRoots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topLevelDeployment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topLevelRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subDeployments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=additionalModules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=existingAccessibleRoots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resourceRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topLevelClassPathFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handlingExistingClassPathEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=resourceRoot, selectors=[MethodInvocation(arguments=[], member=getPathName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=classPathEntryNotValid, postfix_operators=[], prefix_operators=[], qualifier=ServerLogger.DEPLOYMENT_LOGGER, selectors=[], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=found)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=classPathFile, selectors=[], type_arguments=None), name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VirtualFile, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=topLevelRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), IfStatement(condition=MemberReference(member=found, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourceRoots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topLevelDeployment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topLevelRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subDeployments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=additionalModules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=existingAccessibleRoots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resourceRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classPathFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handlingExistingClassPathEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=resourceRoot, selectors=[MethodInvocation(arguments=[], member=getPathName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=classPathEntryNotValid, postfix_operators=[], prefix_operators=[], qualifier=ServerLogger.DEPLOYMENT_LOGGER, selectors=[], type_arguments=None), label=None)]))]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isValid, postfix_operators=[], prefix_operators=[], qualifier=externalModuleService, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=resourceRoot, selectors=[MethodInvocation(arguments=[], member=getPathName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=classPathEntryNotValid, postfix_operators=[], prefix_operators=[], qualifier=ServerLogger.DEPLOYMENT_LOGGER, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addExternalModule, postfix_operators=[], prefix_operators=[], qualifier=externalModuleService, selectors=[], type_arguments=None), name=moduleIdentifier)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ModuleIdentifier, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CLASS_PATH_ENTRIES, postfix_operators=[], prefix_operators=[], qualifier=Attachments, selectors=[]), MemberReference(member=moduleIdentifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addToAttachmentList, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Resource %s added as external jar %s"), MemberReference(member=classPathFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRoot, postfix_operators=[], prefix_operators=[], qualifier=resourceRoot, selectors=[], type_arguments=None)], member=debugf, postfix_operators=[], prefix_operators=[], qualifier=ServerLogger.DEPLOYMENT_LOGGER, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=items, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[deploy] operator[SEP] Keyword[final] identifier[DeploymentPhaseContext] identifier[phaseContext] operator[SEP] Keyword[throws] identifier[DeploymentUnitProcessingException] { Keyword[final] identifier[DeploymentUnit] identifier[deploymentUnit] operator[=] identifier[phaseContext] operator[SEP] identifier[getDeploymentUnit] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[DeploymentUnit] identifier[parent] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[DeploymentUnit] identifier[topLevelDeployment] operator[=] identifier[parent] operator[==] Other[null] operator[?] identifier[deploymentUnit] operator[:] identifier[parent] operator[SEP] Keyword[final] identifier[VirtualFile] identifier[topLevelRoot] operator[=] identifier[topLevelDeployment] operator[SEP] identifier[getAttachment] operator[SEP] identifier[Attachments] operator[SEP] identifier[DEPLOYMENT_ROOT] operator[SEP] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ExternalModuleService] identifier[externalModuleService] operator[=] identifier[topLevelDeployment] operator[SEP] identifier[getAttachment] operator[SEP] identifier[Attachments] operator[SEP] identifier[EXTERNAL_MODULE_SERVICE] operator[SEP] operator[SEP] Keyword[final] identifier[ResourceRoot] identifier[deploymentRoot] operator[=] identifier[deploymentUnit] operator[SEP] identifier[getAttachment] operator[SEP] identifier[Attachments] operator[SEP] identifier[DEPLOYMENT_ROOT] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[VirtualFile] operator[>] identifier[existingAccessibleRoots] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[VirtualFile] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[VirtualFile] , identifier[ResourceRoot] operator[>] identifier[subDeployments] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[VirtualFile] , identifier[ResourceRoot] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ResourceRoot] identifier[root] operator[:] identifier[DeploymentUtils] operator[SEP] identifier[allResourceRoots] operator[SEP] identifier[topLevelDeployment] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[SubDeploymentMarker] operator[SEP] identifier[isSubDeployment] operator[SEP] identifier[root] operator[SEP] operator[SEP] { identifier[subDeployments] operator[SEP] identifier[put] operator[SEP] identifier[root] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] , identifier[root] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ModuleRootMarker] operator[SEP] identifier[isModuleRoot] operator[SEP] identifier[root] operator[SEP] operator[SEP] { identifier[existingAccessibleRoots] operator[SEP] identifier[add] operator[SEP] identifier[root] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[final] identifier[ArrayDeque] operator[<] identifier[RootEntry] operator[>] identifier[resourceRoots] operator[=] Keyword[new] identifier[ArrayDeque] operator[<] identifier[RootEntry] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deploymentUnit] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[ResourceRoot] identifier[root] operator[:] identifier[DeploymentUtils] operator[SEP] identifier[allResourceRoots] operator[SEP] identifier[deploymentUnit] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ModuleRootMarker] operator[SEP] identifier[isModuleRoot] operator[SEP] identifier[root] operator[SEP] operator[SEP] { identifier[existingAccessibleRoots] operator[SEP] identifier[add] operator[SEP] identifier[root] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[for] operator[SEP] identifier[ResourceRoot] identifier[root] operator[:] identifier[DeploymentUtils] operator[SEP] identifier[allResourceRoots] operator[SEP] identifier[deploymentUnit] operator[SEP] operator[SEP] { identifier[resourceRoots] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[RootEntry] operator[SEP] identifier[deploymentUnit] , identifier[root] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[Map] operator[<] identifier[VirtualFile] , identifier[AdditionalModuleSpecification] operator[>] identifier[additionalModules] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[VirtualFile] , identifier[AdditionalModuleSpecification] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AdditionalModuleSpecification] identifier[module] operator[:] identifier[topLevelDeployment] operator[SEP] identifier[getAttachmentList] operator[SEP] identifier[Attachments] operator[SEP] identifier[ADDITIONAL_MODULES] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[ResourceRoot] identifier[additionalModuleResourceRoot] operator[:] identifier[module] operator[SEP] identifier[getResourceRoots] operator[SEP] operator[SEP] operator[SEP] { identifier[additionalModules] operator[SEP] identifier[put] operator[SEP] identifier[additionalModuleResourceRoot] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] , identifier[module] operator[SEP] operator[SEP] } } Keyword[while] operator[SEP] operator[!] identifier[resourceRoots] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[RootEntry] identifier[entry] operator[=] identifier[resourceRoots] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ResourceRoot] identifier[resourceRoot] operator[=] identifier[entry] operator[SEP] identifier[resourceRoot] operator[SEP] Keyword[final] identifier[Attachable] identifier[target] operator[=] identifier[entry] operator[SEP] identifier[target] operator[SEP] Keyword[if] operator[SEP] identifier[SubDeploymentMarker] operator[SEP] identifier[isSubDeployment] operator[SEP] identifier[resourceRoot] operator[SEP] operator[&&] identifier[resourceRoot] operator[!=] identifier[deploymentRoot] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[items] operator[=] identifier[getClassPathEntries] operator[SEP] identifier[resourceRoot] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[item] operator[:] identifier[items] operator[SEP] { Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[item] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[final] identifier[VirtualFile] identifier[classPathFile] operator[=] identifier[resourceRoot] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getChild] operator[SEP] identifier[item] operator[SEP] operator[SEP] Keyword[final] identifier[VirtualFile] identifier[topLevelClassPathFile] operator[=] identifier[deploymentRoot] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getChild] operator[SEP] identifier[item] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[externalModuleService] operator[SEP] identifier[isValid] operator[SEP] identifier[item] operator[SEP] operator[SEP] { Keyword[final] identifier[ModuleIdentifier] identifier[moduleIdentifier] operator[=] identifier[externalModuleService] operator[SEP] identifier[addExternalModule] operator[SEP] identifier[item] operator[SEP] operator[SEP] identifier[target] operator[SEP] identifier[addToAttachmentList] operator[SEP] identifier[Attachments] operator[SEP] identifier[CLASS_PATH_ENTRIES] , identifier[moduleIdentifier] operator[SEP] operator[SEP] identifier[ServerLogger] operator[SEP] identifier[DEPLOYMENT_LOGGER] operator[SEP] identifier[debugf] operator[SEP] literal[String] , identifier[classPathFile] , identifier[resourceRoot] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[ServerLogger] operator[SEP] identifier[DEPLOYMENT_LOGGER] operator[SEP] identifier[classPathEntryNotValid] operator[SEP] identifier[item] , identifier[resourceRoot] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[getPathName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[classPathFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[found] operator[=] literal[boolean] operator[SEP] identifier[VirtualFile] identifier[file] operator[=] identifier[classPathFile] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[file] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[equals] operator[SEP] identifier[topLevelRoot] operator[SEP] operator[SEP] { identifier[found] operator[=] literal[boolean] operator[SEP] } identifier[file] operator[=] identifier[file] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[found] operator[SEP] { identifier[ServerLogger] operator[SEP] identifier[DEPLOYMENT_LOGGER] operator[SEP] identifier[classPathEntryNotValid] operator[SEP] identifier[item] , identifier[resourceRoot] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[getPathName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[handlingExistingClassPathEntry] operator[SEP] identifier[resourceRoots] , identifier[topLevelDeployment] , identifier[topLevelRoot] , identifier[subDeployments] , identifier[additionalModules] , identifier[existingAccessibleRoots] , identifier[resourceRoot] , identifier[target] , identifier[classPathFile] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[topLevelClassPathFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[found] operator[=] literal[boolean] operator[SEP] identifier[VirtualFile] identifier[file] operator[=] identifier[topLevelClassPathFile] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[file] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[equals] operator[SEP] identifier[topLevelRoot] operator[SEP] operator[SEP] { identifier[found] operator[=] literal[boolean] operator[SEP] } identifier[file] operator[=] identifier[file] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[found] operator[SEP] { identifier[ServerLogger] operator[SEP] identifier[DEPLOYMENT_LOGGER] operator[SEP] identifier[classPathEntryNotValid] operator[SEP] identifier[item] , identifier[resourceRoot] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[getPathName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[handlingExistingClassPathEntry] operator[SEP] identifier[resourceRoots] , identifier[topLevelDeployment] , identifier[topLevelRoot] , identifier[subDeployments] , identifier[additionalModules] , identifier[existingAccessibleRoots] , identifier[resourceRoot] , identifier[target] , identifier[topLevelClassPathFile] operator[SEP] operator[SEP] } } Keyword[else] { identifier[ServerLogger] operator[SEP] identifier[DEPLOYMENT_LOGGER] operator[SEP] identifier[classPathEntryNotValid] operator[SEP] identifier[item] , identifier[resourceRoot] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[getPathName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } }
private static List<TopicPartition> convertKafkaPartitions(List<KafkaTopicPartitionState<TopicPartition>> partitions) { ArrayList<TopicPartition> result = new ArrayList<>(partitions.size()); for (KafkaTopicPartitionState<TopicPartition> p : partitions) { result.add(p.getKafkaPartitionHandle()); } return result; }
class class_name[name] begin[{] method[convertKafkaPartitions, return_type[type[List]], modifier[private static], parameter[partitions]] begin[{] local_variable[type[ArrayList], result] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKafkaPartitionHandle, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=partitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TopicPartition, sub_type=None))], dimensions=[], name=KafkaTopicPartitionState, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[TopicPartition] operator[>] identifier[convertKafkaPartitions] operator[SEP] identifier[List] operator[<] identifier[KafkaTopicPartitionState] operator[<] identifier[TopicPartition] operator[>] operator[>] identifier[partitions] operator[SEP] { identifier[ArrayList] operator[<] identifier[TopicPartition] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[partitions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[KafkaTopicPartitionState] operator[<] identifier[TopicPartition] operator[>] identifier[p] operator[:] identifier[partitions] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[p] operator[SEP] identifier[getKafkaPartitionHandle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
MeasuredNode getMinimized(MinimizationStyle style) { if (style == MinimizationStyle.PREFER_UNNEGATED || positive.node.isNot() || positive.length <= negative.length) { return positive; } else { return negative.addNot(); } }
class class_name[name] begin[{] method[getMinimized, return_type[type[MeasuredNode]], modifier[default], parameter[style]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.style], ==, member[MinimizationStyle.PREFER_UNNEGATED]], ||, call[positive.node.isNot, parameter[]]], ||, binary_operation[member[positive.length], <=, member[negative.length]]]] begin[{] return[member[.positive]] else begin[{] return[call[negative.addNot, parameter[]]] end[}] end[}] END[}]
identifier[MeasuredNode] identifier[getMinimized] operator[SEP] identifier[MinimizationStyle] identifier[style] operator[SEP] { Keyword[if] operator[SEP] identifier[style] operator[==] identifier[MinimizationStyle] operator[SEP] identifier[PREFER_UNNEGATED] operator[||] identifier[positive] operator[SEP] identifier[node] operator[SEP] identifier[isNot] operator[SEP] operator[SEP] operator[||] identifier[positive] operator[SEP] identifier[length] operator[<=] identifier[negative] operator[SEP] identifier[length] operator[SEP] { Keyword[return] identifier[positive] operator[SEP] } Keyword[else] { Keyword[return] identifier[negative] operator[SEP] identifier[addNot] operator[SEP] operator[SEP] operator[SEP] } }
@SuppressWarnings({ "rawtypes", "unchecked" }) private static void execute(final String application, final String name, final WidgetConfigurationCallback callback) { ClientApplicationInfo applicationInfo = CONFIG.get(application); // First search the application level widget configurations: ClientWidgetInfo widgetInfo = applicationInfo.getWidgetInfo(name); if (widgetInfo != null) { callback.execute(widgetInfo); return; } // Next, search within each map configuration: for (ClientMapInfo mapInfo : applicationInfo.getMaps()) { widgetInfo = search(mapInfo, name); if (widgetInfo != null) { callback.execute(widgetInfo); return; } } callback.execute(null); // found nothing, still invoke the callback! }
class class_name[name] begin[{] method[execute, return_type[void], modifier[private static], parameter[application, name, callback]] begin[{] local_variable[type[ClientApplicationInfo], applicationInfo] local_variable[type[ClientWidgetInfo], widgetInfo] if[binary_operation[member[.widgetInfo], !=, literal[null]]] begin[{] call[callback.execute, parameter[member[.widgetInfo]]] return[None] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=widgetInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=mapInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=search, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=widgetInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=widgetInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMaps, postfix_operators=[], prefix_operators=[], qualifier=applicationInfo, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=mapInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClientMapInfo, sub_type=None))), label=None) call[callback.execute, parameter[literal[null]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] Keyword[private] Keyword[static] Keyword[void] identifier[execute] operator[SEP] Keyword[final] identifier[String] identifier[application] , Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[WidgetConfigurationCallback] identifier[callback] operator[SEP] { identifier[ClientApplicationInfo] identifier[applicationInfo] operator[=] identifier[CONFIG] operator[SEP] identifier[get] operator[SEP] identifier[application] operator[SEP] operator[SEP] identifier[ClientWidgetInfo] identifier[widgetInfo] operator[=] identifier[applicationInfo] operator[SEP] identifier[getWidgetInfo] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[widgetInfo] operator[!=] Other[null] operator[SEP] { identifier[callback] operator[SEP] identifier[execute] operator[SEP] identifier[widgetInfo] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[for] operator[SEP] identifier[ClientMapInfo] identifier[mapInfo] operator[:] identifier[applicationInfo] operator[SEP] identifier[getMaps] operator[SEP] operator[SEP] operator[SEP] { identifier[widgetInfo] operator[=] identifier[search] operator[SEP] identifier[mapInfo] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[widgetInfo] operator[!=] Other[null] operator[SEP] { identifier[callback] operator[SEP] identifier[execute] operator[SEP] identifier[widgetInfo] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } identifier[callback] operator[SEP] identifier[execute] operator[SEP] Other[null] operator[SEP] operator[SEP] }
public static HttpRequest trace(final String destination) { return new HttpRequest() .method(HttpMethod.TRACE) .set(destination); }
class class_name[name] begin[{] method[trace, return_type[type[HttpRequest]], modifier[public static], parameter[destination]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=TRACE, postfix_operators=[], prefix_operators=[], qualifier=HttpMethod, selectors=[])], member=method, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=destination, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=HttpRequest, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[HttpRequest] identifier[trace] operator[SEP] Keyword[final] identifier[String] identifier[destination] operator[SEP] { Keyword[return] Keyword[new] identifier[HttpRequest] operator[SEP] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[TRACE] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[destination] operator[SEP] operator[SEP] }
public static WebSocketExtension parse(String string) { if (string == null) { return null; } // Split the string by semi-colons. String[] elements = string.trim().split("\\s*;\\s*"); if (elements.length == 0) { // Even an extension name is not included. return null; } // The first element is the extension name. String name = elements[0]; if (Token.isValid(name) == false) { // The extension name is not a valid token. return null; } // Create an instance for the extension name. WebSocketExtension extension = createInstance(name); // For each "{key}[={value}]". for (int i = 1; i < elements.length; ++i) { // Split by '=' to get the key and the value. String[] pair = elements[i].split("\\s*=\\s*", 2); // If {key} is not contained. if (pair.length == 0 || pair[0].length() == 0) { // Ignore. continue; } // The name of the parameter. String key = pair[0]; if (Token.isValid(key) == false) { // The parameter name is not a valid token. // Ignore this parameter. continue; } // The value of the parameter. String value = extractValue(pair); if (value != null) { if (Token.isValid(value) == false) { // The parameter value is not a valid token. // Ignore this parameter. continue; } } // Add the pair of the key and the value. extension.setParameter(key, value); } return extension; }
class class_name[name] begin[{] method[parse, return_type[type[WebSocketExtension]], modifier[public static], parameter[string]] begin[{] if[binary_operation[member[.string], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], elements] if[binary_operation[member[elements.length], ==, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], name] if[binary_operation[call[Token.isValid, parameter[member[.name]]], ==, literal[false]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[WebSocketExtension], extension] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\s*=\\s*"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=pair)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=pair, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=BinaryOperation(operandl=MemberReference(member=pair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=pair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isValid, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=pair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, 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=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isValid, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParameter, postfix_operators=[], prefix_operators=[], qualifier=extension, 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=elements, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[member[.extension]] end[}] END[}]
Keyword[public] Keyword[static] identifier[WebSocketExtension] identifier[parse] operator[SEP] identifier[String] identifier[string] operator[SEP] { Keyword[if] operator[SEP] identifier[string] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[String] operator[SEP] operator[SEP] identifier[elements] operator[=] identifier[string] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elements] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[String] identifier[name] operator[=] identifier[elements] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Token] operator[SEP] identifier[isValid] operator[SEP] identifier[name] operator[SEP] operator[==] literal[boolean] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[WebSocketExtension] identifier[extension] operator[=] identifier[createInstance] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[elements] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[pair] operator[=] identifier[elements] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] , Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pair] operator[SEP] identifier[length] operator[==] Other[0] operator[||] identifier[pair] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[continue] operator[SEP] } identifier[String] identifier[key] operator[=] identifier[pair] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Token] operator[SEP] identifier[isValid] operator[SEP] identifier[key] operator[SEP] operator[==] literal[boolean] operator[SEP] { Keyword[continue] operator[SEP] } identifier[String] identifier[value] operator[=] identifier[extractValue] operator[SEP] identifier[pair] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[Token] operator[SEP] identifier[isValid] operator[SEP] identifier[value] operator[SEP] operator[==] literal[boolean] operator[SEP] { Keyword[continue] operator[SEP] } } identifier[extension] operator[SEP] identifier[setParameter] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[extension] operator[SEP] }
private String generateAbbreviatedExceptionMessage(final Throwable throwable) { final StringBuilder builder = new StringBuilder(); builder.append(": "); builder.append(throwable.getClass().getCanonicalName()); builder.append(": "); builder.append(throwable.getMessage()); Throwable cause = throwable.getCause(); while (cause != null) { builder.append('\n'); builder.append("Caused by: "); builder.append(cause.getClass().getCanonicalName()); builder.append(": "); builder.append(cause.getMessage()); // make sure the exception cause is not itself to prevent infinite // looping assert (cause != cause.getCause()); cause = (cause == cause.getCause() ? null : cause.getCause()); } return builder.toString(); }
class class_name[name] begin[{] method[generateAbbreviatedExceptionMessage, return_type[type[String]], modifier[private], parameter[throwable]] begin[{] local_variable[type[StringBuilder], builder] call[builder.append, parameter[literal[": "]]] call[builder.append, parameter[call[throwable.getClass, parameter[]]]] call[builder.append, parameter[literal[": "]]] call[builder.append, parameter[call[throwable.getMessage, parameter[]]]] local_variable[type[Throwable], cause] while[binary_operation[member[.cause], !=, literal[null]]] begin[{] call[builder.append, parameter[literal['\n']]] call[builder.append, parameter[literal["Caused by: "]]] call[builder.append, parameter[call[cause.getClass, parameter[]]]] call[builder.append, parameter[literal[": "]]] call[builder.append, parameter[call[cause.getMessage, parameter[]]]] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=cause, selectors=[], type_arguments=None), operator=!=), label=None, value=None) assign[member[.cause], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=cause, selectors=[], type_arguments=None), operator===), if_false=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=cause, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] return[call[builder.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[generateAbbreviatedExceptionMessage] operator[SEP] Keyword[final] identifier[Throwable] identifier[throwable] operator[SEP] { Keyword[final] identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[throwable] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[throwable] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Throwable] identifier[cause] operator[=] identifier[throwable] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[cause] operator[!=] Other[null] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[cause] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[cause] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[cause] operator[!=] identifier[cause] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cause] operator[=] operator[SEP] identifier[cause] operator[==] identifier[cause] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[?] Other[null] operator[:] identifier[cause] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public int add(String fragments) { if (fragments == null) { return 0; } final String[] splitFragments = fragments.replaceFirst("^\\/", "").split("\\/", -1); final int n = splitFragments.length; for (int i = 0; i < n; i++) { pathFragments.add(splitFragments[i]); } return n; }
class class_name[name] begin[{] method[add, return_type[type[int]], modifier[public], parameter[fragments]] begin[{] if[binary_operation[member[.fragments], ==, literal[null]]] begin[{] return[literal[0]] else begin[{] None end[}] local_variable[type[String], splitFragments] local_variable[type[int], n] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=splitFragments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=add, postfix_operators=[], prefix_operators=[], qualifier=pathFragments, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=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[.n]] end[}] END[}]
Keyword[public] Keyword[int] identifier[add] operator[SEP] identifier[String] identifier[fragments] operator[SEP] { Keyword[if] operator[SEP] identifier[fragments] operator[==] Other[null] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[splitFragments] operator[=] identifier[fragments] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] , operator[-] Other[1] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[n] operator[=] identifier[splitFragments] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[pathFragments] operator[SEP] identifier[add] operator[SEP] identifier[splitFragments] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[n] operator[SEP] }
public static ResourceClass rootResourceFromAnnotations(Class<?> clazz) { ResourceClass resourceClass = fromAnnotations(false, clazz); return resourceClass; }
class class_name[name] begin[{] method[rootResourceFromAnnotations, return_type[type[ResourceClass]], modifier[public static], parameter[clazz]] begin[{] local_variable[type[ResourceClass], resourceClass] return[member[.resourceClass]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ResourceClass] identifier[rootResourceFromAnnotations] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] { identifier[ResourceClass] identifier[resourceClass] operator[=] identifier[fromAnnotations] operator[SEP] literal[boolean] , identifier[clazz] operator[SEP] operator[SEP] Keyword[return] identifier[resourceClass] operator[SEP] }
private static boolean loadDataMultipart(ByteBuf undecodedChunk, String delimiter, HttpData httpData) { if (!undecodedChunk.hasArray()) { return loadDataMultipartStandard(undecodedChunk, delimiter, httpData); } final SeekAheadOptimize sao = new SeekAheadOptimize(undecodedChunk); final int startReaderIndex = undecodedChunk.readerIndex(); final int delimeterLength = delimiter.length(); int index = 0; int lastRealPos = sao.pos; byte prevByte = HttpConstants.LF; boolean delimiterFound = false; while (sao.pos < sao.limit) { final byte nextByte = sao.bytes[sao.pos++]; // Check the delimiter if (prevByte == HttpConstants.LF && nextByte == delimiter.codePointAt(index)) { index++; if (delimeterLength == index) { delimiterFound = true; break; } continue; } lastRealPos = sao.pos; if (nextByte == HttpConstants.LF) { index = 0; lastRealPos -= (prevByte == HttpConstants.CR)? 2 : 1; } prevByte = nextByte; } if (prevByte == HttpConstants.CR) { lastRealPos--; } final int lastPosition = sao.getReadPosition(lastRealPos); final ByteBuf content = undecodedChunk.copy(startReaderIndex, lastPosition - startReaderIndex); try { httpData.addContent(content, delimiterFound); } catch (IOException e) { throw new ErrorDataDecoderException(e); } undecodedChunk.readerIndex(lastPosition); return delimiterFound; }
class class_name[name] begin[{] method[loadDataMultipart, return_type[type[boolean]], modifier[private static], parameter[undecodedChunk, delimiter, httpData]] begin[{] if[call[undecodedChunk.hasArray, parameter[]]] begin[{] return[call[.loadDataMultipartStandard, parameter[member[.undecodedChunk], member[.delimiter], member[.httpData]]]] else begin[{] None end[}] local_variable[type[SeekAheadOptimize], sao] local_variable[type[int], startReaderIndex] local_variable[type[int], delimeterLength] local_variable[type[int], index] local_variable[type[int], lastRealPos] local_variable[type[byte], prevByte] local_variable[type[boolean], delimiterFound] while[binary_operation[member[sao.pos], <, member[sao.limit]]] begin[{] local_variable[type[byte], nextByte] if[binary_operation[binary_operation[member[.prevByte], ==, member[HttpConstants.LF]], &&, binary_operation[member[.nextByte], ==, call[delimiter.codePointAt, parameter[member[.index]]]]]] begin[{] member[.index] if[binary_operation[member[.delimeterLength], ==, member[.index]]] begin[{] assign[member[.delimiterFound], literal[true]] BreakStatement(goto=None, label=None) else begin[{] None end[}] ContinueStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.lastRealPos], member[sao.pos]] if[binary_operation[member[.nextByte], ==, member[HttpConstants.LF]]] begin[{] assign[member[.index], literal[0]] assign[member[.lastRealPos], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=prevByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=CR, postfix_operators=[], prefix_operators=[], qualifier=HttpConstants, selectors=[]), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))] else begin[{] None end[}] assign[member[.prevByte], member[.nextByte]] end[}] if[binary_operation[member[.prevByte], ==, member[HttpConstants.CR]]] begin[{] member[.lastRealPos] else begin[{] None end[}] local_variable[type[int], lastPosition] local_variable[type[ByteBuf], content] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=delimiterFound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addContent, postfix_operators=[], prefix_operators=[], qualifier=httpData, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrorDataDecoderException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) call[undecodedChunk.readerIndex, parameter[member[.lastPosition]]] return[member[.delimiterFound]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[loadDataMultipart] operator[SEP] identifier[ByteBuf] identifier[undecodedChunk] , identifier[String] identifier[delimiter] , identifier[HttpData] identifier[httpData] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[undecodedChunk] operator[SEP] identifier[hasArray] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[loadDataMultipartStandard] operator[SEP] identifier[undecodedChunk] , identifier[delimiter] , identifier[httpData] operator[SEP] operator[SEP] } Keyword[final] identifier[SeekAheadOptimize] identifier[sao] operator[=] Keyword[new] identifier[SeekAheadOptimize] operator[SEP] identifier[undecodedChunk] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[startReaderIndex] operator[=] identifier[undecodedChunk] operator[SEP] identifier[readerIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[delimeterLength] operator[=] identifier[delimiter] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[int] identifier[lastRealPos] operator[=] identifier[sao] operator[SEP] identifier[pos] operator[SEP] Keyword[byte] identifier[prevByte] operator[=] identifier[HttpConstants] operator[SEP] identifier[LF] operator[SEP] Keyword[boolean] identifier[delimiterFound] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] identifier[sao] operator[SEP] identifier[pos] operator[<] identifier[sao] operator[SEP] identifier[limit] operator[SEP] { Keyword[final] Keyword[byte] identifier[nextByte] operator[=] identifier[sao] operator[SEP] identifier[bytes] operator[SEP] identifier[sao] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prevByte] operator[==] identifier[HttpConstants] operator[SEP] identifier[LF] operator[&&] identifier[nextByte] operator[==] identifier[delimiter] operator[SEP] identifier[codePointAt] operator[SEP] identifier[index] operator[SEP] operator[SEP] { identifier[index] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[delimeterLength] operator[==] identifier[index] operator[SEP] { identifier[delimiterFound] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } Keyword[continue] operator[SEP] } identifier[lastRealPos] operator[=] identifier[sao] operator[SEP] identifier[pos] operator[SEP] Keyword[if] operator[SEP] identifier[nextByte] operator[==] identifier[HttpConstants] operator[SEP] identifier[LF] operator[SEP] { identifier[index] operator[=] Other[0] operator[SEP] identifier[lastRealPos] operator[-=] operator[SEP] identifier[prevByte] operator[==] identifier[HttpConstants] operator[SEP] identifier[CR] operator[SEP] operator[?] Other[2] operator[:] Other[1] operator[SEP] } identifier[prevByte] operator[=] identifier[nextByte] operator[SEP] } Keyword[if] operator[SEP] identifier[prevByte] operator[==] identifier[HttpConstants] operator[SEP] identifier[CR] operator[SEP] { identifier[lastRealPos] operator[--] operator[SEP] } Keyword[final] Keyword[int] identifier[lastPosition] operator[=] identifier[sao] operator[SEP] identifier[getReadPosition] operator[SEP] identifier[lastRealPos] operator[SEP] operator[SEP] Keyword[final] identifier[ByteBuf] identifier[content] operator[=] identifier[undecodedChunk] operator[SEP] identifier[copy] operator[SEP] identifier[startReaderIndex] , identifier[lastPosition] operator[-] identifier[startReaderIndex] operator[SEP] operator[SEP] Keyword[try] { identifier[httpData] operator[SEP] identifier[addContent] operator[SEP] identifier[content] , identifier[delimiterFound] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ErrorDataDecoderException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[undecodedChunk] operator[SEP] identifier[readerIndex] operator[SEP] identifier[lastPosition] operator[SEP] operator[SEP] Keyword[return] identifier[delimiterFound] operator[SEP] }
@Override public ContextedException addContextValue(final String label, final Object value) { exceptionContext.addContextValue(label, value); return this; }
class class_name[name] begin[{] method[addContextValue, return_type[type[ContextedException]], modifier[public], parameter[label, value]] begin[{] call[exceptionContext.addContextValue, parameter[member[.label], member[.value]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ContextedException] identifier[addContextValue] operator[SEP] Keyword[final] identifier[String] identifier[label] , Keyword[final] identifier[Object] identifier[value] operator[SEP] { identifier[exceptionContext] operator[SEP] identifier[addContextValue] operator[SEP] identifier[label] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void config( String sourceClass, String sourceMethod, String msg, Object[] params ) { logp(Level.CONFIG, sourceClass, sourceMethod, msg, params); }
class class_name[name] begin[{] method[config, return_type[void], modifier[public], parameter[sourceClass, sourceMethod, msg, params]] begin[{] call[.logp, parameter[member[Level.CONFIG], member[.sourceClass], member[.sourceMethod], member[.msg], member[.params]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[config] operator[SEP] identifier[String] identifier[sourceClass] , identifier[String] identifier[sourceMethod] , identifier[String] identifier[msg] , identifier[Object] operator[SEP] operator[SEP] identifier[params] operator[SEP] { identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[CONFIG] , identifier[sourceClass] , identifier[sourceMethod] , identifier[msg] , identifier[params] operator[SEP] operator[SEP] }
protected static void renameFile(@Nonnull final File from, @Nonnull final File to) { Check.notNull(from, "from"); Check.stateIsTrue(from.exists(), "Argument 'from' must not be an existing file."); Check.notNull(to, "to"); Check.stateIsTrue(from.renameTo(to), "Renaming file from '%s' to '%s' failed.", from.getAbsolutePath(), to.getAbsolutePath()); }
class class_name[name] begin[{] method[renameFile, return_type[void], modifier[static protected], parameter[from, to]] begin[{] call[Check.notNull, parameter[member[.from], literal["from"]]] call[Check.stateIsTrue, parameter[call[from.exists, parameter[]], literal["Argument 'from' must not be an existing file."]]] call[Check.notNull, parameter[member[.to], literal["to"]]] call[Check.stateIsTrue, parameter[call[from.renameTo, parameter[member[.to]]], literal["Renaming file from '%s' to '%s' failed."], call[from.getAbsolutePath, parameter[]], call[to.getAbsolutePath, parameter[]]]] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[void] identifier[renameFile] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[File] identifier[from] , annotation[@] identifier[Nonnull] Keyword[final] identifier[File] identifier[to] operator[SEP] { identifier[Check] operator[SEP] identifier[notNull] operator[SEP] identifier[from] , literal[String] operator[SEP] operator[SEP] identifier[Check] operator[SEP] identifier[stateIsTrue] operator[SEP] identifier[from] operator[SEP] identifier[exists] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[Check] operator[SEP] identifier[notNull] operator[SEP] identifier[to] , literal[String] operator[SEP] operator[SEP] identifier[Check] operator[SEP] identifier[stateIsTrue] operator[SEP] identifier[from] operator[SEP] identifier[renameTo] operator[SEP] identifier[to] operator[SEP] , literal[String] , identifier[from] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , identifier[to] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public App addSetting(String name, Object value) { if (!StringUtils.isBlank(name) && value != null) { getSettings().put(name, value); for (AppSettingAddedListener listener : ADD_SETTING_LISTENERS) { listener.onSettingAdded(this, name, value); logger.debug("Executed {}.onSettingAdded().", listener.getClass().getName()); } } return this; }
class class_name[name] begin[{] method[addSetting, return_type[type[App]], modifier[public], parameter[name, value]] begin[{] if[binary_operation[call[StringUtils.isBlank, parameter[member[.name]]], &&, binary_operation[member[.value], !=, literal[null]]]] begin[{] call[.getSettings, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onSettingAdded, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Executed {}.onSettingAdded()."), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=ADD_SETTING_LISTENERS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AppSettingAddedListener, sub_type=None))), label=None) else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[App] identifier[addSetting] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[name] operator[SEP] operator[&&] identifier[value] operator[!=] Other[null] operator[SEP] { identifier[getSettings] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AppSettingAddedListener] identifier[listener] operator[:] identifier[ADD_SETTING_LISTENERS] operator[SEP] { identifier[listener] operator[SEP] identifier[onSettingAdded] operator[SEP] Keyword[this] , identifier[name] , identifier[value] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[listener] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[this] operator[SEP] }
final int getMajorSolarTerm(long utcDays) { double jd = JulianDay.ofEphemerisTime(this.midnight(utcDays)).getValue(); int index = (2 + (int) Math.floor(SolarTerm.solarLongitude(jd) / 30)) % 12; return ((index == 0) ? 12 : index); }
class class_name[name] begin[{] method[getMajorSolarTerm, return_type[type[int]], modifier[final], parameter[utcDays]] begin[{] local_variable[type[double], jd] local_variable[type[int], index] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12))] end[}] END[}]
Keyword[final] Keyword[int] identifier[getMajorSolarTerm] operator[SEP] Keyword[long] identifier[utcDays] operator[SEP] { Keyword[double] identifier[jd] operator[=] identifier[JulianDay] operator[SEP] identifier[ofEphemerisTime] operator[SEP] Keyword[this] operator[SEP] identifier[midnight] operator[SEP] identifier[utcDays] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] operator[SEP] Other[2] operator[+] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[floor] operator[SEP] identifier[SolarTerm] operator[SEP] identifier[solarLongitude] operator[SEP] identifier[jd] operator[SEP] operator[/] Other[30] operator[SEP] operator[SEP] operator[%] Other[12] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[index] operator[==] Other[0] operator[SEP] operator[?] Other[12] operator[:] identifier[index] operator[SEP] operator[SEP] }
private void encodeThis() throws IOException { if (id == null && names == null && serialNum == null) { this.extensionValue = null; return; } DerOutputStream seq = new DerOutputStream(); DerOutputStream tmp = new DerOutputStream(); if (id != null) { DerOutputStream tmp1 = new DerOutputStream(); id.encode(tmp1); tmp.writeImplicit(DerValue.createTag(DerValue.TAG_CONTEXT, false, TAG_ID), tmp1); } try { if (names != null) { DerOutputStream tmp1 = new DerOutputStream(); names.encode(tmp1); tmp.writeImplicit(DerValue.createTag(DerValue.TAG_CONTEXT, true, TAG_NAMES), tmp1); } } catch (Exception e) { throw new IOException(e.toString()); } if (serialNum != null) { DerOutputStream tmp1 = new DerOutputStream(); serialNum.encode(tmp1); tmp.writeImplicit(DerValue.createTag(DerValue.TAG_CONTEXT, false, TAG_SERIAL_NUM), tmp1); } seq.write(DerValue.tag_Sequence, tmp); this.extensionValue = seq.toByteArray(); }
class class_name[name] begin[{] method[encodeThis, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.id], ==, literal[null]], &&, binary_operation[member[.names], ==, literal[null]]], &&, binary_operation[member[.serialNum], ==, literal[null]]]] begin[{] assign[THIS[member[None.extensionValue]], literal[null]] return[None] else begin[{] None end[}] local_variable[type[DerOutputStream], seq] local_variable[type[DerOutputStream], tmp] if[binary_operation[member[.id], !=, literal[null]]] begin[{] local_variable[type[DerOutputStream], tmp1] call[id.encode, parameter[member[.tmp1]]] call[tmp.writeImplicit, parameter[call[DerValue.createTag, parameter[member[DerValue.TAG_CONTEXT], literal[false], member[.TAG_ID]]], member[.tmp1]]] else begin[{] None end[}] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DerOutputStream, sub_type=None)), name=tmp1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DerOutputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=TAG_CONTEXT, postfix_operators=[], prefix_operators=[], qualifier=DerValue, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=TAG_NAMES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createTag, postfix_operators=[], prefix_operators=[], qualifier=DerValue, selectors=[], type_arguments=None), MemberReference(member=tmp1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeImplicit, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.serialNum], !=, literal[null]]] begin[{] local_variable[type[DerOutputStream], tmp1] call[serialNum.encode, parameter[member[.tmp1]]] call[tmp.writeImplicit, parameter[call[DerValue.createTag, parameter[member[DerValue.TAG_CONTEXT], literal[false], member[.TAG_SERIAL_NUM]]], member[.tmp1]]] else begin[{] None end[}] call[seq.write, parameter[member[DerValue.tag_Sequence], member[.tmp]]] assign[THIS[member[None.extensionValue]], call[seq.toByteArray, parameter[]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[encodeThis] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[id] operator[==] Other[null] operator[&&] identifier[names] operator[==] Other[null] operator[&&] identifier[serialNum] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[extensionValue] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } identifier[DerOutputStream] identifier[seq] operator[=] Keyword[new] identifier[DerOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[DerOutputStream] identifier[tmp] operator[=] Keyword[new] identifier[DerOutputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] operator[!=] Other[null] operator[SEP] { identifier[DerOutputStream] identifier[tmp1] operator[=] Keyword[new] identifier[DerOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[SEP] identifier[encode] operator[SEP] identifier[tmp1] operator[SEP] operator[SEP] identifier[tmp] operator[SEP] identifier[writeImplicit] operator[SEP] identifier[DerValue] operator[SEP] identifier[createTag] operator[SEP] identifier[DerValue] operator[SEP] identifier[TAG_CONTEXT] , literal[boolean] , identifier[TAG_ID] operator[SEP] , identifier[tmp1] operator[SEP] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[names] operator[!=] Other[null] operator[SEP] { identifier[DerOutputStream] identifier[tmp1] operator[=] Keyword[new] identifier[DerOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[names] operator[SEP] identifier[encode] operator[SEP] identifier[tmp1] operator[SEP] operator[SEP] identifier[tmp] operator[SEP] identifier[writeImplicit] operator[SEP] identifier[DerValue] operator[SEP] identifier[createTag] operator[SEP] identifier[DerValue] operator[SEP] identifier[TAG_CONTEXT] , literal[boolean] , identifier[TAG_NAMES] operator[SEP] , identifier[tmp1] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[serialNum] operator[!=] Other[null] operator[SEP] { identifier[DerOutputStream] identifier[tmp1] operator[=] Keyword[new] identifier[DerOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[serialNum] operator[SEP] identifier[encode] operator[SEP] identifier[tmp1] operator[SEP] operator[SEP] identifier[tmp] operator[SEP] identifier[writeImplicit] operator[SEP] identifier[DerValue] operator[SEP] identifier[createTag] operator[SEP] identifier[DerValue] operator[SEP] identifier[TAG_CONTEXT] , literal[boolean] , identifier[TAG_SERIAL_NUM] operator[SEP] , identifier[tmp1] operator[SEP] operator[SEP] } identifier[seq] operator[SEP] identifier[write] operator[SEP] identifier[DerValue] operator[SEP] identifier[tag_Sequence] , identifier[tmp] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[extensionValue] operator[=] identifier[seq] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] }
@Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { if (!roundEnv.processingOver()) { for (TypeElement te : annotations) { for (Element elt : roundEnv.getElementsAnnotatedWith(te)) { if (!elt.toString().startsWith("org.apache.heron")) { env.getMessager().printMessage( Kind.WARNING, String.format("%s extends from a class annotated with %s", elt, te), elt); } } } } return true; }
class class_name[name] begin[{] method[process, return_type[type[boolean]], modifier[public], parameter[annotations, roundEnv]] begin[{] if[call[roundEnv.processingOver, parameter[]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=['!'], qualifier=elt, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.apache.heron")], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getMessager, postfix_operators=[], prefix_operators=[], qualifier=env, selectors=[MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Kind, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s extends from a class annotated with %s"), MemberReference(member=elt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=te, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=elt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=te, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getElementsAnnotatedWith, postfix_operators=[], prefix_operators=[], qualifier=roundEnv, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=elt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=annotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=te)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeElement, sub_type=None))), label=None) else begin[{] None end[}] return[literal[true]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[process] operator[SEP] identifier[Set] operator[<] operator[?] Keyword[extends] identifier[TypeElement] operator[>] identifier[annotations] , identifier[RoundEnvironment] identifier[roundEnv] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[roundEnv] operator[SEP] identifier[processingOver] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[TypeElement] identifier[te] operator[:] identifier[annotations] operator[SEP] { Keyword[for] operator[SEP] identifier[Element] identifier[elt] operator[:] identifier[roundEnv] operator[SEP] identifier[getElementsAnnotatedWith] operator[SEP] identifier[te] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[elt] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[env] operator[SEP] identifier[getMessager] operator[SEP] operator[SEP] operator[SEP] identifier[printMessage] operator[SEP] identifier[Kind] operator[SEP] identifier[WARNING] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[elt] , identifier[te] operator[SEP] , identifier[elt] operator[SEP] operator[SEP] } } } } Keyword[return] literal[boolean] operator[SEP] }
public final void addAlias(String alias, String attributeName) throws NoSuchAttributeException, AttributeExistsException { // complain if alias name already exists in this AttributeTable. if (_attr.get(alias) != null) { throw new AttributeExistsException("Could not alias `" + alias + "' to `" + attributeName + "'. " + "It is a duplicat name in this AttributeTable"); } if (Debug.isSet("AttributTable")) { log.debug("Adding alias '" + alias + "' to AttributeTable '" + getClearName() + "'"); } Alias newAlias = new Alias(alias, attributeName); _attr.put(alias, newAlias); }
class class_name[name] begin[{] method[addAlias, return_type[void], modifier[final public], parameter[alias, attributeName]] begin[{] if[binary_operation[call[_attr.get, parameter[member[.alias]]], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not alias `"), operandr=MemberReference(member=alias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' to `"), operator=+), operandr=MemberReference(member=attributeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'. "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="It is a duplicat name in this AttributeTable"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AttributeExistsException, sub_type=None)), label=None) else begin[{] None end[}] if[call[Debug.isSet, parameter[literal["AttributTable"]]]] begin[{] call[log.debug, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Adding alias '"], +, member[.alias]], +, literal["' to AttributeTable '"]], +, call[.getClearName, parameter[]]], +, literal["'"]]]] else begin[{] None end[}] local_variable[type[Alias], newAlias] call[_attr.put, parameter[member[.alias], member[.newAlias]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[addAlias] operator[SEP] identifier[String] identifier[alias] , identifier[String] identifier[attributeName] operator[SEP] Keyword[throws] identifier[NoSuchAttributeException] , identifier[AttributeExistsException] { Keyword[if] operator[SEP] identifier[_attr] operator[SEP] identifier[get] operator[SEP] identifier[alias] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[AttributeExistsException] operator[SEP] literal[String] operator[+] identifier[alias] operator[+] literal[String] operator[+] identifier[attributeName] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[Debug] operator[SEP] identifier[isSet] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[alias] operator[+] literal[String] operator[+] identifier[getClearName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[Alias] identifier[newAlias] operator[=] Keyword[new] identifier[Alias] operator[SEP] identifier[alias] , identifier[attributeName] operator[SEP] operator[SEP] identifier[_attr] operator[SEP] identifier[put] operator[SEP] identifier[alias] , identifier[newAlias] operator[SEP] operator[SEP] }
private static boolean hasFixedPointParent(Node expr) { // Most kinds of nodes shouldn't be branches in the fixed-point tree of an unused // expression. Those listed below are the only valid kinds. switch (expr.getParent().getToken()) { case AND: case COMMA: case HOOK: case OR: return true; case ARRAYLIT: // Make a special allowance for SPREADs so they remain in a legal context. Iterable SPREADs // with other parent types are not fixed-point because ARRAYLIT is the tersest legal parent // and is known to be side-effect free. return expr.isSpread(); default: // Statments are always fixed-point parents. All other expressions are not. return NodeUtil.isStatement(expr.getParent()); } }
class class_name[name] begin[{] method[hasFixedPointParent, return_type[type[boolean]], modifier[private static], parameter[expr]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['AND', 'COMMA', 'HOOK', 'OR'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), SwitchStatementCase(case=['ARRAYLIT'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSpread, postfix_operators=[], prefix_operators=[], qualifier=expr, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=expr, selectors=[], type_arguments=None)], member=isStatement, postfix_operators=[], prefix_operators=[], qualifier=NodeUtil, selectors=[], type_arguments=None), label=None)])], expression=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=expr, selectors=[MethodInvocation(arguments=[], member=getToken, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None) end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[hasFixedPointParent] operator[SEP] identifier[Node] identifier[expr] operator[SEP] { Keyword[switch] operator[SEP] identifier[expr] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[AND] operator[:] Keyword[case] identifier[COMMA] operator[:] Keyword[case] identifier[HOOK] operator[:] Keyword[case] identifier[OR] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[case] identifier[ARRAYLIT] operator[:] Keyword[return] identifier[expr] operator[SEP] identifier[isSpread] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[return] identifier[NodeUtil] operator[SEP] identifier[isStatement] operator[SEP] identifier[expr] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public TimeZone cloneAsThawed() { JavaTimeZone tz = (JavaTimeZone)super.cloneAsThawed(); tz.javatz = (java.util.TimeZone)javatz.clone(); tz.javacal = new java.util.GregorianCalendar(javatz); // easier than synchronized javacal.clone() tz.isFrozen = false; return tz; }
class class_name[name] begin[{] method[cloneAsThawed, return_type[type[TimeZone]], modifier[public], parameter[]] begin[{] local_variable[type[JavaTimeZone], tz] assign[member[tz.javatz], Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=javatz, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=None, dimensions=None, name=TimeZone, sub_type=None))))] assign[member[tz.javacal], ClassCreator(arguments=[MemberReference(member=javatz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=None, dimensions=None, name=GregorianCalendar, sub_type=None))))] assign[member[tz.isFrozen], literal[false]] return[member[.tz]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[TimeZone] identifier[cloneAsThawed] operator[SEP] operator[SEP] { identifier[JavaTimeZone] identifier[tz] operator[=] operator[SEP] identifier[JavaTimeZone] operator[SEP] Keyword[super] operator[SEP] identifier[cloneAsThawed] operator[SEP] operator[SEP] operator[SEP] identifier[tz] operator[SEP] identifier[javatz] operator[=] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[TimeZone] operator[SEP] identifier[javatz] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] identifier[tz] operator[SEP] identifier[javacal] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[GregorianCalendar] operator[SEP] identifier[javatz] operator[SEP] operator[SEP] identifier[tz] operator[SEP] identifier[isFrozen] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[tz] operator[SEP] }
private Configuration buildTwitterConfiguration() { logger.debug("creating twitter configuration"); ConfigurationBuilder cb = new ConfigurationBuilder(); cb.setOAuthConsumerKey(oauthConsumerKey) .setOAuthConsumerSecret(oauthConsumerSecret) .setOAuthAccessToken(oauthAccessToken) .setOAuthAccessTokenSecret(oauthAccessTokenSecret); if (proxyHost != null) cb.setHttpProxyHost(proxyHost); if (proxyPort != null) cb.setHttpProxyPort(Integer.parseInt(proxyPort)); if (proxyUser != null) cb.setHttpProxyUser(proxyUser); if (proxyPassword != null) cb.setHttpProxyPassword(proxyPassword); if (raw) cb.setJSONStoreEnabled(true); logger.debug("twitter configuration created"); return cb.build(); }
class class_name[name] begin[{] method[buildTwitterConfiguration, return_type[type[Configuration]], modifier[private], parameter[]] begin[{] call[logger.debug, parameter[literal["creating twitter configuration"]]] local_variable[type[ConfigurationBuilder], cb] call[cb.setOAuthConsumerKey, parameter[member[.oauthConsumerKey]]] if[binary_operation[member[.proxyHost], !=, literal[null]]] begin[{] call[cb.setHttpProxyHost, parameter[member[.proxyHost]]] else begin[{] None end[}] if[binary_operation[member[.proxyPort], !=, literal[null]]] begin[{] call[cb.setHttpProxyPort, parameter[call[Integer.parseInt, parameter[member[.proxyPort]]]]] else begin[{] None end[}] if[binary_operation[member[.proxyUser], !=, literal[null]]] begin[{] call[cb.setHttpProxyUser, parameter[member[.proxyUser]]] else begin[{] None end[}] if[binary_operation[member[.proxyPassword], !=, literal[null]]] begin[{] call[cb.setHttpProxyPassword, parameter[member[.proxyPassword]]] else begin[{] None end[}] if[member[.raw]] begin[{] call[cb.setJSONStoreEnabled, parameter[literal[true]]] else begin[{] None end[}] call[logger.debug, parameter[literal["twitter configuration created"]]] return[call[cb.build, parameter[]]] end[}] END[}]
Keyword[private] identifier[Configuration] identifier[buildTwitterConfiguration] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ConfigurationBuilder] identifier[cb] operator[=] Keyword[new] identifier[ConfigurationBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[cb] operator[SEP] identifier[setOAuthConsumerKey] operator[SEP] identifier[oauthConsumerKey] operator[SEP] operator[SEP] identifier[setOAuthConsumerSecret] operator[SEP] identifier[oauthConsumerSecret] operator[SEP] operator[SEP] identifier[setOAuthAccessToken] operator[SEP] identifier[oauthAccessToken] operator[SEP] operator[SEP] identifier[setOAuthAccessTokenSecret] operator[SEP] identifier[oauthAccessTokenSecret] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proxyHost] operator[!=] Other[null] operator[SEP] identifier[cb] operator[SEP] identifier[setHttpProxyHost] operator[SEP] identifier[proxyHost] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proxyPort] operator[!=] Other[null] operator[SEP] identifier[cb] operator[SEP] identifier[setHttpProxyPort] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[proxyPort] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proxyUser] operator[!=] Other[null] operator[SEP] identifier[cb] operator[SEP] identifier[setHttpProxyUser] operator[SEP] identifier[proxyUser] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proxyPassword] operator[!=] Other[null] operator[SEP] identifier[cb] operator[SEP] identifier[setHttpProxyPassword] operator[SEP] identifier[proxyPassword] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[raw] operator[SEP] identifier[cb] operator[SEP] identifier[setJSONStoreEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[cb] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
protected int getMemoryUsed() { int result = 4 + 8 + 8 + 8 + 4 + 4 + 4; if (intervals != null) { result += 4 * intervals.length; for (int i = 0; i <= intervalIdx; i++) { result += intervals[i].getMemoryUsed(); } } return result; }
class class_name[name] begin[{] method[getMemoryUsed, return_type[type[int]], modifier[protected], parameter[]] begin[{] local_variable[type[int], result] if[binary_operation[member[.intervals], !=, literal[null]]] begin[{] assign[member[.result], binary_operation[literal[4], *, member[intervals.length]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=intervals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getMemoryUsed, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=intervalIdx, 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) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[protected] Keyword[int] identifier[getMemoryUsed] operator[SEP] operator[SEP] { Keyword[int] identifier[result] operator[=] Other[4] operator[+] Other[8] operator[+] Other[8] operator[+] Other[8] operator[+] Other[4] operator[+] Other[4] operator[+] Other[4] operator[SEP] Keyword[if] operator[SEP] identifier[intervals] operator[!=] Other[null] operator[SEP] { identifier[result] operator[+=] Other[4] operator[*] identifier[intervals] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<=] identifier[intervalIdx] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[result] operator[+=] identifier[intervals] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getMemoryUsed] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public static String escapeForUrl(final String input) { if (input == null || input.length() == 0) { return input; } final StringBuilder buffer = new StringBuilder(input.length() * 2); // worst-case char[] characters = input.toCharArray(); for (int i = 0, len = input.length(); i < len; ++i) { final char ch = characters[i]; // Section 2.3 - Unreserved chars if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || ch == '-' || ch == '_' || ch == '.' || ch == '~') { buffer.append(ch); } else if (ch <= 127) { // Other ASCII characters must be escaped final String hexString = Integer.toHexString(ch); if (hexString.length() == 1) { buffer.append("%0").append(hexString); } else { buffer.append('%').append(hexString); } } else if (ch <= 0x07FF) { // Other non-ASCII chars must be UTF-8 encoded buffer.append('%').append(Integer.toHexString(0xc0 | (ch >> 6))); buffer.append('%').append(Integer.toHexString(0x80 | (ch & 0x3F))); } else { buffer.append('%').append(Integer.toHexString(0xe0 | (ch >> 12))); buffer.append('%').append(Integer.toHexString(0x80 | ((ch >> 6) & 0x3F))); buffer.append('%').append(Integer.toHexString(0x80 | (ch & 0x3F))); } } return buffer.toString(); }
class class_name[name] begin[{] method[escapeForUrl, return_type[type[String]], modifier[public static], parameter[input]] begin[{] if[binary_operation[binary_operation[member[.input], ==, literal[null]], ||, binary_operation[call[input.length, parameter[]], ==, literal[0]]]] begin[{] return[member[.input]] else begin[{] None end[}] local_variable[type[StringBuilder], buffer] local_variable[type[char], characters] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=characters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=ch)], modifiers={'final'}, type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='Z'), operator=<=), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='z'), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9'), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='_'), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='~'), operator===), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=127), operator=<=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x07FF), operator=<=), else_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=buffer, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xe0), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12), operator=>>), operator=|)], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=buffer, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x80), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3F), operator=&), operator=|)], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=buffer, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x80), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3F), operator=&), operator=|)], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=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=buffer, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xc0), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=>>), operator=|)], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=buffer, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x80), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3F), operator=&), operator=|)], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=hexString)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=hexString, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_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=buffer, selectors=[MethodInvocation(arguments=[MemberReference(member=hexString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%0")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[MethodInvocation(arguments=[MemberReference(member=hexString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, 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), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=len)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[escapeForUrl] operator[SEP] Keyword[final] identifier[String] identifier[input] operator[SEP] { Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[||] identifier[input] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[input] operator[SEP] } Keyword[final] identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[input] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[characters] operator[=] identifier[input] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[len] operator[=] identifier[input] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[final] Keyword[char] identifier[ch] operator[=] identifier[characters] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[ch] operator[>=] literal[String] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] operator[||] identifier[ch] operator[==] literal[String] operator[||] identifier[ch] operator[==] literal[String] operator[||] identifier[ch] operator[==] literal[String] operator[||] identifier[ch] operator[==] literal[String] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[ch] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ch] operator[<=] Other[127] operator[SEP] { Keyword[final] identifier[String] identifier[hexString] operator[=] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[ch] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hexString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[hexString] operator[SEP] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[hexString] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[ch] operator[<=] literal[Integer] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] literal[Integer] operator[|] operator[SEP] identifier[ch] operator[>] operator[>] Other[6] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] literal[Integer] operator[|] operator[SEP] identifier[ch] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] literal[Integer] operator[|] operator[SEP] identifier[ch] operator[>] operator[>] Other[12] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] literal[Integer] operator[|] operator[SEP] operator[SEP] identifier[ch] operator[>] operator[>] Other[6] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] literal[Integer] operator[|] operator[SEP] identifier[ch] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public BigDecimal bigDecimalValue() { if (isNaN()) { throw new ArithmeticException("NaN can not be converted to a BigDecimal"); } if (isInfinite()) { throw new ArithmeticException("Infinity can not be converted to a BigDecimal"); } BigDecimal bigDecimal = bigDecimalValueNoNegativeZeroCheck(); // If the BigDecimal is 0, but the Decimal128 is negative, that means we have -0. if (isNegative() && bigDecimal.signum() == 0) { throw new ArithmeticException("Negative zero can not be converted to a BigDecimal"); } return bigDecimal; }
class class_name[name] begin[{] method[bigDecimalValue, return_type[type[BigDecimal]], modifier[public], parameter[]] begin[{] if[call[.isNaN, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NaN can not be converted to a BigDecimal")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArithmeticException, sub_type=None)), label=None) else begin[{] None end[}] if[call[.isInfinite, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Infinity can not be converted to a BigDecimal")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArithmeticException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[BigDecimal], bigDecimal] if[binary_operation[call[.isNegative, parameter[]], &&, binary_operation[call[bigDecimal.signum, parameter[]], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Negative zero can not be converted to a BigDecimal")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArithmeticException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.bigDecimal]] end[}] END[}]
Keyword[public] identifier[BigDecimal] identifier[bigDecimalValue] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isNaN] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ArithmeticException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isInfinite] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ArithmeticException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[BigDecimal] identifier[bigDecimal] operator[=] identifier[bigDecimalValueNoNegativeZeroCheck] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isNegative] operator[SEP] operator[SEP] operator[&&] identifier[bigDecimal] operator[SEP] identifier[signum] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[ArithmeticException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[bigDecimal] operator[SEP] }
@Override public void set(String propName, Object value) { if (propName.equals("mode")) { setMode(((String) value)); } super.set(propName, value); }
class class_name[name] begin[{] method[set, return_type[void], modifier[public], parameter[propName, value]] begin[{] if[call[propName.equals, parameter[literal["mode"]]]] begin[{] call[.setMode, parameter[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]] else begin[{] None end[}] SuperMethodInvocation(arguments=[MemberReference(member=propName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[set] operator[SEP] identifier[String] identifier[propName] , identifier[Object] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[propName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[setMode] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] } Keyword[super] operator[SEP] identifier[set] operator[SEP] identifier[propName] , identifier[value] operator[SEP] operator[SEP] }
@Override public EEnum getIfcBSplineSurfaceForm() { if (ifcBSplineSurfaceFormEEnum == null) { ifcBSplineSurfaceFormEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(919); } return ifcBSplineSurfaceFormEEnum; }
class class_name[name] begin[{] method[getIfcBSplineSurfaceForm, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcBSplineSurfaceFormEEnum], ==, literal[null]]] begin[{] assign[member[.ifcBSplineSurfaceFormEEnum], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=919)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.ifcBSplineSurfaceFormEEnum]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EEnum] identifier[getIfcBSplineSurfaceForm] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcBSplineSurfaceFormEEnum] operator[==] Other[null] operator[SEP] { identifier[ifcBSplineSurfaceFormEEnum] operator[=] operator[SEP] identifier[EEnum] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[919] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcBSplineSurfaceFormEEnum] operator[SEP] }
@Override public com.liferay.commerce.tax.engine.fixed.model.CommerceTaxFixedRate getCommerceTaxFixedRate( long commerceTaxFixedRateId) throws com.liferay.portal.kernel.exception.PortalException { return _commerceTaxFixedRateLocalService.getCommerceTaxFixedRate(commerceTaxFixedRateId); }
class class_name[name] begin[{] method[getCommerceTaxFixedRate, return_type[type[com]], modifier[public], parameter[commerceTaxFixedRateId]] begin[{] return[call[_commerceTaxFixedRateLocalService.getCommerceTaxFixedRate, parameter[member[.commerceTaxFixedRateId]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[tax] operator[SEP] identifier[engine] operator[SEP] identifier[fixed] operator[SEP] identifier[model] operator[SEP] identifier[CommerceTaxFixedRate] identifier[getCommerceTaxFixedRate] operator[SEP] Keyword[long] identifier[commerceTaxFixedRateId] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[portal] operator[SEP] identifier[kernel] operator[SEP] identifier[exception] operator[SEP] identifier[PortalException] { Keyword[return] identifier[_commerceTaxFixedRateLocalService] operator[SEP] identifier[getCommerceTaxFixedRate] operator[SEP] identifier[commerceTaxFixedRateId] operator[SEP] operator[SEP] }
public void remove(String suggestion) { Node n = getNode(suggestion); if(n == null) return; n.weight = -1; size--; Node m = n; if(n.mid == null) { Node replacement = removeNode(n); if(replacement != null) replacement.parent = n.parent; if(n == root) root = replacement; else if(n == n.parent.mid) n.parent.mid = replacement; else{ if(n == n.parent.left) n.parent.left = replacement; else n.parent.right = replacement; while(n != root && n != n.parent.mid) n = n.parent; } n = n.parent; if(n == null) return; } if(n.weight == -1 && n.mid.left == null && n.mid.right == null) { n = mergeWithChild(n); while(n != root && n != n.parent.mid) n = n.parent; n = n.parent; if(n == null) return; } removeFromLists(m, n); }
class class_name[name] begin[{] method[remove, return_type[void], modifier[public], parameter[suggestion]] begin[{] local_variable[type[Node], n] if[binary_operation[member[.n], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] assign[member[n.weight], literal[1]] member[.size] local_variable[type[Node], m] if[binary_operation[member[n.mid], ==, literal[null]]] begin[{] local_variable[type[Node], replacement] if[binary_operation[member[.replacement], !=, literal[null]]] begin[{] assign[member[replacement.parent], member[n.parent]] else begin[{] None end[}] if[binary_operation[member[.n], ==, member[.root]]] begin[{] assign[member[.root], member[.replacement]] else begin[{] if[binary_operation[member[.n], ==, member[n.parent.mid]]] begin[{] assign[member[n.parent.mid], member[.replacement]] else begin[{] if[binary_operation[member[.n], ==, member[n.parent.left]]] begin[{] assign[member[n.parent.left], member[.replacement]] else begin[{] assign[member[n.parent.right], member[.replacement]] end[}] while[binary_operation[binary_operation[member[.n], !=, member[.root]], &&, binary_operation[member[.n], !=, member[n.parent.mid]]]] begin[{] assign[member[.n], member[n.parent]] end[}] end[}] end[}] assign[member[.n], member[n.parent]] if[binary_operation[member[.n], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[member[n.weight], ==, literal[1]], &&, binary_operation[member[n.mid.left], ==, literal[null]]], &&, binary_operation[member[n.mid.right], ==, literal[null]]]] begin[{] assign[member[.n], call[.mergeWithChild, parameter[member[.n]]]] while[binary_operation[binary_operation[member[.n], !=, member[.root]], &&, binary_operation[member[.n], !=, member[n.parent.mid]]]] begin[{] assign[member[.n], member[n.parent]] end[}] assign[member[.n], member[n.parent]] if[binary_operation[member[.n], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] else begin[{] None end[}] call[.removeFromLists, parameter[member[.m], member[.n]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[remove] operator[SEP] identifier[String] identifier[suggestion] operator[SEP] { identifier[Node] identifier[n] operator[=] identifier[getNode] operator[SEP] identifier[suggestion] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[n] operator[SEP] identifier[weight] operator[=] operator[-] Other[1] operator[SEP] identifier[size] operator[--] operator[SEP] identifier[Node] identifier[m] operator[=] identifier[n] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[SEP] identifier[mid] operator[==] Other[null] operator[SEP] { identifier[Node] identifier[replacement] operator[=] identifier[removeNode] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[replacement] operator[!=] Other[null] operator[SEP] identifier[replacement] operator[SEP] identifier[parent] operator[=] identifier[n] operator[SEP] identifier[parent] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[==] identifier[root] operator[SEP] identifier[root] operator[=] identifier[replacement] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[n] operator[==] identifier[n] operator[SEP] identifier[parent] operator[SEP] identifier[mid] operator[SEP] identifier[n] operator[SEP] identifier[parent] operator[SEP] identifier[mid] operator[=] identifier[replacement] operator[SEP] Keyword[else] { Keyword[if] operator[SEP] identifier[n] operator[==] identifier[n] operator[SEP] identifier[parent] operator[SEP] identifier[left] operator[SEP] identifier[n] operator[SEP] identifier[parent] operator[SEP] identifier[left] operator[=] identifier[replacement] operator[SEP] Keyword[else] identifier[n] operator[SEP] identifier[parent] operator[SEP] identifier[right] operator[=] identifier[replacement] operator[SEP] Keyword[while] operator[SEP] identifier[n] operator[!=] identifier[root] operator[&&] identifier[n] operator[!=] identifier[n] operator[SEP] identifier[parent] operator[SEP] identifier[mid] operator[SEP] identifier[n] operator[=] identifier[n] operator[SEP] identifier[parent] operator[SEP] } identifier[n] operator[=] identifier[n] operator[SEP] identifier[parent] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[n] operator[SEP] identifier[weight] operator[==] operator[-] Other[1] operator[&&] identifier[n] operator[SEP] identifier[mid] operator[SEP] identifier[left] operator[==] Other[null] operator[&&] identifier[n] operator[SEP] identifier[mid] operator[SEP] identifier[right] operator[==] Other[null] operator[SEP] { identifier[n] operator[=] identifier[mergeWithChild] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[n] operator[!=] identifier[root] operator[&&] identifier[n] operator[!=] identifier[n] operator[SEP] identifier[parent] operator[SEP] identifier[mid] operator[SEP] identifier[n] operator[=] identifier[n] operator[SEP] identifier[parent] operator[SEP] identifier[n] operator[=] identifier[n] operator[SEP] identifier[parent] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] } identifier[removeFromLists] operator[SEP] identifier[m] , identifier[n] operator[SEP] operator[SEP] }
public CommandArgs<K, V> add(double n) { singularArguments.add(DoubleArgument.of(n)); return this; }
class class_name[name] begin[{] method[add, return_type[type[CommandArgs]], modifier[public], parameter[n]] begin[{] call[singularArguments.add, parameter[call[DoubleArgument.of, parameter[member[.n]]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[CommandArgs] operator[<] identifier[K] , identifier[V] operator[>] identifier[add] operator[SEP] Keyword[double] identifier[n] operator[SEP] { identifier[singularArguments] operator[SEP] identifier[add] operator[SEP] identifier[DoubleArgument] operator[SEP] identifier[of] operator[SEP] identifier[n] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void addComponentInterceptors(Method method, List<InterceptorFactory> factory, int priority) { OrderedItemContainer<List<InterceptorFactory>> interceptors = componentInterceptors.get(method); if (interceptors == null) { componentInterceptors.put(method, interceptors = new OrderedItemContainer<List<InterceptorFactory>>()); } interceptors.add(factory, priority); }
class class_name[name] begin[{] method[addComponentInterceptors, return_type[void], modifier[public], parameter[method, factory, priority]] begin[{] local_variable[type[OrderedItemContainer], interceptors] if[binary_operation[member[.interceptors], ==, literal[null]]] begin[{] call[componentInterceptors.put, parameter[member[.method], assign[member[.interceptors], 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InterceptorFactory, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=OrderedItemContainer, sub_type=None))]]] else begin[{] None end[}] call[interceptors.add, parameter[member[.factory], member[.priority]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addComponentInterceptors] operator[SEP] identifier[Method] identifier[method] , identifier[List] operator[<] identifier[InterceptorFactory] operator[>] identifier[factory] , Keyword[int] identifier[priority] operator[SEP] { identifier[OrderedItemContainer] operator[<] identifier[List] operator[<] identifier[InterceptorFactory] operator[>] operator[>] identifier[interceptors] operator[=] identifier[componentInterceptors] operator[SEP] identifier[get] operator[SEP] identifier[method] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[interceptors] operator[==] Other[null] operator[SEP] { identifier[componentInterceptors] operator[SEP] identifier[put] operator[SEP] identifier[method] , identifier[interceptors] operator[=] Keyword[new] identifier[OrderedItemContainer] operator[<] identifier[List] operator[<] identifier[InterceptorFactory] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[interceptors] operator[SEP] identifier[add] operator[SEP] identifier[factory] , identifier[priority] operator[SEP] operator[SEP] }