code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public boolean intersects(long minimum, long supremum) { rangeSanityCheck(minimum, supremum); short minKey = Util.highbits(minimum); short supKey = Util.highbits(supremum); int len = highLowContainer.size; short[] keys = highLowContainer.keys; // seek to start int index = Util.unsignedBinarySearch(keys, 0, len, minKey); int pos = index >= 0 ? index : -index - 1; short offset = Util.lowbits(minimum); while (pos < len && Util.compareUnsigned(supKey, keys[pos]) > 0) { Container container = highLowContainer.getContainerAtIndex(pos); if (container.intersects(offset, 1 << 16)) { return true; } offset = 0; ++pos; } return pos < len && supKey == keys[pos] && highLowContainer.getContainerAtIndex(pos) .intersects(0, (int)((supremum - 1) & 0xFFFF) + 1); }
class class_name[name] begin[{] method[intersects, return_type[type[boolean]], modifier[public], parameter[minimum, supremum]] begin[{] call[.rangeSanityCheck, parameter[member[.minimum], member[.supremum]]] local_variable[type[short], minKey] local_variable[type[short], supKey] local_variable[type[int], len] local_variable[type[short], keys] local_variable[type[int], index] local_variable[type[int], pos] local_variable[type[short], offset] while[binary_operation[binary_operation[member[.pos], <, member[.len]], &&, binary_operation[call[Util.compareUnsigned, parameter[member[.supKey], member[.keys]]], >, literal[0]]]] begin[{] local_variable[type[Container], container] if[call[container.intersects, parameter[member[.offset], binary_operation[literal[1], <<, literal[16]]]]] begin[{] return[literal[true]] else begin[{] None end[}] assign[member[.offset], literal[0]] member[.pos] end[}] return[binary_operation[binary_operation[binary_operation[member[.pos], <, member[.len]], &&, binary_operation[member[.supKey], ==, member[.keys]]], &&, call[highLowContainer.getContainerAtIndex, parameter[member[.pos]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[intersects] operator[SEP] Keyword[long] identifier[minimum] , Keyword[long] identifier[supremum] operator[SEP] { identifier[rangeSanityCheck] operator[SEP] identifier[minimum] , identifier[supremum] operator[SEP] operator[SEP] Keyword[short] identifier[minKey] operator[=] identifier[Util] operator[SEP] identifier[highbits] operator[SEP] identifier[minimum] operator[SEP] operator[SEP] Keyword[short] identifier[supKey] operator[=] identifier[Util] operator[SEP] identifier[highbits] operator[SEP] identifier[supremum] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[highLowContainer] operator[SEP] identifier[size] operator[SEP] Keyword[short] operator[SEP] operator[SEP] identifier[keys] operator[=] identifier[highLowContainer] operator[SEP] identifier[keys] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[Util] operator[SEP] identifier[unsignedBinarySearch] operator[SEP] identifier[keys] , Other[0] , identifier[len] , identifier[minKey] operator[SEP] operator[SEP] Keyword[int] identifier[pos] operator[=] identifier[index] operator[>=] Other[0] operator[?] identifier[index] operator[:] operator[-] identifier[index] operator[-] Other[1] operator[SEP] Keyword[short] identifier[offset] operator[=] identifier[Util] operator[SEP] identifier[lowbits] operator[SEP] identifier[minimum] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[pos] operator[<] identifier[len] operator[&&] identifier[Util] operator[SEP] identifier[compareUnsigned] operator[SEP] identifier[supKey] , identifier[keys] operator[SEP] identifier[pos] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[Container] identifier[container] operator[=] identifier[highLowContainer] operator[SEP] identifier[getContainerAtIndex] operator[SEP] identifier[pos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[container] operator[SEP] identifier[intersects] operator[SEP] identifier[offset] , Other[1] operator[<<] Other[16] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[offset] operator[=] Other[0] operator[SEP] operator[++] identifier[pos] operator[SEP] } Keyword[return] identifier[pos] operator[<] identifier[len] operator[&&] identifier[supKey] operator[==] identifier[keys] operator[SEP] identifier[pos] operator[SEP] operator[&&] identifier[highLowContainer] operator[SEP] identifier[getContainerAtIndex] operator[SEP] identifier[pos] operator[SEP] operator[SEP] identifier[intersects] operator[SEP] Other[0] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[supremum] operator[-] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] }
public static <E> E parse(InputStream is, Class<E> jsonObjectClass) throws IOException { return mapperFor(jsonObjectClass).parse(is); }
class class_name[name] begin[{] method[parse, return_type[type[E]], modifier[public static], parameter[is, jsonObjectClass]] begin[{] return[call[.mapperFor, parameter[member[.jsonObjectClass]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[E] identifier[parse] operator[SEP] identifier[InputStream] identifier[is] , identifier[Class] operator[<] identifier[E] operator[>] identifier[jsonObjectClass] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[mapperFor] operator[SEP] identifier[jsonObjectClass] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[is] operator[SEP] operator[SEP] }
public static NestedSerializersSnapshotDelegate readNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException { final int magicNumber = in.readInt(); if (magicNumber != MAGIC_NUMBER) { throw new IOException(String.format("Corrupt data, magic number mismatch. Expected %8x, found %8x", MAGIC_NUMBER, magicNumber)); } final int version = in.readInt(); if (version != VERSION) { throw new IOException("Unrecognized version: " + version); } final int numSnapshots = in.readInt(); final TypeSerializerSnapshot<?>[] nestedSnapshots = new TypeSerializerSnapshot<?>[numSnapshots]; for (int i = 0; i < numSnapshots; i++) { nestedSnapshots[i] = TypeSerializerSnapshot.readVersionedSnapshot(in, cl); } return new NestedSerializersSnapshotDelegate(nestedSnapshots); }
class class_name[name] begin[{] method[readNestedSerializerSnapshots, return_type[type[NestedSerializersSnapshotDelegate]], modifier[public static], parameter[in, cl]] begin[{] local_variable[type[int], magicNumber] if[binary_operation[member[.magicNumber], !=, member[.MAGIC_NUMBER]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Corrupt data, magic number mismatch. Expected %8x, found %8x"), MemberReference(member=MAGIC_NUMBER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=magicNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], version] if[binary_operation[member[.version], !=, member[.VERSION]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecognized version: "), operandr=MemberReference(member=version, 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=IOException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], numSnapshots] local_variable[type[TypeSerializerSnapshot], nestedSnapshots] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nestedSnapshots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readVersionedSnapshot, postfix_operators=[], prefix_operators=[], qualifier=TypeSerializerSnapshot, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numSnapshots, 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=nestedSnapshots, 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=NestedSerializersSnapshotDelegate, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[NestedSerializersSnapshotDelegate] identifier[readNestedSerializerSnapshots] operator[SEP] identifier[DataInputView] identifier[in] , identifier[ClassLoader] identifier[cl] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] Keyword[int] identifier[magicNumber] operator[=] identifier[in] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[magicNumber] operator[!=] identifier[MAGIC_NUMBER] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[MAGIC_NUMBER] , identifier[magicNumber] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[version] operator[=] identifier[in] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[version] operator[!=] identifier[VERSION] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[version] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[numSnapshots] operator[=] identifier[in] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[TypeSerializerSnapshot] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[nestedSnapshots] operator[=] Keyword[new] identifier[TypeSerializerSnapshot] operator[<] operator[?] operator[>] operator[SEP] identifier[numSnapshots] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numSnapshots] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[nestedSnapshots] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[TypeSerializerSnapshot] operator[SEP] identifier[readVersionedSnapshot] operator[SEP] identifier[in] , identifier[cl] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[NestedSerializersSnapshotDelegate] operator[SEP] identifier[nestedSnapshots] operator[SEP] operator[SEP] }
public DynaFormLabel addLabel(final String value, final boolean escape, final int colspan, final int rowspan) { final DynaFormLabel dynaFormLabel = new DynaFormLabel(value, escape, colspan, rowspan, row, elements.size() + 1, extended); elements.add(dynaFormLabel); dynaFormModel.getLabels().add(dynaFormLabel); totalColspan = totalColspan + colspan; return dynaFormLabel; }
class class_name[name] begin[{] method[addLabel, return_type[type[DynaFormLabel]], modifier[public], parameter[value, escape, colspan, rowspan]] begin[{] local_variable[type[DynaFormLabel], dynaFormLabel] call[elements.add, parameter[member[.dynaFormLabel]]] call[dynaFormModel.getLabels, parameter[]] assign[member[.totalColspan], binary_operation[member[.totalColspan], +, member[.colspan]]] return[member[.dynaFormLabel]] end[}] END[}]
Keyword[public] identifier[DynaFormLabel] identifier[addLabel] operator[SEP] Keyword[final] identifier[String] identifier[value] , Keyword[final] Keyword[boolean] identifier[escape] , Keyword[final] Keyword[int] identifier[colspan] , Keyword[final] Keyword[int] identifier[rowspan] operator[SEP] { Keyword[final] identifier[DynaFormLabel] identifier[dynaFormLabel] operator[=] Keyword[new] identifier[DynaFormLabel] operator[SEP] identifier[value] , identifier[escape] , identifier[colspan] , identifier[rowspan] , identifier[row] , identifier[elements] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] Other[1] , identifier[extended] operator[SEP] operator[SEP] identifier[elements] operator[SEP] identifier[add] operator[SEP] identifier[dynaFormLabel] operator[SEP] operator[SEP] identifier[dynaFormModel] operator[SEP] identifier[getLabels] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[dynaFormLabel] operator[SEP] operator[SEP] identifier[totalColspan] operator[=] identifier[totalColspan] operator[+] identifier[colspan] operator[SEP] Keyword[return] identifier[dynaFormLabel] operator[SEP] }
public GatewayRouteListResultInner beginGetAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) { return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().single().body(); }
class class_name[name] begin[{] method[beginGetAdvertisedRoutes, return_type[type[GatewayRouteListResultInner]], modifier[public], parameter[resourceGroupName, virtualNetworkGatewayName, peer]] begin[{] return[call[.beginGetAdvertisedRoutesWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.virtualNetworkGatewayName], member[.peer]]]] end[}] END[}]
Keyword[public] identifier[GatewayRouteListResultInner] identifier[beginGetAdvertisedRoutes] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[virtualNetworkGatewayName] , identifier[String] identifier[peer] operator[SEP] { Keyword[return] identifier[beginGetAdvertisedRoutesWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[virtualNetworkGatewayName] , identifier[peer] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public Observable<DatabaseVulnerabilityAssessmentRuleBaselineInner> createOrUpdateAsync(String resourceGroupName, String managedInstanceName, String databaseName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, List<DatabaseVulnerabilityAssessmentRuleBaselineItem> baselineResults) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, ruleId, baselineName, baselineResults).map(new Func1<ServiceResponse<DatabaseVulnerabilityAssessmentRuleBaselineInner>, DatabaseVulnerabilityAssessmentRuleBaselineInner>() { @Override public DatabaseVulnerabilityAssessmentRuleBaselineInner call(ServiceResponse<DatabaseVulnerabilityAssessmentRuleBaselineInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[createOrUpdateAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, managedInstanceName, databaseName, ruleId, baselineName, baselineResults]] begin[{] return[call[.createOrUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.managedInstanceName], member[.databaseName], member[.ruleId], member[.baselineName], member[.baselineResults]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[DatabaseVulnerabilityAssessmentRuleBaselineInner] operator[>] identifier[createOrUpdateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[managedInstanceName] , identifier[String] identifier[databaseName] , identifier[String] identifier[ruleId] , identifier[VulnerabilityAssessmentPolicyBaselineName] identifier[baselineName] , identifier[List] operator[<] identifier[DatabaseVulnerabilityAssessmentRuleBaselineItem] operator[>] identifier[baselineResults] operator[SEP] { Keyword[return] identifier[createOrUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[managedInstanceName] , identifier[databaseName] , identifier[ruleId] , identifier[baselineName] , identifier[baselineResults] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[DatabaseVulnerabilityAssessmentRuleBaselineInner] operator[>] , identifier[DatabaseVulnerabilityAssessmentRuleBaselineInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[DatabaseVulnerabilityAssessmentRuleBaselineInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[DatabaseVulnerabilityAssessmentRuleBaselineInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
String createQuery(CouchDBQueryInterpreter interpreter, EntityMetadata m, StringBuilder q, String _id) throws URISyntaxException, UnsupportedEncodingException, IOException, ClientProtocolException { if (interpreter.isAggregation()) { _id = CouchDBConstants.URL_SEPARATOR + m.getSchema().toLowerCase() + CouchDBConstants.URL_SEPARATOR + CouchDBConstants.DESIGN + CouchDBConstants.AGGREGATIONS + CouchDBConstants.VIEW + interpreter.getAggregationType(); if (interpreter.getAggregationColumn() != null) { q.append("key="); q.append("\"" + interpreter.getAggregationColumn() + "_" + m.getTableName() + "\""); } else { q.append("key=" + "\"" + CouchDBConstants.ALL + "_" + m.getTableName() + "\""); } q.append("&group=true"); } else if (!interpreter.isRangeQuery() && interpreter.getOperator() != null && interpreter.getOperator().equalsIgnoreCase("AND")) { StringBuilder viewName = new StringBuilder(); List<String> columns = new ArrayList<String>(); q.append("key=["); for (String columnName : interpreter.getKeyValues().keySet()) { viewName.append(columnName + "AND"); q.append(CouchDBUtils.appendQuotes(interpreter.getKeyValues().get(columnName))); q.append(","); columns.add(columnName); } q.deleteCharAt(q.toString().lastIndexOf(",")); q.append("]"); viewName.delete(viewName.toString().lastIndexOf("AND"), viewName.toString().lastIndexOf("AND") + 3); _id = _id + viewName.toString(); CouchDBUtils.createDesignDocumentIfNotExist(httpClient, httpHost, gson, m.getTableName(), m.getSchema(), viewName.toString(), columns); } else if (interpreter.getKeyValues() != null) { if (interpreter.getStartKeyValue() != null || interpreter.getEndKeyValue() != null) { String queryString = null; if (interpreter.getStartKeyValue() != null) { queryString = "startkey=" + CouchDBUtils.appendQuotes(interpreter.getStartKeyValue()); q.append(queryString); } if (interpreter.getEndKeyValue() != null) { if (interpreter.getStartKeyValue() != null) { q.append("&"); } queryString = "endkey=" + CouchDBUtils.appendQuotes(interpreter.getEndKeyValue()); q.append(queryString); if (interpreter.isIncludeLastKey()) { q.append("&inclusive_end="); q.append(true); } } } else if (interpreter.getKeyValue() != null) { q.append("key=" + CouchDBUtils.appendQuotes(interpreter.getKeyValue())); } _id = _id + interpreter.getKeyName(); } else if (interpreter.getColumns() != null && interpreter.getColumns().length != 0) { _id += CouchDBConstants.FIELDS; q.append("keys=["); for (String column : interpreter.getColumns()) { q.append("\"" + column + "\","); } q.setCharAt(q.length() - 1, ']'); } else { _id = _id + "all"; } return _id; }
class class_name[name] begin[{] method[createQuery, return_type[type[String]], modifier[default], parameter[interpreter, m, q, _id]] begin[{] if[call[interpreter.isAggregation, parameter[]]] begin[{] assign[member[._id], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[CouchDBConstants.URL_SEPARATOR], +, call[m.getSchema, parameter[]]], +, member[CouchDBConstants.URL_SEPARATOR]], +, member[CouchDBConstants.DESIGN]], +, member[CouchDBConstants.AGGREGATIONS]], +, member[CouchDBConstants.VIEW]], +, call[interpreter.getAggregationType, parameter[]]]] if[binary_operation[call[interpreter.getAggregationColumn, parameter[]], !=, literal[null]]] begin[{] call[q.append, parameter[literal["key="]]] call[q.append, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["\""], +, call[interpreter.getAggregationColumn, parameter[]]], +, literal["_"]], +, call[m.getTableName, parameter[]]], +, literal["\""]]]] else begin[{] call[q.append, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["key="], +, literal["\""]], +, member[CouchDBConstants.ALL]], +, literal["_"]], +, call[m.getTableName, parameter[]]], +, literal["\""]]]] end[}] call[q.append, parameter[literal["&group=true"]]] else begin[{] if[binary_operation[binary_operation[call[interpreter.isRangeQuery, parameter[]], &&, binary_operation[call[interpreter.getOperator, parameter[]], !=, literal[null]]], &&, call[interpreter.getOperator, parameter[]]]] begin[{] local_variable[type[StringBuilder], viewName] local_variable[type[List], columns] call[q.append, parameter[literal["key=["]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AND"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=viewName, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKeyValues, postfix_operators=[], prefix_operators=[], qualifier=interpreter, selectors=[MethodInvocation(arguments=[MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=appendQuotes, postfix_operators=[], prefix_operators=[], qualifier=CouchDBUtils, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=q, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=append, postfix_operators=[], prefix_operators=[], qualifier=q, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getKeyValues, postfix_operators=[], prefix_operators=[], qualifier=interpreter, selectors=[MethodInvocation(arguments=[], member=keySet, 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=columnName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[q.deleteCharAt, parameter[call[q.toString, parameter[]]]] call[q.append, parameter[literal["]"]]] call[viewName.delete, parameter[call[viewName.toString, parameter[]], binary_operation[call[viewName.toString, parameter[]], +, literal[3]]]] assign[member[._id], binary_operation[member[._id], +, call[viewName.toString, parameter[]]]] call[CouchDBUtils.createDesignDocumentIfNotExist, parameter[member[.httpClient], member[.httpHost], member[.gson], call[m.getTableName, parameter[]], call[m.getSchema, parameter[]], call[viewName.toString, parameter[]], member[.columns]]] else begin[{] if[binary_operation[call[interpreter.getKeyValues, parameter[]], !=, literal[null]]] begin[{] if[binary_operation[binary_operation[call[interpreter.getStartKeyValue, parameter[]], !=, literal[null]], ||, binary_operation[call[interpreter.getEndKeyValue, parameter[]], !=, literal[null]]]] begin[{] local_variable[type[String], queryString] if[binary_operation[call[interpreter.getStartKeyValue, parameter[]], !=, literal[null]]] begin[{] assign[member[.queryString], binary_operation[literal["startkey="], +, call[CouchDBUtils.appendQuotes, parameter[call[interpreter.getStartKeyValue, parameter[]]]]]] call[q.append, parameter[member[.queryString]]] else begin[{] None end[}] if[binary_operation[call[interpreter.getEndKeyValue, parameter[]], !=, literal[null]]] begin[{] if[binary_operation[call[interpreter.getStartKeyValue, parameter[]], !=, literal[null]]] begin[{] call[q.append, parameter[literal["&"]]] else begin[{] None end[}] assign[member[.queryString], binary_operation[literal["endkey="], +, call[CouchDBUtils.appendQuotes, parameter[call[interpreter.getEndKeyValue, parameter[]]]]]] call[q.append, parameter[member[.queryString]]] if[call[interpreter.isIncludeLastKey, parameter[]]] begin[{] call[q.append, parameter[literal["&inclusive_end="]]] call[q.append, parameter[literal[true]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] if[binary_operation[call[interpreter.getKeyValue, parameter[]], !=, literal[null]]] begin[{] call[q.append, parameter[binary_operation[literal["key="], +, call[CouchDBUtils.appendQuotes, parameter[call[interpreter.getKeyValue, parameter[]]]]]]] else begin[{] None end[}] end[}] assign[member[._id], binary_operation[member[._id], +, call[interpreter.getKeyName, parameter[]]]] else begin[{] if[binary_operation[binary_operation[call[interpreter.getColumns, parameter[]], !=, literal[null]], &&, binary_operation[call[interpreter.getColumns, parameter[]], !=, literal[0]]]] begin[{] assign[member[._id], member[CouchDBConstants.FIELDS]] call[q.append, parameter[literal["keys=["]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operandr=MemberReference(member=column, 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=q, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=interpreter, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=column)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[q.setCharAt, parameter[binary_operation[call[q.length, parameter[]], -, literal[1]], literal[']']]] else begin[{] assign[member[._id], binary_operation[member[._id], +, literal["all"]]] end[}] end[}] end[}] end[}] return[member[._id]] end[}] END[}]
identifier[String] identifier[createQuery] operator[SEP] identifier[CouchDBQueryInterpreter] identifier[interpreter] , identifier[EntityMetadata] identifier[m] , identifier[StringBuilder] identifier[q] , identifier[String] identifier[_id] operator[SEP] Keyword[throws] identifier[URISyntaxException] , identifier[UnsupportedEncodingException] , identifier[IOException] , identifier[ClientProtocolException] { Keyword[if] operator[SEP] identifier[interpreter] operator[SEP] identifier[isAggregation] operator[SEP] operator[SEP] operator[SEP] { identifier[_id] operator[=] identifier[CouchDBConstants] operator[SEP] identifier[URL_SEPARATOR] operator[+] identifier[m] operator[SEP] identifier[getSchema] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[+] identifier[CouchDBConstants] operator[SEP] identifier[URL_SEPARATOR] operator[+] identifier[CouchDBConstants] operator[SEP] identifier[DESIGN] operator[+] identifier[CouchDBConstants] operator[SEP] identifier[AGGREGATIONS] operator[+] identifier[CouchDBConstants] operator[SEP] identifier[VIEW] operator[+] identifier[interpreter] operator[SEP] identifier[getAggregationType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[interpreter] operator[SEP] identifier[getAggregationColumn] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[interpreter] operator[SEP] identifier[getAggregationColumn] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[m] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[CouchDBConstants] operator[SEP] identifier[ALL] operator[+] literal[String] operator[+] identifier[m] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[interpreter] operator[SEP] identifier[isRangeQuery] operator[SEP] operator[SEP] operator[&&] identifier[interpreter] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[interpreter] operator[SEP] identifier[getOperator] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[StringBuilder] identifier[viewName] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[columns] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[columnName] operator[:] identifier[interpreter] operator[SEP] identifier[getKeyValues] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[viewName] operator[SEP] identifier[append] operator[SEP] identifier[columnName] operator[+] literal[String] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[append] operator[SEP] identifier[CouchDBUtils] operator[SEP] identifier[appendQuotes] operator[SEP] identifier[interpreter] operator[SEP] identifier[getKeyValues] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[columns] operator[SEP] identifier[add] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] } identifier[q] operator[SEP] identifier[deleteCharAt] operator[SEP] identifier[q] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[viewName] operator[SEP] identifier[delete] operator[SEP] identifier[viewName] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] , identifier[viewName] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[3] operator[SEP] operator[SEP] identifier[_id] operator[=] identifier[_id] operator[+] identifier[viewName] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[CouchDBUtils] operator[SEP] identifier[createDesignDocumentIfNotExist] operator[SEP] identifier[httpClient] , identifier[httpHost] , identifier[gson] , identifier[m] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] , identifier[m] operator[SEP] identifier[getSchema] operator[SEP] operator[SEP] , identifier[viewName] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[columns] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[interpreter] operator[SEP] identifier[getKeyValues] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[interpreter] operator[SEP] identifier[getStartKeyValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[||] identifier[interpreter] operator[SEP] identifier[getEndKeyValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[queryString] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[interpreter] operator[SEP] identifier[getStartKeyValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[queryString] operator[=] literal[String] operator[+] identifier[CouchDBUtils] operator[SEP] identifier[appendQuotes] operator[SEP] identifier[interpreter] operator[SEP] identifier[getStartKeyValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[append] operator[SEP] identifier[queryString] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[interpreter] operator[SEP] identifier[getEndKeyValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[interpreter] operator[SEP] identifier[getStartKeyValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[queryString] operator[=] literal[String] operator[+] identifier[CouchDBUtils] operator[SEP] identifier[appendQuotes] operator[SEP] identifier[interpreter] operator[SEP] identifier[getEndKeyValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[append] operator[SEP] identifier[queryString] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[interpreter] operator[SEP] identifier[isIncludeLastKey] operator[SEP] operator[SEP] operator[SEP] { identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[append] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[interpreter] operator[SEP] identifier[getKeyValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[CouchDBUtils] operator[SEP] identifier[appendQuotes] operator[SEP] identifier[interpreter] operator[SEP] identifier[getKeyValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[_id] operator[=] identifier[_id] operator[+] identifier[interpreter] operator[SEP] identifier[getKeyName] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[interpreter] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[interpreter] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] { identifier[_id] operator[+=] identifier[CouchDBConstants] operator[SEP] identifier[FIELDS] operator[SEP] identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[column] operator[:] identifier[interpreter] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] { identifier[q] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[column] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[q] operator[SEP] identifier[setCharAt] operator[SEP] identifier[q] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[_id] operator[=] identifier[_id] operator[+] literal[String] operator[SEP] } Keyword[return] identifier[_id] operator[SEP] }
public void virtualNumbers_number_serviceInfos_PUT(String number, OvhService body) throws IOException { String qPath = "/sms/virtualNumbers/{number}/serviceInfos"; StringBuilder sb = path(qPath, number); exec(qPath, "PUT", sb.toString(), body); }
class class_name[name] begin[{] method[virtualNumbers_number_serviceInfos_PUT, return_type[void], modifier[public], parameter[number, body]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] call[.exec, parameter[member[.qPath], literal["PUT"], call[sb.toString, parameter[]], member[.body]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[virtualNumbers_number_serviceInfos_PUT] operator[SEP] identifier[String] identifier[number] , identifier[OvhService] identifier[body] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[number] operator[SEP] operator[SEP] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[body] operator[SEP] operator[SEP] }
public static <U, R> Flowable<R> multicastSelector( final Callable<? extends ConnectableFlowable<U>> connectableFactory, final Function<? super Flowable<U>, ? extends Publisher<R>> selector) { return new MulticastFlowable<R, U>(connectableFactory, selector); }
class class_name[name] begin[{] method[multicastSelector, return_type[type[Flowable]], modifier[public static], parameter[connectableFactory, selector]] begin[{] return[ClassCreator(arguments=[MemberReference(member=connectableFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=selector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None))], dimensions=None, name=MulticastFlowable, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[U] , identifier[R] operator[>] identifier[Flowable] operator[<] identifier[R] operator[>] identifier[multicastSelector] operator[SEP] Keyword[final] identifier[Callable] operator[<] operator[?] Keyword[extends] identifier[ConnectableFlowable] operator[<] identifier[U] operator[>] operator[>] identifier[connectableFactory] , Keyword[final] identifier[Function] operator[<] operator[?] Keyword[super] identifier[Flowable] operator[<] identifier[U] operator[>] , operator[?] Keyword[extends] identifier[Publisher] operator[<] identifier[R] operator[>] operator[>] identifier[selector] operator[SEP] { Keyword[return] Keyword[new] identifier[MulticastFlowable] operator[<] identifier[R] , identifier[U] operator[>] operator[SEP] identifier[connectableFactory] , identifier[selector] operator[SEP] operator[SEP] }
@Override public HashIntSet convert(Collection<Integer> c) { HashIntSet res = new HashIntSet((int) (c.size() / LOAD_FACTOR) + 1); for (int e : c) { res.add(e); } return res; }
class class_name[name] begin[{] method[convert, return_type[type[HashIntSet]], modifier[public], parameter[c]] begin[{] local_variable[type[HashIntSet], res] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None) return[member[.res]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[HashIntSet] identifier[convert] operator[SEP] identifier[Collection] operator[<] identifier[Integer] operator[>] identifier[c] operator[SEP] { identifier[HashIntSet] identifier[res] operator[=] Keyword[new] identifier[HashIntSet] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] identifier[LOAD_FACTOR] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[e] operator[:] identifier[c] operator[SEP] { identifier[res] operator[SEP] identifier[add] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[res] operator[SEP] }
private static void applyStyle(TextView v, AttributeSet attrs, int defStyleAttr, int defStyleRes){ String fontFamily = null; int typefaceIndex = -1; int styleIndex = -1; int shadowColor = 0; float dx = 0, dy = 0, r = 0; Drawable drawableLeft = null, drawableTop = null, drawableRight = null, drawableBottom = null, drawableStart = null, drawableEnd = null; boolean drawableDefined = false; boolean drawableRelativeDefined = false; /* * Look the appearance up without checking first if it exists because * almost every TextView has one and it greatly simplifies the logic * to be able to parse the appearance first and then let specific tags * for this View override it. */ TypedArray a = v.getContext().obtainStyledAttributes(attrs, R.styleable.TextViewAppearance, defStyleAttr, defStyleRes); TypedArray appearance = null; int ap = a.getResourceId(R.styleable.TextViewAppearance_android_textAppearance, 0); a.recycle(); if (ap != 0) appearance = v.getContext().obtainStyledAttributes(ap, R.styleable.TextAppearance); if (appearance != null) { int n = appearance.getIndexCount(); for (int i = 0; i < n; i++) { int attr = appearance.getIndex(i); if (attr == R.styleable.TextAppearance_android_textColorHighlight) { v.setHighlightColor(appearance.getColor(attr, 0)); } else if (attr == R.styleable.TextAppearance_android_textColor) { v.setTextColor(appearance.getColorStateList(attr)); } else if (attr == R.styleable.TextAppearance_android_textColorHint) { v.setHintTextColor(appearance.getColorStateList(attr)); } else if (attr == R.styleable.TextAppearance_android_textColorLink) { v.setLinkTextColor(appearance.getColorStateList(attr)); } else if (attr == R.styleable.TextAppearance_android_textSize) { v.setTextSize(TypedValue.COMPLEX_UNIT_PX, appearance.getDimensionPixelSize(attr, 0)); } else if (attr == R.styleable.TextAppearance_android_typeface) { typefaceIndex = appearance.getInt(attr, -1); } else if (attr == R.styleable.TextAppearance_android_fontFamily) { fontFamily = appearance.getString(attr); } else if (attr == R.styleable.TextAppearance_tv_fontFamily) { fontFamily = appearance.getString(attr); } else if (attr == R.styleable.TextAppearance_android_textStyle) { styleIndex = appearance.getInt(attr, -1); } else if (attr == R.styleable.TextAppearance_android_textAllCaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) v.setAllCaps(appearance.getBoolean(attr, false)); } else if (attr == R.styleable.TextAppearance_android_shadowColor) { shadowColor = appearance.getInt(attr, 0); } else if (attr == R.styleable.TextAppearance_android_shadowDx) { dx = appearance.getFloat(attr, 0); } else if (attr == R.styleable.TextAppearance_android_shadowDy) { dy = appearance.getFloat(attr, 0); } else if (attr == R.styleable.TextAppearance_android_shadowRadius) { r = appearance.getFloat(attr, 0); } else if (attr == R.styleable.TextAppearance_android_elegantTextHeight) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) v.setElegantTextHeight(appearance.getBoolean(attr, false)); } else if (attr == R.styleable.TextAppearance_android_letterSpacing) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) v.setLetterSpacing(appearance.getFloat(attr, 0)); } else if (attr == R.styleable.TextAppearance_android_fontFeatureSettings) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) v.setFontFeatureSettings(appearance.getString(attr)); } } appearance.recycle(); } a = v.getContext().obtainStyledAttributes(attrs, R.styleable.TextView, defStyleAttr, defStyleRes); int n = a.getIndexCount(); for (int i = 0; i < n; i++) { int attr = a.getIndex(i); if (attr == R.styleable.TextView_android_drawableLeft) { drawableLeft = a.getDrawable(attr); drawableDefined = true; } else if (attr == R.styleable.TextView_android_drawableTop) { drawableTop = a.getDrawable(attr); drawableDefined = true; } else if (attr == R.styleable.TextView_android_drawableRight) { drawableRight = a.getDrawable(attr); drawableDefined = true; } else if (attr == R.styleable.TextView_android_drawableBottom) { drawableBottom = a.getDrawable(attr); drawableDefined = true; } else if (attr == R.styleable.TextView_android_drawableStart) { drawableStart = a.getDrawable(attr); drawableRelativeDefined = true; } else if (attr == R.styleable.TextView_android_drawableEnd) { drawableEnd = a.getDrawable(attr); drawableRelativeDefined = true; } else if (attr == R.styleable.TextView_android_drawablePadding) { v.setCompoundDrawablePadding(a.getDimensionPixelSize(attr, 0)); } else if (attr == R.styleable.TextView_android_maxLines) { v.setMaxLines(a.getInt(attr, -1)); } else if (attr == R.styleable.TextView_android_maxHeight) { v.setMaxHeight(a.getDimensionPixelSize(attr, -1)); } else if (attr == R.styleable.TextView_android_lines) { v.setLines(a.getInt(attr, -1)); } else if (attr == R.styleable.TextView_android_height) { v.setHeight(a.getDimensionPixelSize(attr, -1)); } else if (attr == R.styleable.TextView_android_minLines) { v.setMinLines(a.getInt(attr, -1)); } else if (attr == R.styleable.TextView_android_minHeight) { v.setMinHeight(a.getDimensionPixelSize(attr, -1)); } else if (attr == R.styleable.TextView_android_maxEms) { v.setMaxEms(a.getInt(attr, -1)); } else if (attr == R.styleable.TextView_android_maxWidth) { v.setMaxWidth(a.getDimensionPixelSize(attr, -1)); } else if (attr == R.styleable.TextView_android_ems) { v.setEms(a.getInt(attr, -1)); } else if (attr == R.styleable.TextView_android_width) { v.setWidth(a.getDimensionPixelSize(attr, -1)); } else if (attr == R.styleable.TextView_android_minEms) { v.setMinEms(a.getInt(attr, -1)); } else if (attr == R.styleable.TextView_android_minWidth) { v.setMinWidth(a.getDimensionPixelSize(attr, -1)); } else if (attr == R.styleable.TextView_android_gravity) { v.setGravity(a.getInt(attr, -1)); } else if (attr == R.styleable.TextView_android_scrollHorizontally) { v.setHorizontallyScrolling(a.getBoolean(attr, false)); } else if (attr == R.styleable.TextView_android_includeFontPadding) { v.setIncludeFontPadding(a.getBoolean(attr, true)); } else if (attr == R.styleable.TextView_android_cursorVisible) { v.setCursorVisible(a.getBoolean(attr, true)); } else if (attr == R.styleable.TextView_android_textScaleX) { v.setTextScaleX(a.getFloat(attr, 1.0f)); } else if (attr == R.styleable.TextView_android_shadowColor) { shadowColor = a.getInt(attr, 0); } else if (attr == R.styleable.TextView_android_shadowDx) { dx = a.getFloat(attr, 0); } else if (attr == R.styleable.TextView_android_shadowDy) { dy = a.getFloat(attr, 0); } else if (attr == R.styleable.TextView_android_shadowRadius) { r = a.getFloat(attr, 0); } else if (attr == R.styleable.TextView_android_textColorHighlight) { v.setHighlightColor(a.getColor(attr, 0)); } else if (attr == R.styleable.TextView_android_textColor) { v.setTextColor(a.getColorStateList(attr)); } else if (attr == R.styleable.TextView_android_textColorHint) { v.setHintTextColor(a.getColorStateList(attr)); } else if (attr == R.styleable.TextView_android_textColorLink) { v.setLinkTextColor(a.getColorStateList(attr)); } else if (attr == R.styleable.TextView_android_textSize) { v.setTextSize(TypedValue.COMPLEX_UNIT_PX, a.getDimensionPixelSize(attr, 0)); } else if (attr == R.styleable.TextView_android_typeface) { typefaceIndex = a.getInt(attr, -1); } else if (attr == R.styleable.TextView_android_textStyle) { styleIndex = a.getInt(attr, -1); } else if (attr == R.styleable.TextView_android_fontFamily) { fontFamily = a.getString(attr); } else if (attr == R.styleable.TextView_tv_fontFamily) { fontFamily = a.getString(attr); } else if (attr == R.styleable.TextView_android_textAllCaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) v.setAllCaps(a.getBoolean(attr, false)); } else if (attr == R.styleable.TextView_android_elegantTextHeight) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) v.setElegantTextHeight(a.getBoolean(attr, false)); } else if (attr == R.styleable.TextView_android_letterSpacing) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) v.setLetterSpacing(a.getFloat(attr, 0)); } else if (attr == R.styleable.TextView_android_fontFeatureSettings) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) v.setFontFeatureSettings(a.getString(attr)); } } a.recycle(); if (shadowColor != 0) v.setShadowLayer(r, dx, dy, shadowColor); if(drawableDefined) { Drawable[] drawables = v.getCompoundDrawables(); if (drawableStart != null) drawables[0] = drawableStart; else if (drawableLeft != null) drawables[0] = drawableLeft; if (drawableTop != null) drawables[1] = drawableTop; if (drawableEnd != null) drawables[2] = drawableEnd; else if (drawableRight != null) drawables[2] = drawableRight; if (drawableBottom != null) drawables[3] = drawableBottom; v.setCompoundDrawablesWithIntrinsicBounds(drawables[0], drawables[1], drawables[2], drawables[3]); } if(drawableRelativeDefined && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1){ Drawable[] drawables = v.getCompoundDrawablesRelative(); if (drawableStart != null) drawables[0] = drawableStart; if (drawableEnd != null) drawables[2] = drawableEnd; v.setCompoundDrawablesRelativeWithIntrinsicBounds(drawables[0], drawables[1], drawables[2], drawables[3]); } Typeface tf = null; if (fontFamily != null) { tf = TypefaceUtil.load(v.getContext(), fontFamily, styleIndex); if (tf != null) v.setTypeface(tf); } if(tf != null) { switch (typefaceIndex) { case 1: tf = Typeface.SANS_SERIF; break; case 2: tf = Typeface.SERIF; break; case 3: tf = Typeface.MONOSPACE; break; } v.setTypeface(tf, styleIndex); } if(v instanceof AutoCompleteTextView) applyStyle((AutoCompleteTextView)v, attrs, defStyleAttr, defStyleRes); }
class class_name[name] begin[{] method[applyStyle, return_type[void], modifier[private static], parameter[v, attrs, defStyleAttr, defStyleRes]] begin[{] local_variable[type[String], fontFamily] local_variable[type[int], typefaceIndex] local_variable[type[int], styleIndex] local_variable[type[int], shadowColor] local_variable[type[float], dx] local_variable[type[Drawable], drawableLeft] local_variable[type[boolean], drawableDefined] local_variable[type[boolean], drawableRelativeDefined] local_variable[type[TypedArray], a] local_variable[type[TypedArray], appearance] local_variable[type[int], ap] call[a.recycle, parameter[]] if[binary_operation[member[.ap], !=, literal[0]]] begin[{] assign[member[.appearance], call[v.getContext, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.appearance], !=, literal[null]]] begin[{] local_variable[type[int], n] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None), name=attr)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_textColorHighlight, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_textColor, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_textColorHint, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_textColorLink, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_textSize, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_typeface, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_fontFamily, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_tv_fontFamily, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_textStyle, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_textAllCaps, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_shadowColor, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_shadowDx, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_shadowDy, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_shadowRadius, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_elegantTextHeight, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_letterSpacing, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextAppearance_android_fontFeatureSettings, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SDK_INT, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION, selectors=[]), operandr=MemberReference(member=LOLLIPOP, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION_CODES, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)], member=setFontFeatureSettings, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SDK_INT, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION, selectors=[]), operandr=MemberReference(member=LOLLIPOP, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION_CODES, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)], member=setLetterSpacing, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SDK_INT, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION, selectors=[]), operandr=MemberReference(member=LOLLIPOP, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION_CODES, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)], member=setElegantTextHeight, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shadowColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SDK_INT, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION, selectors=[]), operandr=MemberReference(member=ICE_CREAM_SANDWICH, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION_CODES, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)], member=setAllCaps, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=styleIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fontFamily, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fontFamily, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=typefaceIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMPLEX_UNIT_PX, postfix_operators=[], prefix_operators=[], qualifier=TypedValue, selectors=[]), MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getDimensionPixelSize, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)], member=setTextSize, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColorStateList, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)], member=setLinkTextColor, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColorStateList, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)], member=setHintTextColor, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColorStateList, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)], member=setTextColor, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getColor, postfix_operators=[], prefix_operators=[], qualifier=appearance, selectors=[], type_arguments=None)], member=setHighlightColor, postfix_operators=[], prefix_operators=[], qualifier=v, 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) call[appearance.recycle, parameter[]] else begin[{] None end[}] assign[member[.a], call[v.getContext, parameter[]]] local_variable[type[int], n] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), name=attr)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_drawableLeft, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_drawableTop, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_drawableRight, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_drawableBottom, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_drawableStart, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_drawableEnd, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_drawablePadding, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_maxLines, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_maxHeight, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_lines, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_height, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_minLines, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_minHeight, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_maxEms, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_maxWidth, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_ems, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_width, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_minEms, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_minWidth, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_gravity, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_scrollHorizontally, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_includeFontPadding, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_cursorVisible, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_textScaleX, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_shadowColor, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_shadowDx, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_shadowDy, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_shadowRadius, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_textColorHighlight, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_textColor, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_textColorHint, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_textColorLink, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_textSize, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_typeface, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_textStyle, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_fontFamily, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_tv_fontFamily, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_textAllCaps, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_elegantTextHeight, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_letterSpacing, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TextView_android_fontFeatureSettings, postfix_operators=[], prefix_operators=[], qualifier=R.styleable, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SDK_INT, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION, selectors=[]), operandr=MemberReference(member=LOLLIPOP, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION_CODES, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setFontFeatureSettings, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SDK_INT, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION, selectors=[]), operandr=MemberReference(member=LOLLIPOP, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION_CODES, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setLetterSpacing, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SDK_INT, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION, selectors=[]), operandr=MemberReference(member=LOLLIPOP, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION_CODES, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setElegantTextHeight, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SDK_INT, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION, selectors=[]), operandr=MemberReference(member=ICE_CREAM_SANDWICH, postfix_operators=[], prefix_operators=[], qualifier=Build.VERSION_CODES, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setAllCaps, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fontFamily, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fontFamily, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=styleIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=typefaceIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMPLEX_UNIT_PX, postfix_operators=[], prefix_operators=[], qualifier=TypedValue, selectors=[]), MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getDimensionPixelSize, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setTextSize, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColorStateList, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setLinkTextColor, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColorStateList, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setHintTextColor, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColorStateList, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setTextColor, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getColor, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setHighlightColor, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shadowColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0f)], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setTextScaleX, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setCursorVisible, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setIncludeFontPadding, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setHorizontallyScrolling, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setGravity, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getDimensionPixelSize, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setMinWidth, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setMinEms, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getDimensionPixelSize, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setWidth, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setEms, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getDimensionPixelSize, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setMaxWidth, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setMaxEms, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getDimensionPixelSize, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setMinHeight, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setMinLines, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getDimensionPixelSize, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setHeight, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setLines, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getDimensionPixelSize, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setMaxHeight, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setMaxLines, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getDimensionPixelSize, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=setCompoundDrawablePadding, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDrawable, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableRelativeDefined, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDrawable, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableRelativeDefined, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableBottom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDrawable, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableDefined, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableRight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDrawable, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableDefined, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableTop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDrawable, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableDefined, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDrawable, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=drawableDefined, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), 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) call[a.recycle, parameter[]] if[binary_operation[member[.shadowColor], !=, literal[0]]] begin[{] call[v.setShadowLayer, parameter[member[.r], member[.dx], member[.dy], member[.shadowColor]]] else begin[{] None end[}] if[member[.drawableDefined]] begin[{] local_variable[type[Drawable], drawables] if[binary_operation[member[.drawableStart], !=, literal[null]]] begin[{] assign[member[.drawables], member[.drawableStart]] else begin[{] if[binary_operation[member[.drawableLeft], !=, literal[null]]] begin[{] assign[member[.drawables], member[.drawableLeft]] else begin[{] None end[}] end[}] if[binary_operation[member[.drawableTop], !=, literal[null]]] begin[{] assign[member[.drawables], member[.drawableTop]] else begin[{] None end[}] if[binary_operation[member[.drawableEnd], !=, literal[null]]] begin[{] assign[member[.drawables], member[.drawableEnd]] else begin[{] if[binary_operation[member[.drawableRight], !=, literal[null]]] begin[{] assign[member[.drawables], member[.drawableRight]] else begin[{] None end[}] end[}] if[binary_operation[member[.drawableBottom], !=, literal[null]]] begin[{] assign[member[.drawables], member[.drawableBottom]] else begin[{] None end[}] call[v.setCompoundDrawablesWithIntrinsicBounds, parameter[member[.drawables], member[.drawables], member[.drawables], member[.drawables]]] else begin[{] None end[}] if[binary_operation[member[.drawableRelativeDefined], &&, binary_operation[member[Build.VERSION.SDK_INT], >=, member[Build.VERSION_CODES.JELLY_BEAN_MR1]]]] begin[{] local_variable[type[Drawable], drawables] if[binary_operation[member[.drawableStart], !=, literal[null]]] begin[{] assign[member[.drawables], member[.drawableStart]] else begin[{] None end[}] if[binary_operation[member[.drawableEnd], !=, literal[null]]] begin[{] assign[member[.drawables], member[.drawableEnd]] else begin[{] None end[}] call[v.setCompoundDrawablesRelativeWithIntrinsicBounds, parameter[member[.drawables], member[.drawables], member[.drawables], member[.drawables]]] else begin[{] None end[}] local_variable[type[Typeface], tf] if[binary_operation[member[.fontFamily], !=, literal[null]]] begin[{] assign[member[.tf], call[TypefaceUtil.load, parameter[call[v.getContext, parameter[]], member[.fontFamily], member[.styleIndex]]]] if[binary_operation[member[.tf], !=, literal[null]]] begin[{] call[v.setTypeface, parameter[member[.tf]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.tf], !=, literal[null]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=SANS_SERIF, postfix_operators=[], prefix_operators=[], qualifier=Typeface, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=SERIF, postfix_operators=[], prefix_operators=[], qualifier=Typeface, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=MONOSPACE, postfix_operators=[], prefix_operators=[], qualifier=Typeface, selectors=[])), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=typefaceIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) call[v.setTypeface, parameter[member[.tf], member[.styleIndex]]] else begin[{] None end[}] if[binary_operation[member[.v], instanceof, type[AutoCompleteTextView]]] begin[{] call[.applyStyle, parameter[Cast(expression=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AutoCompleteTextView, sub_type=None)), member[.attrs], member[.defStyleAttr], member[.defStyleRes]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[applyStyle] operator[SEP] identifier[TextView] identifier[v] , identifier[AttributeSet] identifier[attrs] , Keyword[int] identifier[defStyleAttr] , Keyword[int] identifier[defStyleRes] operator[SEP] { identifier[String] identifier[fontFamily] operator[=] Other[null] operator[SEP] Keyword[int] identifier[typefaceIndex] operator[=] operator[-] Other[1] operator[SEP] Keyword[int] identifier[styleIndex] operator[=] operator[-] Other[1] operator[SEP] Keyword[int] identifier[shadowColor] operator[=] Other[0] operator[SEP] Keyword[float] identifier[dx] operator[=] Other[0] , identifier[dy] operator[=] Other[0] , identifier[r] operator[=] Other[0] operator[SEP] identifier[Drawable] identifier[drawableLeft] operator[=] Other[null] , identifier[drawableTop] operator[=] Other[null] , identifier[drawableRight] operator[=] Other[null] , identifier[drawableBottom] operator[=] Other[null] , identifier[drawableStart] operator[=] Other[null] , identifier[drawableEnd] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[drawableDefined] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[drawableRelativeDefined] operator[=] literal[boolean] operator[SEP] identifier[TypedArray] identifier[a] operator[=] identifier[v] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[obtainStyledAttributes] operator[SEP] identifier[attrs] , identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextViewAppearance] , identifier[defStyleAttr] , identifier[defStyleRes] operator[SEP] operator[SEP] identifier[TypedArray] identifier[appearance] operator[=] Other[null] operator[SEP] Keyword[int] identifier[ap] operator[=] identifier[a] operator[SEP] identifier[getResourceId] operator[SEP] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextViewAppearance_android_textAppearance] , Other[0] operator[SEP] operator[SEP] identifier[a] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ap] operator[!=] Other[0] operator[SEP] identifier[appearance] operator[=] identifier[v] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[obtainStyledAttributes] operator[SEP] identifier[ap] , identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[appearance] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[n] operator[=] identifier[appearance] operator[SEP] identifier[getIndexCount] operator[SEP] operator[SEP] 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] { Keyword[int] identifier[attr] operator[=] identifier[appearance] operator[SEP] identifier[getIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_textColorHighlight] operator[SEP] { identifier[v] operator[SEP] identifier[setHighlightColor] operator[SEP] identifier[appearance] operator[SEP] identifier[getColor] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_textColor] operator[SEP] { identifier[v] operator[SEP] identifier[setTextColor] operator[SEP] identifier[appearance] operator[SEP] identifier[getColorStateList] operator[SEP] identifier[attr] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_textColorHint] operator[SEP] { identifier[v] operator[SEP] identifier[setHintTextColor] operator[SEP] identifier[appearance] operator[SEP] identifier[getColorStateList] operator[SEP] identifier[attr] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_textColorLink] operator[SEP] { identifier[v] operator[SEP] identifier[setLinkTextColor] operator[SEP] identifier[appearance] operator[SEP] identifier[getColorStateList] operator[SEP] identifier[attr] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_textSize] operator[SEP] { identifier[v] operator[SEP] identifier[setTextSize] operator[SEP] identifier[TypedValue] operator[SEP] identifier[COMPLEX_UNIT_PX] , identifier[appearance] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_typeface] operator[SEP] { identifier[typefaceIndex] operator[=] identifier[appearance] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_fontFamily] operator[SEP] { identifier[fontFamily] operator[=] identifier[appearance] operator[SEP] identifier[getString] operator[SEP] identifier[attr] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_tv_fontFamily] operator[SEP] { identifier[fontFamily] operator[=] identifier[appearance] operator[SEP] identifier[getString] operator[SEP] identifier[attr] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_textStyle] operator[SEP] { identifier[styleIndex] operator[=] identifier[appearance] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_textAllCaps] operator[SEP] { Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[ICE_CREAM_SANDWICH] operator[SEP] identifier[v] operator[SEP] identifier[setAllCaps] operator[SEP] identifier[appearance] operator[SEP] identifier[getBoolean] operator[SEP] identifier[attr] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_shadowColor] operator[SEP] { identifier[shadowColor] operator[=] identifier[appearance] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_shadowDx] operator[SEP] { identifier[dx] operator[=] identifier[appearance] operator[SEP] identifier[getFloat] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_shadowDy] operator[SEP] { identifier[dy] operator[=] identifier[appearance] operator[SEP] identifier[getFloat] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_shadowRadius] operator[SEP] { identifier[r] operator[=] identifier[appearance] operator[SEP] identifier[getFloat] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_elegantTextHeight] operator[SEP] { Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[LOLLIPOP] operator[SEP] identifier[v] operator[SEP] identifier[setElegantTextHeight] operator[SEP] identifier[appearance] operator[SEP] identifier[getBoolean] operator[SEP] identifier[attr] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_letterSpacing] operator[SEP] { Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[LOLLIPOP] operator[SEP] identifier[v] operator[SEP] identifier[setLetterSpacing] operator[SEP] identifier[appearance] operator[SEP] identifier[getFloat] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextAppearance_android_fontFeatureSettings] operator[SEP] { Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[LOLLIPOP] operator[SEP] identifier[v] operator[SEP] identifier[setFontFeatureSettings] operator[SEP] identifier[appearance] operator[SEP] identifier[getString] operator[SEP] identifier[attr] operator[SEP] operator[SEP] operator[SEP] } } identifier[appearance] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP] } identifier[a] operator[=] identifier[v] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[obtainStyledAttributes] operator[SEP] identifier[attrs] , identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView] , identifier[defStyleAttr] , identifier[defStyleRes] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[=] identifier[a] operator[SEP] identifier[getIndexCount] operator[SEP] operator[SEP] 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] { Keyword[int] identifier[attr] operator[=] identifier[a] operator[SEP] identifier[getIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_drawableLeft] operator[SEP] { identifier[drawableLeft] operator[=] identifier[a] operator[SEP] identifier[getDrawable] operator[SEP] identifier[attr] operator[SEP] operator[SEP] identifier[drawableDefined] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_drawableTop] operator[SEP] { identifier[drawableTop] operator[=] identifier[a] operator[SEP] identifier[getDrawable] operator[SEP] identifier[attr] operator[SEP] operator[SEP] identifier[drawableDefined] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_drawableRight] operator[SEP] { identifier[drawableRight] operator[=] identifier[a] operator[SEP] identifier[getDrawable] operator[SEP] identifier[attr] operator[SEP] operator[SEP] identifier[drawableDefined] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_drawableBottom] operator[SEP] { identifier[drawableBottom] operator[=] identifier[a] operator[SEP] identifier[getDrawable] operator[SEP] identifier[attr] operator[SEP] operator[SEP] identifier[drawableDefined] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_drawableStart] operator[SEP] { identifier[drawableStart] operator[=] identifier[a] operator[SEP] identifier[getDrawable] operator[SEP] identifier[attr] operator[SEP] operator[SEP] identifier[drawableRelativeDefined] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_drawableEnd] operator[SEP] { identifier[drawableEnd] operator[=] identifier[a] operator[SEP] identifier[getDrawable] operator[SEP] identifier[attr] operator[SEP] operator[SEP] identifier[drawableRelativeDefined] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_drawablePadding] operator[SEP] { identifier[v] operator[SEP] identifier[setCompoundDrawablePadding] operator[SEP] identifier[a] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_maxLines] operator[SEP] { identifier[v] operator[SEP] identifier[setMaxLines] operator[SEP] identifier[a] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_maxHeight] operator[SEP] { identifier[v] operator[SEP] identifier[setMaxHeight] operator[SEP] identifier[a] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_lines] operator[SEP] { identifier[v] operator[SEP] identifier[setLines] operator[SEP] identifier[a] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_height] operator[SEP] { identifier[v] operator[SEP] identifier[setHeight] operator[SEP] identifier[a] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_minLines] operator[SEP] { identifier[v] operator[SEP] identifier[setMinLines] operator[SEP] identifier[a] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_minHeight] operator[SEP] { identifier[v] operator[SEP] identifier[setMinHeight] operator[SEP] identifier[a] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_maxEms] operator[SEP] { identifier[v] operator[SEP] identifier[setMaxEms] operator[SEP] identifier[a] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_maxWidth] operator[SEP] { identifier[v] operator[SEP] identifier[setMaxWidth] operator[SEP] identifier[a] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_ems] operator[SEP] { identifier[v] operator[SEP] identifier[setEms] operator[SEP] identifier[a] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_width] operator[SEP] { identifier[v] operator[SEP] identifier[setWidth] operator[SEP] identifier[a] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_minEms] operator[SEP] { identifier[v] operator[SEP] identifier[setMinEms] operator[SEP] identifier[a] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_minWidth] operator[SEP] { identifier[v] operator[SEP] identifier[setMinWidth] operator[SEP] identifier[a] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_gravity] operator[SEP] { identifier[v] operator[SEP] identifier[setGravity] operator[SEP] identifier[a] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_scrollHorizontally] operator[SEP] { identifier[v] operator[SEP] identifier[setHorizontallyScrolling] operator[SEP] identifier[a] operator[SEP] identifier[getBoolean] operator[SEP] identifier[attr] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_includeFontPadding] operator[SEP] { identifier[v] operator[SEP] identifier[setIncludeFontPadding] operator[SEP] identifier[a] operator[SEP] identifier[getBoolean] operator[SEP] identifier[attr] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_cursorVisible] operator[SEP] { identifier[v] operator[SEP] identifier[setCursorVisible] operator[SEP] identifier[a] operator[SEP] identifier[getBoolean] operator[SEP] identifier[attr] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_textScaleX] operator[SEP] { identifier[v] operator[SEP] identifier[setTextScaleX] operator[SEP] identifier[a] operator[SEP] identifier[getFloat] operator[SEP] identifier[attr] , literal[Float] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_shadowColor] operator[SEP] { identifier[shadowColor] operator[=] identifier[a] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_shadowDx] operator[SEP] { identifier[dx] operator[=] identifier[a] operator[SEP] identifier[getFloat] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_shadowDy] operator[SEP] { identifier[dy] operator[=] identifier[a] operator[SEP] identifier[getFloat] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_shadowRadius] operator[SEP] { identifier[r] operator[=] identifier[a] operator[SEP] identifier[getFloat] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_textColorHighlight] operator[SEP] { identifier[v] operator[SEP] identifier[setHighlightColor] operator[SEP] identifier[a] operator[SEP] identifier[getColor] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_textColor] operator[SEP] { identifier[v] operator[SEP] identifier[setTextColor] operator[SEP] identifier[a] operator[SEP] identifier[getColorStateList] operator[SEP] identifier[attr] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_textColorHint] operator[SEP] { identifier[v] operator[SEP] identifier[setHintTextColor] operator[SEP] identifier[a] operator[SEP] identifier[getColorStateList] operator[SEP] identifier[attr] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_textColorLink] operator[SEP] { identifier[v] operator[SEP] identifier[setLinkTextColor] operator[SEP] identifier[a] operator[SEP] identifier[getColorStateList] operator[SEP] identifier[attr] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_textSize] operator[SEP] { identifier[v] operator[SEP] identifier[setTextSize] operator[SEP] identifier[TypedValue] operator[SEP] identifier[COMPLEX_UNIT_PX] , identifier[a] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_typeface] operator[SEP] { identifier[typefaceIndex] operator[=] identifier[a] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_textStyle] operator[SEP] { identifier[styleIndex] operator[=] identifier[a] operator[SEP] identifier[getInt] operator[SEP] identifier[attr] , operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_fontFamily] operator[SEP] { identifier[fontFamily] operator[=] identifier[a] operator[SEP] identifier[getString] operator[SEP] identifier[attr] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_tv_fontFamily] operator[SEP] { identifier[fontFamily] operator[=] identifier[a] operator[SEP] identifier[getString] operator[SEP] identifier[attr] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_textAllCaps] operator[SEP] { Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[ICE_CREAM_SANDWICH] operator[SEP] identifier[v] operator[SEP] identifier[setAllCaps] operator[SEP] identifier[a] operator[SEP] identifier[getBoolean] operator[SEP] identifier[attr] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_elegantTextHeight] operator[SEP] { Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[LOLLIPOP] operator[SEP] identifier[v] operator[SEP] identifier[setElegantTextHeight] operator[SEP] identifier[a] operator[SEP] identifier[getBoolean] operator[SEP] identifier[attr] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_letterSpacing] operator[SEP] { Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[LOLLIPOP] operator[SEP] identifier[v] operator[SEP] identifier[setLetterSpacing] operator[SEP] identifier[a] operator[SEP] identifier[getFloat] operator[SEP] identifier[attr] , Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[attr] operator[==] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[TextView_android_fontFeatureSettings] operator[SEP] { Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[LOLLIPOP] operator[SEP] identifier[v] operator[SEP] identifier[setFontFeatureSettings] operator[SEP] identifier[a] operator[SEP] identifier[getString] operator[SEP] identifier[attr] operator[SEP] operator[SEP] operator[SEP] } } identifier[a] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[shadowColor] operator[!=] Other[0] operator[SEP] identifier[v] operator[SEP] identifier[setShadowLayer] operator[SEP] identifier[r] , identifier[dx] , identifier[dy] , identifier[shadowColor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[drawableDefined] operator[SEP] { identifier[Drawable] operator[SEP] operator[SEP] identifier[drawables] operator[=] identifier[v] operator[SEP] identifier[getCompoundDrawables] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[drawableStart] operator[!=] Other[null] operator[SEP] identifier[drawables] operator[SEP] Other[0] operator[SEP] operator[=] identifier[drawableStart] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[drawableLeft] operator[!=] Other[null] operator[SEP] identifier[drawables] operator[SEP] Other[0] operator[SEP] operator[=] identifier[drawableLeft] operator[SEP] Keyword[if] operator[SEP] identifier[drawableTop] operator[!=] Other[null] operator[SEP] identifier[drawables] operator[SEP] Other[1] operator[SEP] operator[=] identifier[drawableTop] operator[SEP] Keyword[if] operator[SEP] identifier[drawableEnd] operator[!=] Other[null] operator[SEP] identifier[drawables] operator[SEP] Other[2] operator[SEP] operator[=] identifier[drawableEnd] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[drawableRight] operator[!=] Other[null] operator[SEP] identifier[drawables] operator[SEP] Other[2] operator[SEP] operator[=] identifier[drawableRight] operator[SEP] Keyword[if] operator[SEP] identifier[drawableBottom] operator[!=] Other[null] operator[SEP] identifier[drawables] operator[SEP] Other[3] operator[SEP] operator[=] identifier[drawableBottom] operator[SEP] identifier[v] operator[SEP] identifier[setCompoundDrawablesWithIntrinsicBounds] operator[SEP] identifier[drawables] operator[SEP] Other[0] operator[SEP] , identifier[drawables] operator[SEP] Other[1] operator[SEP] , identifier[drawables] operator[SEP] Other[2] operator[SEP] , identifier[drawables] operator[SEP] Other[3] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[drawableRelativeDefined] operator[&&] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[JELLY_BEAN_MR1] operator[SEP] { identifier[Drawable] operator[SEP] operator[SEP] identifier[drawables] operator[=] identifier[v] operator[SEP] identifier[getCompoundDrawablesRelative] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[drawableStart] operator[!=] Other[null] operator[SEP] identifier[drawables] operator[SEP] Other[0] operator[SEP] operator[=] identifier[drawableStart] operator[SEP] Keyword[if] operator[SEP] identifier[drawableEnd] operator[!=] Other[null] operator[SEP] identifier[drawables] operator[SEP] Other[2] operator[SEP] operator[=] identifier[drawableEnd] operator[SEP] identifier[v] operator[SEP] identifier[setCompoundDrawablesRelativeWithIntrinsicBounds] operator[SEP] identifier[drawables] operator[SEP] Other[0] operator[SEP] , identifier[drawables] operator[SEP] Other[1] operator[SEP] , identifier[drawables] operator[SEP] Other[2] operator[SEP] , identifier[drawables] operator[SEP] Other[3] operator[SEP] operator[SEP] operator[SEP] } identifier[Typeface] identifier[tf] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[fontFamily] operator[!=] Other[null] operator[SEP] { identifier[tf] operator[=] identifier[TypefaceUtil] operator[SEP] identifier[load] operator[SEP] identifier[v] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] , identifier[fontFamily] , identifier[styleIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tf] operator[!=] Other[null] operator[SEP] identifier[v] operator[SEP] identifier[setTypeface] operator[SEP] identifier[tf] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tf] operator[!=] Other[null] operator[SEP] { Keyword[switch] operator[SEP] identifier[typefaceIndex] operator[SEP] { Keyword[case] Other[1] operator[:] identifier[tf] operator[=] identifier[Typeface] operator[SEP] identifier[SANS_SERIF] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] identifier[tf] operator[=] identifier[Typeface] operator[SEP] identifier[SERIF] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] identifier[tf] operator[=] identifier[Typeface] operator[SEP] identifier[MONOSPACE] operator[SEP] Keyword[break] operator[SEP] } identifier[v] operator[SEP] identifier[setTypeface] operator[SEP] identifier[tf] , identifier[styleIndex] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[v] Keyword[instanceof] identifier[AutoCompleteTextView] operator[SEP] identifier[applyStyle] operator[SEP] operator[SEP] identifier[AutoCompleteTextView] operator[SEP] identifier[v] , identifier[attrs] , identifier[defStyleAttr] , identifier[defStyleRes] operator[SEP] operator[SEP] }
public void setFormatters(Formatter<?>[] formatters) { if (formatters != null && formatters.length > 0) { for (Formatter<?> formatter : formatters) { if (formatter != null) { Class<?> type = ClassUtils.getGenericClass(formatter.getClass()); if (type != null) { this.formatters.put(type, formatter); } } } Map<Class<?>, Formatter<?>> sorted = new TreeMap<Class<?>, Formatter<?>>(ClassComparator.COMPARATOR); sorted.putAll(this.formatters); this.sortedFormatters = Collections.unmodifiableMap(sorted); } }
class class_name[name] begin[{] method[setFormatters, return_type[void], modifier[public], parameter[formatters]] begin[{] if[binary_operation[binary_operation[member[.formatters], !=, literal[null]], &&, binary_operation[member[formatters.length], >, literal[0]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=formatter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None)], member=getGenericClass, postfix_operators=[], prefix_operators=[], qualifier=ClassUtils, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=formatters, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=formatter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=formatters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=formatter)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Formatter, sub_type=None))), label=None) local_variable[type[Map], sorted] call[sorted.putAll, parameter[THIS[member[None.formatters]]]] assign[THIS[member[None.sortedFormatters]], call[Collections.unmodifiableMap, parameter[member[.sorted]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setFormatters] operator[SEP] identifier[Formatter] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[formatters] operator[SEP] { Keyword[if] operator[SEP] identifier[formatters] operator[!=] Other[null] operator[&&] identifier[formatters] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[for] operator[SEP] identifier[Formatter] operator[<] operator[?] operator[>] identifier[formatter] operator[:] identifier[formatters] operator[SEP] { Keyword[if] operator[SEP] identifier[formatter] operator[!=] Other[null] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[ClassUtils] operator[SEP] identifier[getGenericClass] operator[SEP] identifier[formatter] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[formatters] operator[SEP] identifier[put] operator[SEP] identifier[type] , identifier[formatter] operator[SEP] operator[SEP] } } } identifier[Map] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[Formatter] operator[<] operator[?] operator[>] operator[>] identifier[sorted] operator[=] Keyword[new] identifier[TreeMap] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[Formatter] operator[<] operator[?] operator[>] operator[>] operator[SEP] identifier[ClassComparator] operator[SEP] identifier[COMPARATOR] operator[SEP] operator[SEP] identifier[sorted] operator[SEP] identifier[putAll] operator[SEP] Keyword[this] operator[SEP] identifier[formatters] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[sortedFormatters] operator[=] identifier[Collections] operator[SEP] identifier[unmodifiableMap] operator[SEP] identifier[sorted] operator[SEP] operator[SEP] } }
public void setEncID(Integer newEncID) { Integer oldEncID = encID; encID = newEncID; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.DATA_OBJECT_FONT_DESCRIPTOR__ENC_ID, oldEncID, encID)); }
class class_name[name] begin[{] method[setEncID, return_type[void], modifier[public], parameter[newEncID]] begin[{] local_variable[type[Integer], oldEncID] assign[member[.encID], member[.newEncID]] if[call[.eNotificationRequired, parameter[]]] begin[{] call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=DATA_OBJECT_FONT_DESCRIPTOR__ENC_ID, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldEncID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=encID, 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=ENotificationImpl, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setEncID] operator[SEP] identifier[Integer] identifier[newEncID] operator[SEP] { identifier[Integer] identifier[oldEncID] operator[=] identifier[encID] operator[SEP] identifier[encID] operator[=] identifier[newEncID] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[DATA_OBJECT_FONT_DESCRIPTOR__ENC_ID] , identifier[oldEncID] , identifier[encID] operator[SEP] operator[SEP] operator[SEP] }
private static EnumDescriptorProtoPOJO getDescritorProtoPOJO(FileDescriptorProtoPOJO fileDescriptorProto, EnumType typeElement, Set<String> messageSet, Set<String> enumSet) { EnumDescriptorProtoPOJO ret = new EnumDescriptorProtoPOJO(); ret.name = typeElement.getName(); ret.values = new ArrayList<EnumValueDescriptorProtoPOJO>(); ret.options = new ArrayList<EnumOptionsPOJO>(); List<Value> values = typeElement.getValues(); if (values != null) { EnumValueDescriptorProtoPOJO fieldDescriptorProto; for (com.squareup.protoparser.EnumType.Value fieldElement : values) { fieldDescriptorProto = new EnumValueDescriptorProtoPOJO(); fieldDescriptorProto.name = fieldElement.getName(); fieldDescriptorProto.number = fieldElement.getTag(); ret.values.add(fieldDescriptorProto); } } List<Option> options = typeElement.getOptions(); if (options != null) { EnumOptionsPOJO fieldDescriptorProto; for (Option option : options) { fieldDescriptorProto = new EnumOptionsPOJO(); ret.options.add(fieldDescriptorProto); } } return ret; }
class class_name[name] begin[{] method[getDescritorProtoPOJO, return_type[type[EnumDescriptorProtoPOJO]], modifier[private static], parameter[fileDescriptorProto, typeElement, messageSet, enumSet]] begin[{] local_variable[type[EnumDescriptorProtoPOJO], ret] assign[member[ret.name], call[typeElement.getName, parameter[]]] assign[member[ret.values], 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=EnumValueDescriptorProtoPOJO, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] assign[member[ret.options], 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=EnumOptionsPOJO, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] local_variable[type[List], values] if[binary_operation[member[.values], !=, literal[null]]] begin[{] local_variable[type[EnumValueDescriptorProtoPOJO], fieldDescriptorProto] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fieldDescriptorProto, 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=EnumValueDescriptorProtoPOJO, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=fieldDescriptorProto, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=fieldElement, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=fieldDescriptorProto, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTag, postfix_operators=[], prefix_operators=[], qualifier=fieldElement, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fieldDescriptorProto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret.values, 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=fieldElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=squareup, sub_type=ReferenceType(arguments=None, dimensions=None, name=protoparser, sub_type=ReferenceType(arguments=None, dimensions=None, name=EnumType, sub_type=ReferenceType(arguments=None, dimensions=None, name=Value, sub_type=None))))))), label=None) else begin[{] None end[}] local_variable[type[List], options] if[binary_operation[member[.options], !=, literal[null]]] begin[{] local_variable[type[EnumOptionsPOJO], fieldDescriptorProto] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fieldDescriptorProto, 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=EnumOptionsPOJO, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fieldDescriptorProto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret.options, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=option)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Option, sub_type=None))), label=None) else begin[{] None end[}] return[member[.ret]] end[}] END[}]
Keyword[private] Keyword[static] identifier[EnumDescriptorProtoPOJO] identifier[getDescritorProtoPOJO] operator[SEP] identifier[FileDescriptorProtoPOJO] identifier[fileDescriptorProto] , identifier[EnumType] identifier[typeElement] , identifier[Set] operator[<] identifier[String] operator[>] identifier[messageSet] , identifier[Set] operator[<] identifier[String] operator[>] identifier[enumSet] operator[SEP] { identifier[EnumDescriptorProtoPOJO] identifier[ret] operator[=] Keyword[new] identifier[EnumDescriptorProtoPOJO] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[name] operator[=] identifier[typeElement] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[values] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[EnumValueDescriptorProtoPOJO] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[options] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[EnumOptionsPOJO] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Value] operator[>] identifier[values] operator[=] identifier[typeElement] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[!=] Other[null] operator[SEP] { identifier[EnumValueDescriptorProtoPOJO] identifier[fieldDescriptorProto] operator[SEP] Keyword[for] operator[SEP] identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[protoparser] operator[SEP] identifier[EnumType] operator[SEP] identifier[Value] identifier[fieldElement] operator[:] identifier[values] operator[SEP] { identifier[fieldDescriptorProto] operator[=] Keyword[new] identifier[EnumValueDescriptorProtoPOJO] operator[SEP] operator[SEP] operator[SEP] identifier[fieldDescriptorProto] operator[SEP] identifier[name] operator[=] identifier[fieldElement] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[fieldDescriptorProto] operator[SEP] identifier[number] operator[=] identifier[fieldElement] operator[SEP] identifier[getTag] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[fieldDescriptorProto] operator[SEP] operator[SEP] } } identifier[List] operator[<] identifier[Option] operator[>] identifier[options] operator[=] identifier[typeElement] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[options] operator[!=] Other[null] operator[SEP] { identifier[EnumOptionsPOJO] identifier[fieldDescriptorProto] operator[SEP] Keyword[for] operator[SEP] identifier[Option] identifier[option] operator[:] identifier[options] operator[SEP] { identifier[fieldDescriptorProto] operator[=] Keyword[new] identifier[EnumOptionsPOJO] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[options] operator[SEP] identifier[add] operator[SEP] identifier[fieldDescriptorProto] operator[SEP] operator[SEP] } } Keyword[return] identifier[ret] operator[SEP] }
@FFDCIgnore({ SSLPeerUnverifiedException.class }) @Override public boolean isTrusted(TrustedIDEvaluator trustedIDEvaluator, SSLSession session) { if (session != null) { try { Certificate[] certificateChain = session.getPeerCertificates(); return trustedIDEvaluator.isTrusted((X509Certificate[]) certificateChain); } catch (SSLPeerUnverifiedException e) { // TODO Determine if a message is needed } } return false; }
class class_name[name] begin[{] method[isTrusted, return_type[type[boolean]], modifier[public], parameter[trustedIDEvaluator, session]] begin[{] if[binary_operation[member[.session], !=, literal[null]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPeerCertificates, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), name=certificateChain)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Certificate, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=certificateChain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=X509Certificate, sub_type=None))], member=isTrusted, postfix_operators=[], prefix_operators=[], qualifier=trustedIDEvaluator, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SSLPeerUnverifiedException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[literal[false]] end[}] END[}]
annotation[@] identifier[FFDCIgnore] operator[SEP] { identifier[SSLPeerUnverifiedException] operator[SEP] Keyword[class] } operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isTrusted] operator[SEP] identifier[TrustedIDEvaluator] identifier[trustedIDEvaluator] , identifier[SSLSession] identifier[session] operator[SEP] { Keyword[if] operator[SEP] identifier[session] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[Certificate] operator[SEP] operator[SEP] identifier[certificateChain] operator[=] identifier[session] operator[SEP] identifier[getPeerCertificates] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[trustedIDEvaluator] operator[SEP] identifier[isTrusted] operator[SEP] operator[SEP] identifier[X509Certificate] operator[SEP] operator[SEP] operator[SEP] identifier[certificateChain] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SSLPeerUnverifiedException] identifier[e] operator[SEP] { } } Keyword[return] literal[boolean] operator[SEP] }
public static Date setYears(final Date date, final int amount) { return set(date, Calendar.YEAR, amount); }
class class_name[name] begin[{] method[setYears, return_type[type[Date]], modifier[public static], parameter[date, amount]] begin[{] return[call[.set, parameter[member[.date], member[Calendar.YEAR], member[.amount]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Date] identifier[setYears] operator[SEP] Keyword[final] identifier[Date] identifier[date] , Keyword[final] Keyword[int] identifier[amount] operator[SEP] { Keyword[return] identifier[set] operator[SEP] identifier[date] , identifier[Calendar] operator[SEP] identifier[YEAR] , identifier[amount] operator[SEP] operator[SEP] }
public Observable<ServiceResponse<Page<RecordSetInner>>> listAllByDnsZoneWithServiceResponseAsync(final String resourceGroupName, final String zoneName, final Integer top, final String recordSetNameSuffix) { return listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordSetNameSuffix) .concatMap(new Func1<ServiceResponse<Page<RecordSetInner>>, Observable<ServiceResponse<Page<RecordSetInner>>>>() { @Override public Observable<ServiceResponse<Page<RecordSetInner>>> call(ServiceResponse<Page<RecordSetInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listAllByDnsZoneNextWithServiceResponseAsync(nextPageLink)); } }); }
class class_name[name] begin[{] method[listAllByDnsZoneWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, zoneName, top, recordSetNameSuffix]] begin[{] return[call[.listAllByDnsZoneSinglePageAsync, parameter[member[.resourceGroupName], member[.zoneName], member[.top], member[.recordSetNameSuffix]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RecordSetInner] operator[>] operator[>] operator[>] identifier[listAllByDnsZoneWithServiceResponseAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[String] identifier[zoneName] , Keyword[final] identifier[Integer] identifier[top] , Keyword[final] identifier[String] identifier[recordSetNameSuffix] operator[SEP] { Keyword[return] identifier[listAllByDnsZoneSinglePageAsync] operator[SEP] identifier[resourceGroupName] , identifier[zoneName] , identifier[top] , identifier[recordSetNameSuffix] operator[SEP] operator[SEP] identifier[concatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RecordSetInner] operator[>] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RecordSetInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RecordSetInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RecordSetInner] operator[>] operator[>] identifier[page] operator[SEP] { identifier[String] identifier[nextPageLink] operator[=] identifier[page] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextPageLink] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP] } Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP] identifier[concatWith] operator[SEP] identifier[listAllByDnsZoneNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
@Override public void info(final MessageItem messageItem) { getLogger().log(messageItem.getMarker(), FQCN, LocationAwareLogger.INFO_INT, messageItem.getText(), null, null); }
class class_name[name] begin[{] method[info, return_type[void], modifier[public], parameter[messageItem]] begin[{] call[.getLogger, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[info] operator[SEP] Keyword[final] identifier[MessageItem] identifier[messageItem] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[messageItem] operator[SEP] identifier[getMarker] operator[SEP] operator[SEP] , identifier[FQCN] , identifier[LocationAwareLogger] operator[SEP] identifier[INFO_INT] , identifier[messageItem] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , Other[null] , Other[null] operator[SEP] operator[SEP] }
static InjectionBinding<WebServiceRef> createWebServiceRefBindingFromResource(Resource resource, ComponentNameSpaceConfiguration cnsConfig, Class<?> serviceClass, String jndiName) throws InjectionException { InjectionBinding<WebServiceRef> binding = null; WebServiceRef wsRef = createWebServiceRefFromResource(resource, serviceClass, jndiName); WebServiceRefInfo wsrInfo = WebServiceRefInfoBuilder.buildWebServiceRefInfo(wsRef, cnsConfig.getClassLoader()); wsrInfo.setClientMetaData(JaxWsMetaDataManager.getJaxWsClientMetaData(cnsConfig.getModuleMetaData())); wsrInfo.setServiceInterfaceClassName(serviceClass.getName()); binding = new WebServiceRefBinding(wsRef, cnsConfig); // register the metadata, and set a flag on the binding instance that let's us // know this binding represents metadata from an @Resource annotation ((WebServiceRefBinding) binding).setWebServiceRefInfo(wsrInfo); ((WebServiceRefBinding) binding).setResourceType(true); return binding; }
class class_name[name] begin[{] method[createWebServiceRefBindingFromResource, return_type[type[InjectionBinding]], modifier[static], parameter[resource, cnsConfig, serviceClass, jndiName]] begin[{] local_variable[type[InjectionBinding], binding] local_variable[type[WebServiceRef], wsRef] local_variable[type[WebServiceRefInfo], wsrInfo] call[wsrInfo.setClientMetaData, parameter[call[JaxWsMetaDataManager.getJaxWsClientMetaData, parameter[call[cnsConfig.getModuleMetaData, parameter[]]]]]] call[wsrInfo.setServiceInterfaceClassName, parameter[call[serviceClass.getName, parameter[]]]] assign[member[.binding], ClassCreator(arguments=[MemberReference(member=wsRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cnsConfig, 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=WebServiceRefBinding, sub_type=None))] Cast(expression=MemberReference(member=binding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WebServiceRefBinding, sub_type=None)) Cast(expression=MemberReference(member=binding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WebServiceRefBinding, sub_type=None)) return[member[.binding]] end[}] END[}]
Keyword[static] identifier[InjectionBinding] operator[<] identifier[WebServiceRef] operator[>] identifier[createWebServiceRefBindingFromResource] operator[SEP] identifier[Resource] identifier[resource] , identifier[ComponentNameSpaceConfiguration] identifier[cnsConfig] , identifier[Class] operator[<] operator[?] operator[>] identifier[serviceClass] , identifier[String] identifier[jndiName] operator[SEP] Keyword[throws] identifier[InjectionException] { identifier[InjectionBinding] operator[<] identifier[WebServiceRef] operator[>] identifier[binding] operator[=] Other[null] operator[SEP] identifier[WebServiceRef] identifier[wsRef] operator[=] identifier[createWebServiceRefFromResource] operator[SEP] identifier[resource] , identifier[serviceClass] , identifier[jndiName] operator[SEP] operator[SEP] identifier[WebServiceRefInfo] identifier[wsrInfo] operator[=] identifier[WebServiceRefInfoBuilder] operator[SEP] identifier[buildWebServiceRefInfo] operator[SEP] identifier[wsRef] , identifier[cnsConfig] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[wsrInfo] operator[SEP] identifier[setClientMetaData] operator[SEP] identifier[JaxWsMetaDataManager] operator[SEP] identifier[getJaxWsClientMetaData] operator[SEP] identifier[cnsConfig] operator[SEP] identifier[getModuleMetaData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[wsrInfo] operator[SEP] identifier[setServiceInterfaceClassName] operator[SEP] identifier[serviceClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[binding] operator[=] Keyword[new] identifier[WebServiceRefBinding] operator[SEP] identifier[wsRef] , identifier[cnsConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[WebServiceRefBinding] operator[SEP] identifier[binding] operator[SEP] operator[SEP] identifier[setWebServiceRefInfo] operator[SEP] identifier[wsrInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[WebServiceRefBinding] operator[SEP] identifier[binding] operator[SEP] operator[SEP] identifier[setResourceType] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[binding] operator[SEP] }
public void clearNormalizedCache(@NotNull ApolloStoreOperation.Callback<Boolean> callback) { checkNotNull(callback, "callback == null"); apolloStore.clearAll().enqueue(callback); }
class class_name[name] begin[{] method[clearNormalizedCache, return_type[void], modifier[public], parameter[callback]] begin[{] call[.checkNotNull, parameter[member[.callback], literal["callback == null"]]] call[apolloStore.clearAll, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[clearNormalizedCache] operator[SEP] annotation[@] identifier[NotNull] identifier[ApolloStoreOperation] operator[SEP] identifier[Callback] operator[<] identifier[Boolean] operator[>] identifier[callback] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[callback] , literal[String] operator[SEP] operator[SEP] identifier[apolloStore] operator[SEP] identifier[clearAll] operator[SEP] operator[SEP] operator[SEP] identifier[enqueue] operator[SEP] identifier[callback] operator[SEP] operator[SEP] }
public Tag createTag(Object projectIdOrPath, String tagName, String ref, String message, File releaseNotesFile) throws GitLabApiException { String releaseNotes; if (releaseNotesFile != null) { try { releaseNotes = FileUtils.readFileContents(releaseNotesFile); } catch (IOException ioe) { throw (new GitLabApiException(ioe)); } } else { releaseNotes = null; } return (createTag(projectIdOrPath, tagName, ref, message, releaseNotes)); }
class class_name[name] begin[{] method[createTag, return_type[type[Tag]], modifier[public], parameter[projectIdOrPath, tagName, ref, message, releaseNotesFile]] begin[{] local_variable[type[String], releaseNotes] if[binary_operation[member[.releaseNotesFile], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=releaseNotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=releaseNotesFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFileContents, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ioe, 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=GitLabApiException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None) else begin[{] assign[member[.releaseNotes], literal[null]] end[}] return[call[.createTag, parameter[member[.projectIdOrPath], member[.tagName], member[.ref], member[.message], member[.releaseNotes]]]] end[}] END[}]
Keyword[public] identifier[Tag] identifier[createTag] operator[SEP] identifier[Object] identifier[projectIdOrPath] , identifier[String] identifier[tagName] , identifier[String] identifier[ref] , identifier[String] identifier[message] , identifier[File] identifier[releaseNotesFile] operator[SEP] Keyword[throws] identifier[GitLabApiException] { identifier[String] identifier[releaseNotes] operator[SEP] Keyword[if] operator[SEP] identifier[releaseNotesFile] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[releaseNotes] operator[=] identifier[FileUtils] operator[SEP] identifier[readFileContents] operator[SEP] identifier[releaseNotesFile] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { Keyword[throw] operator[SEP] Keyword[new] identifier[GitLabApiException] operator[SEP] identifier[ioe] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[releaseNotes] operator[=] Other[null] operator[SEP] } Keyword[return] operator[SEP] identifier[createTag] operator[SEP] identifier[projectIdOrPath] , identifier[tagName] , identifier[ref] , identifier[message] , identifier[releaseNotes] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isServerRequestEncrypted(HttpURLConnection request) { return Constants.TRUE.equals(request.getHeaderField(Constants.HeaderConstants.SERVER_REQUEST_ENCRYPTED)); }
class class_name[name] begin[{] method[isServerRequestEncrypted, return_type[type[boolean]], modifier[public static], parameter[request]] begin[{] return[call[Constants.TRUE.equals, parameter[call[request.getHeaderField, parameter[member[Constants.HeaderConstants.SERVER_REQUEST_ENCRYPTED]]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isServerRequestEncrypted] operator[SEP] identifier[HttpURLConnection] identifier[request] operator[SEP] { Keyword[return] identifier[Constants] operator[SEP] identifier[TRUE] operator[SEP] identifier[equals] operator[SEP] identifier[request] operator[SEP] identifier[getHeaderField] operator[SEP] identifier[Constants] operator[SEP] identifier[HeaderConstants] operator[SEP] identifier[SERVER_REQUEST_ENCRYPTED] operator[SEP] operator[SEP] operator[SEP] }
private boolean folderExists(CmsObject cms, String folder) { try { CmsFolder test = cms.readFolder(folder, CmsResourceFilter.IGNORE_EXPIRATION); if (test.isFile()) { return false; } return true; } catch (Exception e) { return false; } }
class class_name[name] begin[{] method[folderExists, return_type[type[boolean]], modifier[private], parameter[cms, folder]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=folder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=IGNORE_EXPIRATION, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[])], member=readFolder, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[], type_arguments=None), name=test)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsFolder, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isFile, postfix_operators=[], prefix_operators=[], qualifier=test, 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)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[boolean] identifier[folderExists] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[String] identifier[folder] operator[SEP] { Keyword[try] { identifier[CmsFolder] identifier[test] operator[=] identifier[cms] operator[SEP] identifier[readFolder] operator[SEP] identifier[folder] , identifier[CmsResourceFilter] operator[SEP] identifier[IGNORE_EXPIRATION] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[test] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } }
private void adaptButtonTextColor() { if (buttonTextColor != null) { if (positiveButton != null) { positiveButton.setTextColor(buttonTextColor); } if (neutralButton != null) { neutralButton.setTextColor(buttonTextColor); } if (negativeButton != null) { negativeButton.setTextColor(buttonTextColor); } } }
class class_name[name] begin[{] method[adaptButtonTextColor, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[member[.buttonTextColor], !=, literal[null]]] begin[{] if[binary_operation[member[.positiveButton], !=, literal[null]]] begin[{] call[positiveButton.setTextColor, parameter[member[.buttonTextColor]]] else begin[{] None end[}] if[binary_operation[member[.neutralButton], !=, literal[null]]] begin[{] call[neutralButton.setTextColor, parameter[member[.buttonTextColor]]] else begin[{] None end[}] if[binary_operation[member[.negativeButton], !=, literal[null]]] begin[{] call[negativeButton.setTextColor, parameter[member[.buttonTextColor]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[adaptButtonTextColor] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[buttonTextColor] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[positiveButton] operator[!=] Other[null] operator[SEP] { identifier[positiveButton] operator[SEP] identifier[setTextColor] operator[SEP] identifier[buttonTextColor] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[neutralButton] operator[!=] Other[null] operator[SEP] { identifier[neutralButton] operator[SEP] identifier[setTextColor] operator[SEP] identifier[buttonTextColor] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[negativeButton] operator[!=] Other[null] operator[SEP] { identifier[negativeButton] operator[SEP] identifier[setTextColor] operator[SEP] identifier[buttonTextColor] operator[SEP] operator[SEP] } } }
protected void submitFaxJobViaFaxModem(FaxJob faxJob) throws Exception { //get type String type=faxJob.getProperty(FaxJobExtendedPropertyConstants.DATA_TYPE_FAX_JOB_PROPERTY_KEY.toString(),"TEXT"); //get common values int width=Integer.parseInt(faxJob.getProperty(FaxJobExtendedPropertyConstants.WIDTH_FAX_JOB_PROPERTY_KEY.toString(),null)); int height=Integer.parseInt(faxJob.getProperty(FaxJobExtendedPropertyConstants.HEIGHT_FAX_JOB_PROPERTY_KEY.toString(),null)); int imageType=Integer.parseInt(faxJob.getProperty(FaxJobExtendedPropertyConstants.IMAGE_TYPE_FAX_JOB_PROPERTY_KEY.toString(),String.valueOf(BufferedImage.TYPE_INT_RGB))); //create image BufferedImage image=new BufferedImage(width,height,imageType); //create fax producer Object faxProducer=null; if(type.equalsIgnoreCase("PDF")) { //get type Class<?> classDefinition=ReflectionHelper.getType("com.java4less.rfax.PDFFaxProducer"); //create fax producer faxProducer=ReflectionHelper.createInstance(classDefinition); ReflectionHelper.invokeMethod(classDefinition,faxProducer,"setPDFFile",new Class[]{String.class},new Object[]{faxJob.getFilePath()}); Field field=ReflectionHelper.getField(classDefinition,"pageImage"); field.set(faxProducer,image); } else if(type.equalsIgnoreCase("TEXT")) { //get type Class<?> classDefinition=ReflectionHelper.getType("com.java4less.rfax.TextFaxProducer"); //create fax producer faxProducer=ReflectionHelper.createInstance(classDefinition); String text=IOHelper.readTextFile(faxJob.getFile()); Field field=ReflectionHelper.getField(classDefinition,"text"); field.set(faxProducer,text); field=ReflectionHelper.getField(classDefinition,"pageImage"); field.set(faxProducer,image); ReflectionHelper.invokeMethod(classDefinition,faxProducer,"prepare",null,null); } else { throw new FaxException("Unsupported type provided: "+type); } //init fax modem Class<?> faxModemClassDefinition=ReflectionHelper.getType("com.java4less.rfax.FaxModem"); Object faxModem=ReflectionHelper.createInstance(faxModemClassDefinition); ReflectionHelper.invokeMethod(faxModemClassDefinition,faxModem,"setPortName",new Class[]{String.class},new Object[]{this.portName}); Field field=ReflectionHelper.getField(faxModemClassDefinition,"faxClass"); field.set(faxModem,Integer.valueOf(this.faxClass)); //send fax Class<?> faxProducerClassDefinition=ReflectionHelper.getType("com.java4less.rfax.FaxProducer"); ReflectionHelper.invokeMethod(faxModemClassDefinition,faxModem,"open",new Class[]{faxProducerClassDefinition},new Object[]{faxProducer}); boolean faxSent=((Boolean)ReflectionHelper.invokeMethod(faxModemClassDefinition,faxModem,"sendFax",new Class[]{String.class},new Object[]{faxJob.getTargetAddress()})).booleanValue(); //release fax modem ReflectionHelper.invokeMethod(faxModemClassDefinition,faxModem,"close",null,null); if(!faxSent) { field=ReflectionHelper.getField(faxModemClassDefinition,"lastError"); String lastError=(String)field.get(faxModem); throw new FaxException("Error while sending fax. Error: "+lastError); } }
class class_name[name] begin[{] method[submitFaxJobViaFaxModem, return_type[void], modifier[protected], parameter[faxJob]] begin[{] local_variable[type[String], type] local_variable[type[int], width] local_variable[type[int], height] local_variable[type[int], imageType] local_variable[type[BufferedImage], image] local_variable[type[Object], faxProducer] if[call[type.equalsIgnoreCase, parameter[literal["PDF"]]]] begin[{] local_variable[type[Class], classDefinition] assign[member[.faxProducer], call[ReflectionHelper.createInstance, parameter[member[.classDefinition]]]] call[ReflectionHelper.invokeMethod, parameter[member[.classDefinition], member[.faxProducer], literal["setPDFFile"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None)), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getFilePath, postfix_operators=[], prefix_operators=[], qualifier=faxJob, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] local_variable[type[Field], field] call[field.set, parameter[member[.faxProducer], member[.image]]] else begin[{] if[call[type.equalsIgnoreCase, parameter[literal["TEXT"]]]] begin[{] local_variable[type[Class], classDefinition] assign[member[.faxProducer], call[ReflectionHelper.createInstance, parameter[member[.classDefinition]]]] local_variable[type[String], text] local_variable[type[Field], field] call[field.set, parameter[member[.faxProducer], member[.text]]] assign[member[.field], call[ReflectionHelper.getField, parameter[member[.classDefinition], literal["pageImage"]]]] call[field.set, parameter[member[.faxProducer], member[.image]]] call[ReflectionHelper.invokeMethod, parameter[member[.classDefinition], member[.faxProducer], literal["prepare"], literal[null], literal[null]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported type provided: "), operandr=MemberReference(member=type, 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=FaxException, sub_type=None)), label=None) end[}] end[}] local_variable[type[Class], faxModemClassDefinition] local_variable[type[Object], faxModem] call[ReflectionHelper.invokeMethod, parameter[member[.faxModemClassDefinition], member[.faxModem], literal["setPortName"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None)), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=portName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] local_variable[type[Field], field] call[field.set, parameter[member[.faxModem], call[Integer.valueOf, parameter[THIS[member[None.faxClass]]]]]] local_variable[type[Class], faxProducerClassDefinition] call[ReflectionHelper.invokeMethod, parameter[member[.faxModemClassDefinition], member[.faxModem], literal["open"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=faxProducerClassDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None)), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=faxProducer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] local_variable[type[boolean], faxSent] call[ReflectionHelper.invokeMethod, parameter[member[.faxModemClassDefinition], member[.faxModem], literal["close"], literal[null], literal[null]]] if[member[.faxSent]] begin[{] assign[member[.field], call[ReflectionHelper.getField, parameter[member[.faxModemClassDefinition], literal["lastError"]]]] local_variable[type[String], lastError] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while sending fax. Error: "), operandr=MemberReference(member=lastError, 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=FaxException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[submitFaxJobViaFaxModem] operator[SEP] identifier[FaxJob] identifier[faxJob] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[type] operator[=] identifier[faxJob] operator[SEP] identifier[getProperty] operator[SEP] identifier[FaxJobExtendedPropertyConstants] operator[SEP] identifier[DATA_TYPE_FAX_JOB_PROPERTY_KEY] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[width] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[faxJob] operator[SEP] identifier[getProperty] operator[SEP] identifier[FaxJobExtendedPropertyConstants] operator[SEP] identifier[WIDTH_FAX_JOB_PROPERTY_KEY] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[height] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[faxJob] operator[SEP] identifier[getProperty] operator[SEP] identifier[FaxJobExtendedPropertyConstants] operator[SEP] identifier[HEIGHT_FAX_JOB_PROPERTY_KEY] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[imageType] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[faxJob] operator[SEP] identifier[getProperty] operator[SEP] identifier[FaxJobExtendedPropertyConstants] operator[SEP] identifier[IMAGE_TYPE_FAX_JOB_PROPERTY_KEY] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_RGB] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[BufferedImage] identifier[image] operator[=] Keyword[new] identifier[BufferedImage] operator[SEP] identifier[width] , identifier[height] , identifier[imageType] operator[SEP] operator[SEP] identifier[Object] identifier[faxProducer] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[classDefinition] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[faxProducer] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[createInstance] operator[SEP] identifier[classDefinition] operator[SEP] operator[SEP] identifier[ReflectionHelper] operator[SEP] identifier[invokeMethod] operator[SEP] identifier[classDefinition] , identifier[faxProducer] , literal[String] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[String] operator[SEP] Keyword[class] } , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[faxJob] operator[SEP] identifier[getFilePath] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[Field] identifier[field] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getField] operator[SEP] identifier[classDefinition] , literal[String] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[set] operator[SEP] identifier[faxProducer] , identifier[image] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[classDefinition] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[faxProducer] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[createInstance] operator[SEP] identifier[classDefinition] operator[SEP] operator[SEP] identifier[String] identifier[text] operator[=] identifier[IOHelper] operator[SEP] identifier[readTextFile] operator[SEP] identifier[faxJob] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Field] identifier[field] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getField] operator[SEP] identifier[classDefinition] , literal[String] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[set] operator[SEP] identifier[faxProducer] , identifier[text] operator[SEP] operator[SEP] identifier[field] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getField] operator[SEP] identifier[classDefinition] , literal[String] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[set] operator[SEP] identifier[faxProducer] , identifier[image] operator[SEP] operator[SEP] identifier[ReflectionHelper] operator[SEP] identifier[invokeMethod] operator[SEP] identifier[classDefinition] , identifier[faxProducer] , literal[String] , Other[null] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[FaxException] operator[SEP] literal[String] operator[+] identifier[type] operator[SEP] operator[SEP] } identifier[Class] operator[<] operator[?] operator[>] identifier[faxModemClassDefinition] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Object] identifier[faxModem] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[createInstance] operator[SEP] identifier[faxModemClassDefinition] operator[SEP] operator[SEP] identifier[ReflectionHelper] operator[SEP] identifier[invokeMethod] operator[SEP] identifier[faxModemClassDefinition] , identifier[faxModem] , literal[String] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[String] operator[SEP] Keyword[class] } , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[portName] } operator[SEP] operator[SEP] identifier[Field] identifier[field] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getField] operator[SEP] identifier[faxModemClassDefinition] , literal[String] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[set] operator[SEP] identifier[faxModem] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[faxClass] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[faxProducerClassDefinition] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ReflectionHelper] operator[SEP] identifier[invokeMethod] operator[SEP] identifier[faxModemClassDefinition] , identifier[faxModem] , literal[String] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[faxProducerClassDefinition] } , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[faxProducer] } operator[SEP] operator[SEP] Keyword[boolean] identifier[faxSent] operator[=] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] identifier[ReflectionHelper] operator[SEP] identifier[invokeMethod] operator[SEP] identifier[faxModemClassDefinition] , identifier[faxModem] , literal[String] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[String] operator[SEP] Keyword[class] } , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[faxJob] operator[SEP] identifier[getTargetAddress] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] identifier[ReflectionHelper] operator[SEP] identifier[invokeMethod] operator[SEP] identifier[faxModemClassDefinition] , identifier[faxModem] , literal[String] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[faxSent] operator[SEP] { identifier[field] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getField] operator[SEP] identifier[faxModemClassDefinition] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[lastError] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[field] operator[SEP] identifier[get] operator[SEP] identifier[faxModem] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[FaxException] operator[SEP] literal[String] operator[+] identifier[lastError] operator[SEP] operator[SEP] } }
public static Map<List<Word>, Float> trigram(List<Word>... sentences){ Map<List<Word>, Float> map = new HashMap<>(); //计算多种分词结果的分值 for(List<Word> sentence : sentences){ if(map.get(sentence) != null){ //相同的分词结果只计算一次分值 continue; } float score=0; //计算其中一种分词结果的分值 if(sentence.size() > 2){ for(int i=0; i<sentence.size()-2; i++){ String first = sentence.get(i).getText(); String second = sentence.get(i+1).getText(); String third = sentence.get(i+2).getText(); float trigramScore = getScore(first, second, third); if(trigramScore > 0){ score += trigramScore; } } } map.put(sentence, score); } return map; }
class class_name[name] begin[{] method[trigram, return_type[type[Map]], modifier[public static], parameter[sentences]] begin[{] local_variable[type[Map], map] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=sentence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=score)], modifiers=set(), type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=sentence, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=sentence, selectors=[MethodInvocation(arguments=[], member=getText, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=first)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=sentence, selectors=[MethodInvocation(arguments=[], member=getText, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=second)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=sentence, selectors=[MethodInvocation(arguments=[], member=getText, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=third)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=second, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=third, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getScore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=trigramScore)], modifiers=set(), type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=trigramScore, 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=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=trigramScore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=sentence, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), 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)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sentence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sentences, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sentence)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Word, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) return[member[.map]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[List] operator[<] identifier[Word] operator[>] , identifier[Float] operator[>] identifier[trigram] operator[SEP] identifier[List] operator[<] identifier[Word] operator[>] operator[...] identifier[sentences] operator[SEP] { identifier[Map] operator[<] identifier[List] operator[<] identifier[Word] operator[>] , identifier[Float] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] identifier[Word] operator[>] identifier[sentence] operator[:] identifier[sentences] operator[SEP] { Keyword[if] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[sentence] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[float] identifier[score] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[sentence] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[2] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[sentence] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[2] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[String] identifier[first] operator[=] identifier[sentence] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[second] operator[=] identifier[sentence] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[third] operator[=] identifier[sentence] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[+] Other[2] operator[SEP] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[trigramScore] operator[=] identifier[getScore] operator[SEP] identifier[first] , identifier[second] , identifier[third] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trigramScore] operator[>] Other[0] operator[SEP] { identifier[score] operator[+=] identifier[trigramScore] operator[SEP] } } } identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[sentence] , identifier[score] operator[SEP] operator[SEP] } Keyword[return] identifier[map] operator[SEP] }
@NotNull public static FileInfo forPath(Path path) { try { final BasicFileAttributes attributes = Files.readAttributes(path, BasicFileAttributes.class); return FileInfo.builder() .path(path) .key(attributes.fileKey()) .size(attributes.size()) .modificationTime(attributes.lastModifiedTime()) .build(); } catch (Exception e) { LOG.error("Couldn't get file info for path: {}", path, e); return EMPTY_FILE_INFO.toBuilder().path(path).build(); } }
class class_name[name] begin[{] method[forPath, return_type[type[FileInfo]], modifier[public static], parameter[path]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BasicFileAttributes, sub_type=None))], member=readAttributes, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), name=attributes)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=BasicFileAttributes, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=builder, postfix_operators=[], prefix_operators=[], qualifier=FileInfo, selectors=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=path, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=fileKey, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None)], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=lastModifiedTime, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None)], member=modificationTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't get file info for path: {}"), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toBuilder, postfix_operators=[], prefix_operators=[], qualifier=EMPTY_FILE_INFO, selectors=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=path, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, 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=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[NotNull] Keyword[public] Keyword[static] identifier[FileInfo] identifier[forPath] operator[SEP] identifier[Path] identifier[path] operator[SEP] { Keyword[try] { Keyword[final] identifier[BasicFileAttributes] identifier[attributes] operator[=] identifier[Files] operator[SEP] identifier[readAttributes] operator[SEP] identifier[path] , identifier[BasicFileAttributes] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[FileInfo] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[attributes] operator[SEP] identifier[fileKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] identifier[attributes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[modificationTime] operator[SEP] identifier[attributes] operator[SEP] identifier[lastModifiedTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[path] , identifier[e] operator[SEP] operator[SEP] Keyword[return] identifier[EMPTY_FILE_INFO] operator[SEP] identifier[toBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } }
public HadoopJarStepConfig newScriptRunnerStep(String script, String... args) { List<String> argsList = new ArrayList<String>(); argsList.add(script); for (String arg : args) { argsList.add(arg); } return new HadoopJarStepConfig() .withJar("s3://" + bucket + "/libs/script-runner/script-runner.jar") .withArgs(argsList); }
class class_name[name] begin[{] method[newScriptRunnerStep, return_type[type[HadoopJarStepConfig]], modifier[public], parameter[script, args]] begin[{] local_variable[type[List], argsList] call[argsList.add, parameter[member[.script]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=argsList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="s3://"), operandr=MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/libs/script-runner/script-runner.jar"), operator=+)], member=withJar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=argsList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withArgs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=HadoopJarStepConfig, sub_type=None))] end[}] END[}]
Keyword[public] identifier[HadoopJarStepConfig] identifier[newScriptRunnerStep] operator[SEP] identifier[String] identifier[script] , identifier[String] operator[...] identifier[args] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[argsList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[argsList] operator[SEP] identifier[add] operator[SEP] identifier[script] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[arg] operator[:] identifier[args] operator[SEP] { identifier[argsList] operator[SEP] identifier[add] operator[SEP] identifier[arg] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[HadoopJarStepConfig] operator[SEP] operator[SEP] operator[SEP] identifier[withJar] operator[SEP] literal[String] operator[+] identifier[bucket] operator[+] literal[String] operator[SEP] operator[SEP] identifier[withArgs] operator[SEP] identifier[argsList] operator[SEP] operator[SEP] }
public static MethodIdentifier getIdentifier(final Class<?> returnType, final String name, final Class<?>... parameterTypes) { return new MethodIdentifier(returnType.getName(), name, namesOf(parameterTypes)); }
class class_name[name] begin[{] method[getIdentifier, return_type[type[MethodIdentifier]], modifier[public static], parameter[returnType, name, parameterTypes]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=returnType, selectors=[], type_arguments=None), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=parameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=namesOf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MethodIdentifier, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[MethodIdentifier] identifier[getIdentifier] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[returnType] , Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[parameterTypes] operator[SEP] { Keyword[return] Keyword[new] identifier[MethodIdentifier] operator[SEP] identifier[returnType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[name] , identifier[namesOf] operator[SEP] identifier[parameterTypes] operator[SEP] operator[SEP] operator[SEP] }
public Properties getProperties(final Locale locale) { Resource url = this.baseResourcesResource; Properties properties = null; if(url != null) { StaticResourceLoader resourceLoader = new StaticResourceLoader(); resourceLoader.setBaseResource(url); ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(resourceLoader); try { // first load all properties Resource[] resources = resolver.getResources('*' + PROPERTIES_EXTENSION); resources = resources.length > 0 ? filterResources(resources, locale) : resources; if(resources.length > 0) { properties = new Properties(); // message bundles are locale specific. The more underscores the locale has the more specific the locale // so we order by the number of underscores present so that the most specific appears Arrays.sort(resources, (o1, o2) -> { String f1 = o1.getFilename(); String f2 = o2.getFilename(); int firstUnderscoreCount = StringUtils.countOccurrencesOf(f1, "_"); int secondUnderscoreCount = StringUtils.countOccurrencesOf(f2, "_"); if(firstUnderscoreCount == secondUnderscoreCount) { return 0; } else { return firstUnderscoreCount > secondUnderscoreCount ? 1 : -1; } }); loadFromResources(properties, resources); } } catch (IOException e) { return null; } } return properties; }
class class_name[name] begin[{] method[getProperties, return_type[type[Properties]], modifier[public], parameter[locale]] begin[{] local_variable[type[Resource], url] local_variable[type[Properties], properties] if[binary_operation[member[.url], !=, literal[null]]] begin[{] local_variable[type[StaticResourceLoader], resourceLoader] call[resourceLoader.setBaseResource, parameter[member[.url]]] local_variable[type[ResourcePatternResolver], resolver] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='*'), operandr=MemberReference(member=PROPERTIES_EXTENSION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=getResources, postfix_operators=[], prefix_operators=[], qualifier=resolver, selectors=[], type_arguments=None), name=resources)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Resource, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=resources, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=filterResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=resources, 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=properties, 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=Properties, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFilename, postfix_operators=[], prefix_operators=[], qualifier=o1, selectors=[], type_arguments=None), name=f1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFilename, postfix_operators=[], prefix_operators=[], qualifier=o2, selectors=[], type_arguments=None), name=f2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=f1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_")], member=countOccurrencesOf, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), name=firstUnderscoreCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=f2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_")], member=countOccurrencesOf, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), name=secondUnderscoreCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=firstUnderscoreCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=secondUnderscoreCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=firstUnderscoreCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=secondUnderscoreCount, postfix_operators=[], prefix_operators=[], qualifier=, 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=1)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), label=None)]))], parameters=[InferredFormalParameter(name=o1), InferredFormalParameter(name=o2)])], member=sort, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadFromResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.properties]] end[}] END[}]
Keyword[public] identifier[Properties] identifier[getProperties] operator[SEP] Keyword[final] identifier[Locale] identifier[locale] operator[SEP] { identifier[Resource] identifier[url] operator[=] Keyword[this] operator[SEP] identifier[baseResourcesResource] operator[SEP] identifier[Properties] identifier[properties] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[!=] Other[null] operator[SEP] { identifier[StaticResourceLoader] identifier[resourceLoader] operator[=] Keyword[new] identifier[StaticResourceLoader] operator[SEP] operator[SEP] operator[SEP] identifier[resourceLoader] operator[SEP] identifier[setBaseResource] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[ResourcePatternResolver] identifier[resolver] operator[=] Keyword[new] identifier[PathMatchingResourcePatternResolver] operator[SEP] identifier[resourceLoader] operator[SEP] operator[SEP] Keyword[try] { identifier[Resource] operator[SEP] operator[SEP] identifier[resources] operator[=] identifier[resolver] operator[SEP] identifier[getResources] operator[SEP] literal[String] operator[+] identifier[PROPERTIES_EXTENSION] operator[SEP] operator[SEP] identifier[resources] operator[=] identifier[resources] operator[SEP] identifier[length] operator[>] Other[0] operator[?] identifier[filterResources] operator[SEP] identifier[resources] , identifier[locale] operator[SEP] operator[:] identifier[resources] operator[SEP] Keyword[if] operator[SEP] identifier[resources] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[properties] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[resources] , operator[SEP] identifier[o1] , identifier[o2] operator[SEP] operator[->] { identifier[String] identifier[f1] operator[=] identifier[o1] operator[SEP] identifier[getFilename] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[f2] operator[=] identifier[o2] operator[SEP] identifier[getFilename] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[firstUnderscoreCount] operator[=] identifier[StringUtils] operator[SEP] identifier[countOccurrencesOf] operator[SEP] identifier[f1] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[secondUnderscoreCount] operator[=] identifier[StringUtils] operator[SEP] identifier[countOccurrencesOf] operator[SEP] identifier[f2] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[firstUnderscoreCount] operator[==] identifier[secondUnderscoreCount] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[else] { Keyword[return] identifier[firstUnderscoreCount] operator[>] identifier[secondUnderscoreCount] operator[?] Other[1] operator[:] operator[-] Other[1] operator[SEP] } } operator[SEP] operator[SEP] identifier[loadFromResources] operator[SEP] identifier[properties] , identifier[resources] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } Keyword[return] identifier[properties] operator[SEP] }
public void replace(final int pos, final double latitude, final double longitude) { this.longitude[pos] = longitude; this.latitude[pos] = latitude; }
class class_name[name] begin[{] method[replace, return_type[void], modifier[public], parameter[pos, latitude, longitude]] begin[{] assign[THIS[member[None.longitude]ArraySelector(index=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], member[.longitude]] assign[THIS[member[None.latitude]ArraySelector(index=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], member[.latitude]] end[}] END[}]
Keyword[public] Keyword[void] identifier[replace] operator[SEP] Keyword[final] Keyword[int] identifier[pos] , Keyword[final] Keyword[double] identifier[latitude] , Keyword[final] Keyword[double] identifier[longitude] operator[SEP] { Keyword[this] operator[SEP] identifier[longitude] operator[SEP] identifier[pos] operator[SEP] operator[=] identifier[longitude] operator[SEP] Keyword[this] operator[SEP] identifier[latitude] operator[SEP] identifier[pos] operator[SEP] operator[=] identifier[latitude] operator[SEP] }
@Override @DefinedBy(Api.COMPILER_TREE) public Void visitText(TextTree tree, Void ignore) { if (hasNonWhitespace(tree)) { checkAllowsText(tree); markEnclosingTag(Flag.HAS_TEXT); } return null; }
class class_name[name] begin[{] method[visitText, return_type[type[Void]], modifier[public], parameter[tree, ignore]] begin[{] if[call[.hasNonWhitespace, parameter[member[.tree]]]] begin[{] call[.checkAllowsText, parameter[member[.tree]]] call[.markEnclosingTag, parameter[member[Flag.HAS_TEXT]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[DefinedBy] operator[SEP] identifier[Api] operator[SEP] identifier[COMPILER_TREE] operator[SEP] Keyword[public] identifier[Void] identifier[visitText] operator[SEP] identifier[TextTree] identifier[tree] , identifier[Void] identifier[ignore] operator[SEP] { Keyword[if] operator[SEP] identifier[hasNonWhitespace] operator[SEP] identifier[tree] operator[SEP] operator[SEP] { identifier[checkAllowsText] operator[SEP] identifier[tree] operator[SEP] operator[SEP] identifier[markEnclosingTag] operator[SEP] identifier[Flag] operator[SEP] identifier[HAS_TEXT] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@SuppressWarnings("UnusedDeclaration") public static String innerText(View view) { ShadowView shadowView = Shadow.extract(view); return shadowView.innerText(); }
class class_name[name] begin[{] method[innerText, return_type[type[String]], modifier[public static], parameter[view]] begin[{] local_variable[type[ShadowView], shadowView] return[call[shadowView.innerText, parameter[]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[String] identifier[innerText] operator[SEP] identifier[View] identifier[view] operator[SEP] { identifier[ShadowView] identifier[shadowView] operator[=] identifier[Shadow] operator[SEP] identifier[extract] operator[SEP] identifier[view] operator[SEP] operator[SEP] Keyword[return] identifier[shadowView] operator[SEP] identifier[innerText] operator[SEP] operator[SEP] operator[SEP] }
@Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public MeasureMap recordBatchedDoubleCount(Data data) { MeasureMap map = data.recorder.newMeasureMap(); for (int i = 0; i < data.numValues; i++) { map.put(StatsBenchmarksUtil.DOUBLE_COUNT_MEASURES[i], (double) i); } map.record(data.tags); return map; }
class class_name[name] begin[{] method[recordBatchedDoubleCount, return_type[type[MeasureMap]], modifier[public], parameter[data]] begin[{] local_variable[type[MeasureMap], map] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DOUBLE_COUNT_MEASURES, postfix_operators=[], prefix_operators=[], qualifier=StatsBenchmarksUtil, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), Cast(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double))], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numValues, postfix_operators=[], prefix_operators=[], qualifier=data, 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[map.record, parameter[member[data.tags]]] return[member[.map]] end[}] END[}]
annotation[@] identifier[Benchmark] annotation[@] identifier[BenchmarkMode] operator[SEP] identifier[Mode] operator[SEP] identifier[AverageTime] operator[SEP] annotation[@] identifier[OutputTimeUnit] operator[SEP] identifier[TimeUnit] operator[SEP] identifier[NANOSECONDS] operator[SEP] Keyword[public] identifier[MeasureMap] identifier[recordBatchedDoubleCount] operator[SEP] identifier[Data] identifier[data] operator[SEP] { identifier[MeasureMap] identifier[map] operator[=] identifier[data] operator[SEP] identifier[recorder] operator[SEP] identifier[newMeasureMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[data] operator[SEP] identifier[numValues] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[StatsBenchmarksUtil] operator[SEP] identifier[DOUBLE_COUNT_MEASURES] operator[SEP] identifier[i] operator[SEP] , operator[SEP] Keyword[double] operator[SEP] identifier[i] operator[SEP] operator[SEP] } identifier[map] operator[SEP] identifier[record] operator[SEP] identifier[data] operator[SEP] identifier[tags] operator[SEP] operator[SEP] Keyword[return] identifier[map] operator[SEP] }
public Observable<ServiceResponseWithHeaders<Void, PoolStopResizeHeaders>> stopResizeWithServiceResponseAsync(String poolId, PoolStopResizeOptions poolStopResizeOptions) { if (this.client.batchUrl() == null) { throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null."); } if (poolId == null) { throw new IllegalArgumentException("Parameter poolId is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(poolStopResizeOptions); Integer timeout = null; if (poolStopResizeOptions != null) { timeout = poolStopResizeOptions.timeout(); } UUID clientRequestId = null; if (poolStopResizeOptions != null) { clientRequestId = poolStopResizeOptions.clientRequestId(); } Boolean returnClientRequestId = null; if (poolStopResizeOptions != null) { returnClientRequestId = poolStopResizeOptions.returnClientRequestId(); } DateTime ocpDate = null; if (poolStopResizeOptions != null) { ocpDate = poolStopResizeOptions.ocpDate(); } String ifMatch = null; if (poolStopResizeOptions != null) { ifMatch = poolStopResizeOptions.ifMatch(); } String ifNoneMatch = null; if (poolStopResizeOptions != null) { ifNoneMatch = poolStopResizeOptions.ifNoneMatch(); } DateTime ifModifiedSince = null; if (poolStopResizeOptions != null) { ifModifiedSince = poolStopResizeOptions.ifModifiedSince(); } DateTime ifUnmodifiedSince = null; if (poolStopResizeOptions != null) { ifUnmodifiedSince = poolStopResizeOptions.ifUnmodifiedSince(); } String parameterizedHost = Joiner.on(", ").join("{batchUrl}", this.client.batchUrl()); DateTimeRfc1123 ocpDateConverted = null; if (ocpDate != null) { ocpDateConverted = new DateTimeRfc1123(ocpDate); } DateTimeRfc1123 ifModifiedSinceConverted = null; if (ifModifiedSince != null) { ifModifiedSinceConverted = new DateTimeRfc1123(ifModifiedSince); } DateTimeRfc1123 ifUnmodifiedSinceConverted = null; if (ifUnmodifiedSince != null) { ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince); } return service.stopResize(poolId, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, parameterizedHost, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<Void, PoolStopResizeHeaders>>>() { @Override public Observable<ServiceResponseWithHeaders<Void, PoolStopResizeHeaders>> call(Response<ResponseBody> response) { try { ServiceResponseWithHeaders<Void, PoolStopResizeHeaders> clientResponse = stopResizeDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[stopResizeWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[poolId, poolStopResizeOptions]] begin[{] if[binary_operation[THIS[member[None.client]call[None.batchUrl, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.batchUrl() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.poolId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter poolId is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[Validator.validate, parameter[member[.poolStopResizeOptions]]] local_variable[type[Integer], timeout] if[binary_operation[member[.poolStopResizeOptions], !=, literal[null]]] begin[{] assign[member[.timeout], call[poolStopResizeOptions.timeout, parameter[]]] else begin[{] None end[}] local_variable[type[UUID], clientRequestId] if[binary_operation[member[.poolStopResizeOptions], !=, literal[null]]] begin[{] assign[member[.clientRequestId], call[poolStopResizeOptions.clientRequestId, parameter[]]] else begin[{] None end[}] local_variable[type[Boolean], returnClientRequestId] if[binary_operation[member[.poolStopResizeOptions], !=, literal[null]]] begin[{] assign[member[.returnClientRequestId], call[poolStopResizeOptions.returnClientRequestId, parameter[]]] else begin[{] None end[}] local_variable[type[DateTime], ocpDate] if[binary_operation[member[.poolStopResizeOptions], !=, literal[null]]] begin[{] assign[member[.ocpDate], call[poolStopResizeOptions.ocpDate, parameter[]]] else begin[{] None end[}] local_variable[type[String], ifMatch] if[binary_operation[member[.poolStopResizeOptions], !=, literal[null]]] begin[{] assign[member[.ifMatch], call[poolStopResizeOptions.ifMatch, parameter[]]] else begin[{] None end[}] local_variable[type[String], ifNoneMatch] if[binary_operation[member[.poolStopResizeOptions], !=, literal[null]]] begin[{] assign[member[.ifNoneMatch], call[poolStopResizeOptions.ifNoneMatch, parameter[]]] else begin[{] None end[}] local_variable[type[DateTime], ifModifiedSince] if[binary_operation[member[.poolStopResizeOptions], !=, literal[null]]] begin[{] assign[member[.ifModifiedSince], call[poolStopResizeOptions.ifModifiedSince, parameter[]]] else begin[{] None end[}] local_variable[type[DateTime], ifUnmodifiedSince] if[binary_operation[member[.poolStopResizeOptions], !=, literal[null]]] begin[{] assign[member[.ifUnmodifiedSince], call[poolStopResizeOptions.ifUnmodifiedSince, parameter[]]] else begin[{] None end[}] local_variable[type[String], parameterizedHost] local_variable[type[DateTimeRfc1123], ocpDateConverted] if[binary_operation[member[.ocpDate], !=, literal[null]]] begin[{] assign[member[.ocpDateConverted], ClassCreator(arguments=[MemberReference(member=ocpDate, 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=DateTimeRfc1123, sub_type=None))] else begin[{] None end[}] local_variable[type[DateTimeRfc1123], ifModifiedSinceConverted] if[binary_operation[member[.ifModifiedSince], !=, literal[null]]] begin[{] assign[member[.ifModifiedSinceConverted], ClassCreator(arguments=[MemberReference(member=ifModifiedSince, 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=DateTimeRfc1123, sub_type=None))] else begin[{] None end[}] local_variable[type[DateTimeRfc1123], ifUnmodifiedSinceConverted] if[binary_operation[member[.ifUnmodifiedSince], !=, literal[null]]] begin[{] assign[member[.ifUnmodifiedSinceConverted], ClassCreator(arguments=[MemberReference(member=ifUnmodifiedSince, 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=DateTimeRfc1123, sub_type=None))] else begin[{] None end[}] return[call[service.stopResize, parameter[member[.poolId], THIS[member[None.client]call[None.apiVersion, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], member[.timeout], member[.clientRequestId], member[.returnClientRequestId], member[.ocpDateConverted], member[.ifMatch], member[.ifNoneMatch], member[.ifModifiedSinceConverted], member[.ifUnmodifiedSinceConverted], member[.parameterizedHost], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[Void] , identifier[PoolStopResizeHeaders] operator[>] operator[>] identifier[stopResizeWithServiceResponseAsync] operator[SEP] identifier[String] identifier[poolId] , identifier[PoolStopResizeOptions] identifier[poolStopResizeOptions] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[batchUrl] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[poolId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[poolStopResizeOptions] operator[SEP] operator[SEP] identifier[Integer] identifier[timeout] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[poolStopResizeOptions] operator[!=] Other[null] operator[SEP] { identifier[timeout] operator[=] identifier[poolStopResizeOptions] operator[SEP] identifier[timeout] operator[SEP] operator[SEP] operator[SEP] } identifier[UUID] identifier[clientRequestId] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[poolStopResizeOptions] operator[!=] Other[null] operator[SEP] { identifier[clientRequestId] operator[=] identifier[poolStopResizeOptions] operator[SEP] identifier[clientRequestId] operator[SEP] operator[SEP] operator[SEP] } identifier[Boolean] identifier[returnClientRequestId] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[poolStopResizeOptions] operator[!=] Other[null] operator[SEP] { identifier[returnClientRequestId] operator[=] identifier[poolStopResizeOptions] operator[SEP] identifier[returnClientRequestId] operator[SEP] operator[SEP] operator[SEP] } identifier[DateTime] identifier[ocpDate] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[poolStopResizeOptions] operator[!=] Other[null] operator[SEP] { identifier[ocpDate] operator[=] identifier[poolStopResizeOptions] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[ifMatch] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[poolStopResizeOptions] operator[!=] Other[null] operator[SEP] { identifier[ifMatch] operator[=] identifier[poolStopResizeOptions] operator[SEP] identifier[ifMatch] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[ifNoneMatch] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[poolStopResizeOptions] operator[!=] Other[null] operator[SEP] { identifier[ifNoneMatch] operator[=] identifier[poolStopResizeOptions] operator[SEP] identifier[ifNoneMatch] operator[SEP] operator[SEP] operator[SEP] } identifier[DateTime] identifier[ifModifiedSince] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[poolStopResizeOptions] operator[!=] Other[null] operator[SEP] { identifier[ifModifiedSince] operator[=] identifier[poolStopResizeOptions] operator[SEP] identifier[ifModifiedSince] operator[SEP] operator[SEP] operator[SEP] } identifier[DateTime] identifier[ifUnmodifiedSince] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[poolStopResizeOptions] operator[!=] Other[null] operator[SEP] { identifier[ifUnmodifiedSince] operator[=] identifier[poolStopResizeOptions] operator[SEP] identifier[ifUnmodifiedSince] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[parameterizedHost] operator[=] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[batchUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DateTimeRfc1123] identifier[ocpDateConverted] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ocpDate] operator[!=] Other[null] operator[SEP] { identifier[ocpDateConverted] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP] } identifier[DateTimeRfc1123] identifier[ifModifiedSinceConverted] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ifModifiedSince] operator[!=] Other[null] operator[SEP] { identifier[ifModifiedSinceConverted] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ifModifiedSince] operator[SEP] operator[SEP] } identifier[DateTimeRfc1123] identifier[ifUnmodifiedSinceConverted] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ifUnmodifiedSince] operator[!=] Other[null] operator[SEP] { identifier[ifUnmodifiedSinceConverted] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ifUnmodifiedSince] operator[SEP] operator[SEP] } Keyword[return] identifier[service] operator[SEP] identifier[stopResize] operator[SEP] identifier[poolId] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , identifier[timeout] , identifier[clientRequestId] , identifier[returnClientRequestId] , identifier[ocpDateConverted] , identifier[ifMatch] , identifier[ifNoneMatch] , identifier[ifModifiedSinceConverted] , identifier[ifUnmodifiedSinceConverted] , identifier[parameterizedHost] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[Void] , identifier[PoolStopResizeHeaders] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[Void] , identifier[PoolStopResizeHeaders] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponseWithHeaders] operator[<] identifier[Void] , identifier[PoolStopResizeHeaders] operator[>] identifier[clientResponse] operator[=] identifier[stopResizeDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public java.util.List<String> getClusterArns() { if (clusterArns == null) { clusterArns = new com.amazonaws.internal.SdkInternalList<String>(); } return clusterArns; }
class class_name[name] begin[{] method[getClusterArns, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.clusterArns], ==, literal[null]]] begin[{] assign[member[.clusterArns], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.clusterArns]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[getClusterArns] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[clusterArns] operator[==] Other[null] operator[SEP] { identifier[clusterArns] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[clusterArns] operator[SEP] }
private ClassLoader initSystemClassLoader() throws IOException { String sysClassPath = getSystemClassPath(); if (sysClassPath == null) { return null; } ArrayList<URL> urls = new ArrayList<URL>(); StringTokenizer tokenizer = new StringTokenizer(sysClassPath, File.pathSeparator); while (tokenizer.hasMoreTokens()) { urls.add(new File(tokenizer.nextToken()).toURL()); } if (urls.size() == 0) { return null; } URL urlsArray[] = new URL[urls.size()]; urls.toArray(urlsArray); return new URLClassLoader(urlsArray, this.getClass().getClassLoader()); }
class class_name[name] begin[{] method[initSystemClassLoader, return_type[type[ClassLoader]], modifier[private], parameter[]] begin[{] local_variable[type[String], sysClassPath] if[binary_operation[member[.sysClassPath], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[ArrayList], urls] local_variable[type[StringTokenizer], tokenizer] while[call[tokenizer.hasMoreTokens, parameter[]]] begin[{] call[urls.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=tokenizer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toURL, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]] end[}] if[binary_operation[call[urls.size, parameter[]], ==, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[URL], urlsArray] call[urls.toArray, parameter[member[.urlsArray]]] return[ClassCreator(arguments=[MemberReference(member=urlsArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URLClassLoader, sub_type=None))] end[}] END[}]
Keyword[private] identifier[ClassLoader] identifier[initSystemClassLoader] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[sysClassPath] operator[=] identifier[getSystemClassPath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sysClassPath] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[ArrayList] operator[<] identifier[URL] operator[>] identifier[urls] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[URL] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[StringTokenizer] identifier[tokenizer] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[sysClassPath] , identifier[File] operator[SEP] identifier[pathSeparator] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[tokenizer] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] { identifier[urls] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[tokenizer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toURL] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[urls] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[URL] identifier[urlsArray] operator[SEP] operator[SEP] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[urls] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[urls] operator[SEP] identifier[toArray] operator[SEP] identifier[urlsArray] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[URLClassLoader] operator[SEP] identifier[urlsArray] , Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
Key getSharedSecretKey(JwtConsumerConfig config) throws KeyException { if (config == null) { if (tc.isDebugEnabled()) { Tr.debug(tc, "JWT consumer config object is null"); } return null; } String sharedKey = config.getSharedKey(); return createKeyFromSharedKey(sharedKey); }
class class_name[name] begin[{] method[getSharedSecretKey, return_type[type[Key]], modifier[default], parameter[config]] begin[{] if[binary_operation[member[.config], ==, literal[null]]] begin[{] if[call[tc.isDebugEnabled, parameter[]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["JWT consumer config object is null"]]] else begin[{] None end[}] return[literal[null]] else begin[{] None end[}] local_variable[type[String], sharedKey] return[call[.createKeyFromSharedKey, parameter[member[.sharedKey]]]] end[}] END[}]
identifier[Key] identifier[getSharedSecretKey] operator[SEP] identifier[JwtConsumerConfig] identifier[config] operator[SEP] Keyword[throws] identifier[KeyException] { Keyword[if] operator[SEP] identifier[config] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } identifier[String] identifier[sharedKey] operator[=] identifier[config] operator[SEP] identifier[getSharedKey] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[createKeyFromSharedKey] operator[SEP] identifier[sharedKey] operator[SEP] operator[SEP] }
private int configUpdateInProgress() { int retVal; configUpdatePendingQueueLock.writeLock().lock(); try { retVal = configUpdatesInProgress; configUpdatesInProgress++; } finally { configUpdatePendingQueueLock.writeLock().unlock(); } return retVal; }
class class_name[name] begin[{] method[configUpdateInProgress, return_type[type[int]], modifier[private], parameter[]] begin[{] local_variable[type[int], retVal] call[configUpdatePendingQueueLock.writeLock, parameter[]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=retVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=configUpdatesInProgress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MemberReference(member=configUpdatesInProgress, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeLock, postfix_operators=[], prefix_operators=[], qualifier=configUpdatePendingQueueLock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None) return[member[.retVal]] end[}] END[}]
Keyword[private] Keyword[int] identifier[configUpdateInProgress] operator[SEP] operator[SEP] { Keyword[int] identifier[retVal] operator[SEP] identifier[configUpdatePendingQueueLock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[retVal] operator[=] identifier[configUpdatesInProgress] operator[SEP] identifier[configUpdatesInProgress] operator[++] operator[SEP] } Keyword[finally] { identifier[configUpdatePendingQueueLock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[retVal] operator[SEP] }
public void freeIfDone() { boolean bValidAppFound = false; for (int i = 0; i < this.getApplicationCount(); i++) { Application application = (Application)this.m_vApplication.get(i); if (!DBConstants.FALSE.equalsIgnoreCase(this.getProperty(DBParams.FREEIFDONE))) if (application == this.getDefaultApplication()) if (this.isApplicationDone(application)) continue; if (application instanceof MessageApp) continue; bValidAppFound = true; } if (!bValidAppFound) this.free(); }
class class_name[name] begin[{] method[freeIfDone, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[boolean], bValidAppFound] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=m_vApplication, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=Application, sub_type=None)), name=application)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Application, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=FREEIFDONE, postfix_operators=[], prefix_operators=[], qualifier=DBParams, selectors=[])], member=getProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=['!'], qualifier=DBConstants.FALSE, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=application, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getDefaultApplication, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator===), else_statement=None, label=None, then_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=application, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isApplicationDone, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=application, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=MessageApp, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bValidAppFound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getApplicationCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[member[.bValidAppFound]] begin[{] THIS[call[None.free, parameter[]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[freeIfDone] operator[SEP] operator[SEP] { Keyword[boolean] identifier[bValidAppFound] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[getApplicationCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Application] identifier[application] operator[=] operator[SEP] identifier[Application] operator[SEP] Keyword[this] operator[SEP] identifier[m_vApplication] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[DBConstants] operator[SEP] identifier[FALSE] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[DBParams] operator[SEP] identifier[FREEIFDONE] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[application] operator[==] Keyword[this] operator[SEP] identifier[getDefaultApplication] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isApplicationDone] operator[SEP] identifier[application] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[application] Keyword[instanceof] identifier[MessageApp] operator[SEP] Keyword[continue] operator[SEP] identifier[bValidAppFound] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[bValidAppFound] operator[SEP] Keyword[this] operator[SEP] identifier[free] operator[SEP] operator[SEP] operator[SEP] }
@Override public void shutdown() throws InterruptedException { m_shutdown.set(true); m_es.shutdown(); m_es.awaitTermination(356, TimeUnit.DAYS); }
class class_name[name] begin[{] method[shutdown, return_type[void], modifier[public], parameter[]] begin[{] call[m_shutdown.set, parameter[literal[true]]] call[m_es.shutdown, parameter[]] call[m_es.awaitTermination, parameter[literal[356], member[TimeUnit.DAYS]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[shutdown] operator[SEP] operator[SEP] Keyword[throws] identifier[InterruptedException] { identifier[m_shutdown] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[m_es] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] identifier[m_es] operator[SEP] identifier[awaitTermination] operator[SEP] Other[356] , identifier[TimeUnit] operator[SEP] identifier[DAYS] operator[SEP] operator[SEP] }
protected String getStringImpl() throws SQLException { try { return StringConverter.inputStreamToString(getBinaryStreamImpl(), "US-ASCII"); } catch (IOException ex) { throw Exceptions.transformFailed(ex); } }
class class_name[name] begin[{] method[getStringImpl, return_type[type[String]], modifier[protected], parameter[]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBinaryStreamImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="US-ASCII")], member=inputStreamToString, postfix_operators=[], prefix_operators=[], qualifier=StringConverter, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transformFailed, postfix_operators=[], prefix_operators=[], qualifier=Exceptions, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] identifier[String] identifier[getStringImpl] operator[SEP] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[try] { Keyword[return] identifier[StringConverter] operator[SEP] identifier[inputStreamToString] operator[SEP] identifier[getBinaryStreamImpl] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] { Keyword[throw] identifier[Exceptions] operator[SEP] identifier[transformFailed] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
public static Exchange createExchangeFromJsonConfiguration() throws IOException { ExchangeSpecification exSpec = new ExchangeSpecification(BitcoindeExchange.class); ObjectMapper mapper = new ObjectMapper(); InputStream is = ExchangeUtils.class .getClassLoader() .getResourceAsStream("bitcoinde/exchangeConfiguration.json"); if (is == null) { // logger.warn("No bitcoinde/exchangeConfiguration.json file found. Returning null // exchange."); return null; } try { ExchangeConfiguration conf = mapper.readValue(is, ExchangeConfiguration.class); // logger.debug(conf.toString()); if (conf.apiKey != null) exSpec.setApiKey(conf.apiKey); if (conf.secretKey != null) exSpec.setSecretKey(conf.secretKey); } catch (Exception e) { // logger.warn("An exception occured while loading the bitcoinde/exchangeConfiguration.json // file from the classpath. " + "Returning null exchange.", e); return null; } Exchange exchange = ExchangeFactory.INSTANCE.createExchange(exSpec); exchange.remoteInit(); return exchange; }
class class_name[name] begin[{] method[createExchangeFromJsonConfiguration, return_type[type[Exchange]], modifier[public static], parameter[]] begin[{] local_variable[type[ExchangeSpecification], exSpec] local_variable[type[ObjectMapper], mapper] local_variable[type[InputStream], is] if[binary_operation[member[.is], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExchangeConfiguration, sub_type=None))], member=readValue, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None), name=conf)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExchangeConfiguration, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=apiKey, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=apiKey, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[])], member=setApiKey, postfix_operators=[], prefix_operators=[], qualifier=exSpec, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=secretKey, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=secretKey, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[])], member=setSecretKey, postfix_operators=[], prefix_operators=[], qualifier=exSpec, selectors=[], type_arguments=None), label=None))], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) local_variable[type[Exchange], exchange] call[exchange.remoteInit, parameter[]] return[member[.exchange]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Exchange] identifier[createExchangeFromJsonConfiguration] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[ExchangeSpecification] identifier[exSpec] operator[=] Keyword[new] identifier[ExchangeSpecification] operator[SEP] identifier[BitcoindeExchange] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[ObjectMapper] identifier[mapper] operator[=] Keyword[new] identifier[ObjectMapper] operator[SEP] operator[SEP] operator[SEP] identifier[InputStream] identifier[is] operator[=] identifier[ExchangeUtils] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceAsStream] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[is] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[try] { identifier[ExchangeConfiguration] identifier[conf] operator[=] identifier[mapper] operator[SEP] identifier[readValue] operator[SEP] identifier[is] , identifier[ExchangeConfiguration] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conf] operator[SEP] identifier[apiKey] operator[!=] Other[null] operator[SEP] identifier[exSpec] operator[SEP] identifier[setApiKey] operator[SEP] identifier[conf] operator[SEP] identifier[apiKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conf] operator[SEP] identifier[secretKey] operator[!=] Other[null] operator[SEP] identifier[exSpec] operator[SEP] identifier[setSecretKey] operator[SEP] identifier[conf] operator[SEP] identifier[secretKey] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Exchange] identifier[exchange] operator[=] identifier[ExchangeFactory] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[createExchange] operator[SEP] identifier[exSpec] operator[SEP] operator[SEP] identifier[exchange] operator[SEP] identifier[remoteInit] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[exchange] operator[SEP] }
private static void triggerGc(Integer pid) { VirtualMachine vm = null; try { vm = VirtualMachine.attach(String.valueOf(pid)); HotSpotVirtualMachine hvm = (HotSpotVirtualMachine) vm; try (InputStream in = hvm.executeJCmd("GC.run");) { byte b[] = new byte[256]; int n; do { n = in.read(b); if (n > 0) { String s = new String(b, 0, n, "UTF-8"); tty.print(s); } } while (n > 0); tty.println(); } } catch (Exception e) { tty.println(e.getMessage()); } finally { if (vm != null) { try { vm.detach(); } catch (IOException e) { tty.println(e.getMessage()); } } } }
class class_name[name] begin[{] method[triggerGc, return_type[void], modifier[private static], parameter[pid]] begin[{] local_variable[type[VirtualMachine], vm] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=vm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=attach, postfix_operators=[], prefix_operators=[], qualifier=VirtualMachine, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=vm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HotSpotVirtualMachine, sub_type=None)), name=hvm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HotSpotVirtualMachine, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=n)], modifiers=set(), type=BasicType(dimensions=[], name=int)), DoStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=tty, selectors=[], type_arguments=None), label=None)]))]), condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=println, postfix_operators=[], prefix_operators=[], qualifier=tty, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=in, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GC.run")], member=executeJCmd, postfix_operators=[], prefix_operators=[], qualifier=hvm, selectors=[], type_arguments=None))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=tty, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=vm, 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=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=detach, postfix_operators=[], prefix_operators=[], qualifier=vm, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=tty, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)]))], label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[triggerGc] operator[SEP] identifier[Integer] identifier[pid] operator[SEP] { identifier[VirtualMachine] identifier[vm] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[vm] operator[=] identifier[VirtualMachine] operator[SEP] identifier[attach] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[pid] operator[SEP] operator[SEP] operator[SEP] identifier[HotSpotVirtualMachine] identifier[hvm] operator[=] operator[SEP] identifier[HotSpotVirtualMachine] operator[SEP] identifier[vm] operator[SEP] Keyword[try] operator[SEP] identifier[InputStream] identifier[in] operator[=] identifier[hvm] operator[SEP] identifier[executeJCmd] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] { Keyword[byte] identifier[b] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[256] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[SEP] Keyword[do] { identifier[n] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] identifier[b] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[>] Other[0] operator[SEP] { identifier[String] identifier[s] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[b] , Other[0] , identifier[n] , literal[String] operator[SEP] operator[SEP] identifier[tty] operator[SEP] identifier[print] operator[SEP] identifier[s] operator[SEP] operator[SEP] } } Keyword[while] operator[SEP] identifier[n] operator[>] Other[0] operator[SEP] operator[SEP] identifier[tty] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[tty] operator[SEP] identifier[println] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[vm] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[vm] operator[SEP] identifier[detach] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[tty] operator[SEP] identifier[println] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } }
protected Format getFormat(Map<String,String> metaInfo) { Format format = Format.json; metaInfo.put(Listener.METAINFO_CONTENT_TYPE, Listener.CONTENT_TYPE_JSON); String formatParam = (String) metaInfo.get("format"); if (formatParam != null) { if (formatParam.equals("xml")) { format = Format.xml; metaInfo.put(Listener.METAINFO_CONTENT_TYPE, Listener.CONTENT_TYPE_XML); } else if (formatParam.equals("text")) { format = Format.text; metaInfo.put(Listener.METAINFO_CONTENT_TYPE, Listener.CONTENT_TYPE_TEXT); } } else { if (Listener.CONTENT_TYPE_XML.equals(metaInfo.get(Listener.METAINFO_CONTENT_TYPE)) || Listener.CONTENT_TYPE_XML.equals(metaInfo.get(Listener.METAINFO_CONTENT_TYPE.toLowerCase()))) { format = Format.xml; metaInfo.put(Listener.METAINFO_CONTENT_TYPE, Listener.CONTENT_TYPE_XML); } else if (Listener.CONTENT_TYPE_TEXT.equals(metaInfo.get(Listener.METAINFO_CONTENT_TYPE)) || Listener.CONTENT_TYPE_TEXT.equals(metaInfo.get(Listener.METAINFO_CONTENT_TYPE.toLowerCase()))) { format = Format.text; metaInfo.put(Listener.METAINFO_CONTENT_TYPE, Listener.CONTENT_TYPE_JSON); } } return format; }
class class_name[name] begin[{] method[getFormat, return_type[type[Format]], modifier[protected], parameter[metaInfo]] begin[{] local_variable[type[Format], format] call[metaInfo.put, parameter[member[Listener.METAINFO_CONTENT_TYPE], member[Listener.CONTENT_TYPE_JSON]]] local_variable[type[String], formatParam] if[binary_operation[member[.formatParam], !=, literal[null]]] begin[{] if[call[formatParam.equals, parameter[literal["xml"]]]] begin[{] assign[member[.format], member[Format.xml]] call[metaInfo.put, parameter[member[Listener.METAINFO_CONTENT_TYPE], member[Listener.CONTENT_TYPE_XML]]] else begin[{] if[call[formatParam.equals, parameter[literal["text"]]]] begin[{] assign[member[.format], member[Format.text]] call[metaInfo.put, parameter[member[Listener.METAINFO_CONTENT_TYPE], member[Listener.CONTENT_TYPE_TEXT]]] else begin[{] None end[}] end[}] else begin[{] if[binary_operation[call[Listener.CONTENT_TYPE_XML.equals, parameter[call[metaInfo.get, parameter[member[Listener.METAINFO_CONTENT_TYPE]]]]], ||, call[Listener.CONTENT_TYPE_XML.equals, parameter[call[metaInfo.get, parameter[call[Listener.METAINFO_CONTENT_TYPE.toLowerCase, parameter[]]]]]]]] begin[{] assign[member[.format], member[Format.xml]] call[metaInfo.put, parameter[member[Listener.METAINFO_CONTENT_TYPE], member[Listener.CONTENT_TYPE_XML]]] else begin[{] if[binary_operation[call[Listener.CONTENT_TYPE_TEXT.equals, parameter[call[metaInfo.get, parameter[member[Listener.METAINFO_CONTENT_TYPE]]]]], ||, call[Listener.CONTENT_TYPE_TEXT.equals, parameter[call[metaInfo.get, parameter[call[Listener.METAINFO_CONTENT_TYPE.toLowerCase, parameter[]]]]]]]] begin[{] assign[member[.format], member[Format.text]] call[metaInfo.put, parameter[member[Listener.METAINFO_CONTENT_TYPE], member[Listener.CONTENT_TYPE_JSON]]] else begin[{] None end[}] end[}] end[}] return[member[.format]] end[}] END[}]
Keyword[protected] identifier[Format] identifier[getFormat] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[metaInfo] operator[SEP] { identifier[Format] identifier[format] operator[=] identifier[Format] operator[SEP] identifier[json] operator[SEP] identifier[metaInfo] operator[SEP] identifier[put] operator[SEP] identifier[Listener] operator[SEP] identifier[METAINFO_CONTENT_TYPE] , identifier[Listener] operator[SEP] identifier[CONTENT_TYPE_JSON] operator[SEP] operator[SEP] identifier[String] identifier[formatParam] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[metaInfo] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[formatParam] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[formatParam] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[format] operator[=] identifier[Format] operator[SEP] identifier[xml] operator[SEP] identifier[metaInfo] operator[SEP] identifier[put] operator[SEP] identifier[Listener] operator[SEP] identifier[METAINFO_CONTENT_TYPE] , identifier[Listener] operator[SEP] identifier[CONTENT_TYPE_XML] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[formatParam] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[format] operator[=] identifier[Format] operator[SEP] identifier[text] operator[SEP] identifier[metaInfo] operator[SEP] identifier[put] operator[SEP] identifier[Listener] operator[SEP] identifier[METAINFO_CONTENT_TYPE] , identifier[Listener] operator[SEP] identifier[CONTENT_TYPE_TEXT] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[Listener] operator[SEP] identifier[CONTENT_TYPE_XML] operator[SEP] identifier[equals] operator[SEP] identifier[metaInfo] operator[SEP] identifier[get] operator[SEP] identifier[Listener] operator[SEP] identifier[METAINFO_CONTENT_TYPE] operator[SEP] operator[SEP] operator[||] identifier[Listener] operator[SEP] identifier[CONTENT_TYPE_XML] operator[SEP] identifier[equals] operator[SEP] identifier[metaInfo] operator[SEP] identifier[get] operator[SEP] identifier[Listener] operator[SEP] identifier[METAINFO_CONTENT_TYPE] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[format] operator[=] identifier[Format] operator[SEP] identifier[xml] operator[SEP] identifier[metaInfo] operator[SEP] identifier[put] operator[SEP] identifier[Listener] operator[SEP] identifier[METAINFO_CONTENT_TYPE] , identifier[Listener] operator[SEP] identifier[CONTENT_TYPE_XML] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Listener] operator[SEP] identifier[CONTENT_TYPE_TEXT] operator[SEP] identifier[equals] operator[SEP] identifier[metaInfo] operator[SEP] identifier[get] operator[SEP] identifier[Listener] operator[SEP] identifier[METAINFO_CONTENT_TYPE] operator[SEP] operator[SEP] operator[||] identifier[Listener] operator[SEP] identifier[CONTENT_TYPE_TEXT] operator[SEP] identifier[equals] operator[SEP] identifier[metaInfo] operator[SEP] identifier[get] operator[SEP] identifier[Listener] operator[SEP] identifier[METAINFO_CONTENT_TYPE] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[format] operator[=] identifier[Format] operator[SEP] identifier[text] operator[SEP] identifier[metaInfo] operator[SEP] identifier[put] operator[SEP] identifier[Listener] operator[SEP] identifier[METAINFO_CONTENT_TYPE] , identifier[Listener] operator[SEP] identifier[CONTENT_TYPE_JSON] operator[SEP] operator[SEP] } } Keyword[return] identifier[format] operator[SEP] }
public void marshall(ExportBackupPlanTemplateRequest exportBackupPlanTemplateRequest, ProtocolMarshaller protocolMarshaller) { if (exportBackupPlanTemplateRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(exportBackupPlanTemplateRequest.getBackupPlanId(), BACKUPPLANID_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[exportBackupPlanTemplateRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.exportBackupPlanTemplateRequest], ==, 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=getBackupPlanId, postfix_operators=[], prefix_operators=[], qualifier=exportBackupPlanTemplateRequest, selectors=[], type_arguments=None), MemberReference(member=BACKUPPLANID_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[ExportBackupPlanTemplateRequest] identifier[exportBackupPlanTemplateRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[exportBackupPlanTemplateRequest] 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[exportBackupPlanTemplateRequest] operator[SEP] identifier[getBackupPlanId] operator[SEP] operator[SEP] , identifier[BACKUPPLANID_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 renderSelectOptions(FacesContext context, UIComponent component, Converter converter, Set lookupSet, List selectItemList) throws IOException { ResponseWriter writer = context.getResponseWriter(); // check for the hideNoSelectionOption attribute boolean hideNoSelectionOption = isHideNoSelectionOption(component); boolean componentDisabled = isTrue(component.getAttributes() .get("disabled")); for (Iterator it = selectItemList.iterator(); it.hasNext();) { SelectItem selectItem = (SelectItem) it.next(); if (selectItem instanceof SelectItemGroup) { writer.startElement(HTML.OPTGROUP_ELEM, null); // component); writer.writeAttribute(HTML.LABEL_ATTR, selectItem.getLabel(), null); SelectItem[] selectItems = ((SelectItemGroup) selectItem) .getSelectItems(); renderSelectOptions(context, component, converter, lookupSet, Arrays.asList(selectItems)); writer.endElement(HTML.OPTGROUP_ELEM); } else { String itemStrValue = org.apache.myfaces.shared.renderkit.RendererUtils .getConvertedStringValue(context, component, converter, selectItem); boolean selected = lookupSet.contains(itemStrValue); //TODO/FIX: we always compare the String vales, better fill lookupSet with Strings //only when useSubmittedValue==true, else use the real item value Objects // IF the hideNoSelectionOption attribute of the component is true // AND this selectItem is the "no selection option" // AND there are currently selected items // AND this item (the "no selection option") is not selected // (if there is currently no value on UISelectOne, lookupSet contains "") if (hideNoSelectionOption && selectItem.isNoSelectionOption() && lookupSet.size() != 0 && !(lookupSet.size() == 1 && lookupSet.contains("")) && !selected) { // do not render this selectItem continue; } writer.write(TABULATOR); writer.startElement(HTML.OPTION_ELEM, null); // component); if (itemStrValue != null) { writer.writeAttribute(HTML.VALUE_ATTR, itemStrValue, null); } else { writer.writeAttribute(HTML.VALUE_ATTR, "", null); } if (selected) { writer.writeAttribute(HTML.SELECTED_ATTR, HTML.SELECTED_ATTR, null); } boolean disabled = selectItem.isDisabled(); if (disabled) { writer.writeAttribute(HTML.DISABLED_ATTR, HTML.DISABLED_ATTR, null); } String labelClass = null; if (componentDisabled || disabled) { labelClass = (String) component.getAttributes().get( JSFAttr.DISABLED_CLASS_ATTR); } else { labelClass = (String) component.getAttributes().get( JSFAttr.ENABLED_CLASS_ATTR); } if (labelClass != null) { writer.writeAttribute("class", labelClass, "labelClass"); } boolean escape; if (component instanceof EscapeCapable) { escape = ((EscapeCapable) component).isEscape(); // Preserve tomahawk semantic. If escape=false // all items should be non escaped. If escape // is true check if selectItem.isEscape() is // true and do it. // This is done for remain compatibility. if (escape && selectItem.isEscape()) { writer.writeText(selectItem.getLabel(), null); } else { writer.write(selectItem.getLabel()); } } else { escape = RendererUtils.getBooleanAttribute(component, JSFAttr.ESCAPE_ATTR, false); //default is to escape //In JSF 1.2, when a SelectItem is created by default //selectItem.isEscape() returns true (this property //is not available on JSF 1.1). //so, if we found a escape property on the component //set to true, escape every item, but if not //check if isEscape() = true first. if (escape || selectItem.isEscape()) { writer.writeText(selectItem.getLabel(), null); } else { writer.write(selectItem.getLabel()); } } writer.endElement(HTML.OPTION_ELEM); } } }
class class_name[name] begin[{] method[renderSelectOptions, return_type[void], modifier[public static], parameter[context, component, converter, lookupSet, selectItemList]] begin[{] local_variable[type[ResponseWriter], writer] local_variable[type[boolean], hideNoSelectionOption] local_variable[type[boolean], componentDisabled] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SelectItem, sub_type=None)), name=selectItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SelectItem, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=selectItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SelectItemGroup, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=selectItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConvertedStringValue, postfix_operators=[], prefix_operators=[], qualifier=org.apache.myfaces.shared.renderkit.RendererUtils, selectors=[], type_arguments=None), name=itemStrValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=itemStrValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=lookupSet, selectors=[], type_arguments=None), name=selected)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=hideNoSelectionOption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isNoSelectionOption, postfix_operators=[], prefix_operators=[], qualifier=selectItem, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=lookupSet, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=lookupSet, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=lookupSet, selectors=[], type_arguments=None), operator=&&), operator=&&), operandr=MemberReference(member=selected, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TABULATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OPTION_ELEM, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=startElement, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=itemStrValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VALUE_ATTR, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=writeAttribute, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VALUE_ATTR, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[]), MemberReference(member=itemStrValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=writeAttribute, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MemberReference(member=selected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SELECTED_ATTR, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[]), MemberReference(member=SELECTED_ATTR, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=writeAttribute, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=isDisabled, postfix_operators=[], prefix_operators=[], qualifier=selectItem, selectors=[], type_arguments=None), name=disabled)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=disabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DISABLED_ATTR, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[]), MemberReference(member=DISABLED_ATTR, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=writeAttribute, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=labelClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=componentDisabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=disabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=labelClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[MethodInvocation(arguments=[MemberReference(member=ENABLED_CLASS_ATTR, postfix_operators=[], prefix_operators=[], qualifier=JSFAttr, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=labelClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[MethodInvocation(arguments=[MemberReference(member=DISABLED_CLASS_ATTR, postfix_operators=[], prefix_operators=[], qualifier=JSFAttr, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=labelClass, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="class"), MemberReference(member=labelClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="labelClass")], member=writeAttribute, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=escape)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=EscapeCapable, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=escape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ESCAPE_ATTR, postfix_operators=[], prefix_operators=[], qualifier=JSFAttr, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getBooleanAttribute, postfix_operators=[], prefix_operators=[], qualifier=RendererUtils, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=escape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isEscape, postfix_operators=[], prefix_operators=[], qualifier=selectItem, selectors=[], type_arguments=None), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=selectItem, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=selectItem, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=writeText, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=escape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EscapeCapable, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=escape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isEscape, postfix_operators=[], prefix_operators=[], qualifier=selectItem, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=selectItem, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=selectItem, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=writeText, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OPTION_ELEM, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[])], member=endElement, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OPTGROUP_ELEM, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=startElement, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LABEL_ATTR, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[]), MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=selectItem, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=writeAttribute, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=selectItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SelectItemGroup, sub_type=None)), name=selectItems)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=SelectItem, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lookupSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=selectItems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=renderSelectOptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OPTGROUP_ELEM, postfix_operators=[], prefix_operators=[], qualifier=HTML, selectors=[])], member=endElement, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=selectItemList, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[renderSelectOptions] operator[SEP] identifier[FacesContext] identifier[context] , identifier[UIComponent] identifier[component] , identifier[Converter] identifier[converter] , identifier[Set] identifier[lookupSet] , identifier[List] identifier[selectItemList] operator[SEP] Keyword[throws] identifier[IOException] { identifier[ResponseWriter] identifier[writer] operator[=] identifier[context] operator[SEP] identifier[getResponseWriter] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[hideNoSelectionOption] operator[=] identifier[isHideNoSelectionOption] operator[SEP] identifier[component] operator[SEP] operator[SEP] Keyword[boolean] identifier[componentDisabled] operator[=] identifier[isTrue] operator[SEP] identifier[component] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] identifier[it] operator[=] identifier[selectItemList] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[SelectItem] identifier[selectItem] operator[=] operator[SEP] identifier[SelectItem] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selectItem] Keyword[instanceof] identifier[SelectItemGroup] operator[SEP] { identifier[writer] operator[SEP] identifier[startElement] operator[SEP] identifier[HTML] operator[SEP] identifier[OPTGROUP_ELEM] , Other[null] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] identifier[HTML] operator[SEP] identifier[LABEL_ATTR] , identifier[selectItem] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] identifier[SelectItem] operator[SEP] operator[SEP] identifier[selectItems] operator[=] operator[SEP] operator[SEP] identifier[SelectItemGroup] operator[SEP] identifier[selectItem] operator[SEP] operator[SEP] identifier[getSelectItems] operator[SEP] operator[SEP] operator[SEP] identifier[renderSelectOptions] operator[SEP] identifier[context] , identifier[component] , identifier[converter] , identifier[lookupSet] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[selectItems] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[endElement] operator[SEP] identifier[HTML] operator[SEP] identifier[OPTGROUP_ELEM] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] identifier[itemStrValue] operator[=] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[myfaces] operator[SEP] identifier[shared] operator[SEP] identifier[renderkit] operator[SEP] identifier[RendererUtils] operator[SEP] identifier[getConvertedStringValue] operator[SEP] identifier[context] , identifier[component] , identifier[converter] , identifier[selectItem] operator[SEP] operator[SEP] Keyword[boolean] identifier[selected] operator[=] identifier[lookupSet] operator[SEP] identifier[contains] operator[SEP] identifier[itemStrValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hideNoSelectionOption] operator[&&] identifier[selectItem] operator[SEP] identifier[isNoSelectionOption] operator[SEP] operator[SEP] operator[&&] identifier[lookupSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] Other[0] operator[&&] operator[!] operator[SEP] identifier[lookupSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[lookupSet] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[selected] operator[SEP] { Keyword[continue] operator[SEP] } identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[TABULATOR] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[startElement] operator[SEP] identifier[HTML] operator[SEP] identifier[OPTION_ELEM] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[itemStrValue] operator[!=] Other[null] operator[SEP] { identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] identifier[HTML] operator[SEP] identifier[VALUE_ATTR] , identifier[itemStrValue] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] identifier[HTML] operator[SEP] identifier[VALUE_ATTR] , literal[String] , Other[null] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[selected] operator[SEP] { identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] identifier[HTML] operator[SEP] identifier[SELECTED_ATTR] , identifier[HTML] operator[SEP] identifier[SELECTED_ATTR] , Other[null] operator[SEP] operator[SEP] } Keyword[boolean] identifier[disabled] operator[=] identifier[selectItem] operator[SEP] identifier[isDisabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[disabled] operator[SEP] { identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] identifier[HTML] operator[SEP] identifier[DISABLED_ATTR] , identifier[HTML] operator[SEP] identifier[DISABLED_ATTR] , Other[null] operator[SEP] operator[SEP] } identifier[String] identifier[labelClass] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[componentDisabled] operator[||] identifier[disabled] operator[SEP] { identifier[labelClass] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[component] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[JSFAttr] operator[SEP] identifier[DISABLED_CLASS_ATTR] operator[SEP] operator[SEP] } Keyword[else] { identifier[labelClass] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[component] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[JSFAttr] operator[SEP] identifier[ENABLED_CLASS_ATTR] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[labelClass] operator[!=] Other[null] operator[SEP] { identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[labelClass] , literal[String] operator[SEP] operator[SEP] } Keyword[boolean] identifier[escape] operator[SEP] Keyword[if] operator[SEP] identifier[component] Keyword[instanceof] identifier[EscapeCapable] operator[SEP] { identifier[escape] operator[=] operator[SEP] operator[SEP] identifier[EscapeCapable] operator[SEP] identifier[component] operator[SEP] operator[SEP] identifier[isEscape] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[escape] operator[&&] identifier[selectItem] operator[SEP] identifier[isEscape] operator[SEP] operator[SEP] operator[SEP] { identifier[writer] operator[SEP] identifier[writeText] operator[SEP] identifier[selectItem] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[selectItem] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[escape] operator[=] identifier[RendererUtils] operator[SEP] identifier[getBooleanAttribute] operator[SEP] identifier[component] , identifier[JSFAttr] operator[SEP] identifier[ESCAPE_ATTR] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[escape] operator[||] identifier[selectItem] operator[SEP] identifier[isEscape] operator[SEP] operator[SEP] operator[SEP] { identifier[writer] operator[SEP] identifier[writeText] operator[SEP] identifier[selectItem] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[selectItem] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[writer] operator[SEP] identifier[endElement] operator[SEP] identifier[HTML] operator[SEP] identifier[OPTION_ELEM] operator[SEP] operator[SEP] } } }
@Override public void init() throws ServletException { if (LOG.isInfoEnabled()) { LOG.info(Messages.get().getBundle().key(Messages.LOG_INIT_WEBDAV_SERVLET_0)); } String value = null; // init parameter: listings try { value = getServletConfig().getInitParameter(INIT_PARAM_LIST); if (value != null) { m_listings = Boolean.valueOf(value).booleanValue(); } } catch (Exception e) { if (LOG.isErrorEnabled()) { LOG.error( Messages.get().getBundle().key(Messages.LOG_READ_INIT_PARAM_ERROR_2, INIT_PARAM_LIST, value), e); } } if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_READ_INIT_PARAM_2, INIT_PARAM_LIST, Boolean.valueOf(m_listings))); } // init parameter: read only try { value = getServletConfig().getInitParameter(INIT_PARAM_READONLY); if (value != null) { m_readOnly = Boolean.valueOf(value).booleanValue(); } } catch (Exception e) { if (LOG.isErrorEnabled()) { LOG.error( Messages.get().getBundle().key(Messages.LOG_READ_INIT_PARAM_ERROR_2, INIT_PARAM_READONLY, value), e); } } if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_READ_INIT_PARAM_2, INIT_PARAM_READONLY, Boolean.valueOf(m_readOnly))); } // Load the MD5 helper used to calculate signatures. try { m_md5Helper = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle().key(Messages.ERR_MD5_NOT_AVAILABLE_0), e); } throw new UnavailableException(Messages.get().getBundle().key(Messages.ERR_MD5_NOT_AVAILABLE_0)); } // Instantiate repository from init-param String repositoryName = getInitParameter(INIT_PARAM_REPOSITORY); if (repositoryName == null) { if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle().key(Messages.ERR_INIT_PARAM_MISSING_1, INIT_PARAM_REPOSITORY)); } throw new ServletException( Messages.get().getBundle().key(Messages.ERR_INIT_PARAM_MISSING_1, INIT_PARAM_REPOSITORY)); } m_repository = OpenCms.getRepositoryManager().getRepository(repositoryName, A_CmsRepository.class); if (m_repository == null) { if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle().key(Messages.ERR_REPOSITORY_NOT_FOUND_1, repositoryName)); } throw new ServletException( Messages.get().getBundle().key(Messages.ERR_REPOSITORY_NOT_FOUND_1, repositoryName)); } if (LOG.isInfoEnabled()) { LOG.info(Messages.get().getBundle().key(Messages.LOG_USE_REPOSITORY_1, repositoryName)); } }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[]] begin[{] if[call[LOG.isInfoEnabled, parameter[]]] begin[{] call[LOG.info, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] local_variable[type[String], value] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getServletConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=INIT_PARAM_LIST, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInitParameter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=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=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_listings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[MethodInvocation(arguments=[], member=booleanValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_READ_INIT_PARAM_ERROR_2, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=INIT_PARAM_LIST, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[call[LOG.isInfoEnabled, parameter[]]] begin[{] call[LOG.info, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getServletConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=INIT_PARAM_READONLY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInitParameter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=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=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_readOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[MethodInvocation(arguments=[], member=booleanValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_READ_INIT_PARAM_ERROR_2, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=INIT_PARAM_READONLY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[call[LOG.isInfoEnabled, parameter[]]] begin[{] call[LOG.info, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_md5Helper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MD5")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageDigest, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ERR_MD5_NOT_AVAILABLE_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ERR_MD5_NOT_AVAILABLE_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnavailableException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None) local_variable[type[String], repositoryName] if[binary_operation[member[.repositoryName], ==, literal[null]]] begin[{] if[call[LOG.isErrorEnabled, parameter[]]] begin[{] call[LOG.error, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ERR_INIT_PARAM_MISSING_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=INIT_PARAM_REPOSITORY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServletException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.m_repository], call[OpenCms.getRepositoryManager, parameter[]]] if[binary_operation[member[.m_repository], ==, literal[null]]] begin[{] if[call[LOG.isErrorEnabled, parameter[]]] begin[{] call[LOG.error, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ERR_REPOSITORY_NOT_FOUND_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=repositoryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServletException, sub_type=None)), label=None) else begin[{] None end[}] if[call[LOG.isInfoEnabled, parameter[]]] begin[{] call[LOG.info, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[init] operator[SEP] operator[SEP] Keyword[throws] identifier[ServletException] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_INIT_WEBDAV_SERVLET_0] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[value] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[value] operator[=] identifier[getServletConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getInitParameter] operator[SEP] identifier[INIT_PARAM_LIST] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { identifier[m_listings] operator[=] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_READ_INIT_PARAM_ERROR_2] , identifier[INIT_PARAM_LIST] , identifier[value] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_READ_INIT_PARAM_2] , identifier[INIT_PARAM_LIST] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[m_listings] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[value] operator[=] identifier[getServletConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getInitParameter] operator[SEP] identifier[INIT_PARAM_READONLY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { identifier[m_readOnly] operator[=] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_READ_INIT_PARAM_ERROR_2] , identifier[INIT_PARAM_READONLY] , identifier[value] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_READ_INIT_PARAM_2] , identifier[INIT_PARAM_READONLY] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[m_readOnly] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[m_md5Helper] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_MD5_NOT_AVAILABLE_0] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[UnavailableException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_MD5_NOT_AVAILABLE_0] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[repositoryName] operator[=] identifier[getInitParameter] operator[SEP] identifier[INIT_PARAM_REPOSITORY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[repositoryName] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_INIT_PARAM_MISSING_1] , identifier[INIT_PARAM_REPOSITORY] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[ServletException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_INIT_PARAM_MISSING_1] , identifier[INIT_PARAM_REPOSITORY] operator[SEP] operator[SEP] operator[SEP] } identifier[m_repository] operator[=] identifier[OpenCms] operator[SEP] identifier[getRepositoryManager] operator[SEP] operator[SEP] operator[SEP] identifier[getRepository] operator[SEP] identifier[repositoryName] , identifier[A_CmsRepository] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_repository] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_REPOSITORY_NOT_FOUND_1] , identifier[repositoryName] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[ServletException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_REPOSITORY_NOT_FOUND_1] , identifier[repositoryName] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_USE_REPOSITORY_1] , identifier[repositoryName] operator[SEP] operator[SEP] operator[SEP] } }
public static LayoutData createLayoutData( Alignment horizontalAlignment, Alignment verticalAlignment, boolean grabExtraHorizontalSpace, boolean grabExtraVerticalSpace, int horizontalSpan, int verticalSpan) { return new GridLayoutData( horizontalAlignment, verticalAlignment, grabExtraHorizontalSpace, grabExtraVerticalSpace, horizontalSpan, verticalSpan); }
class class_name[name] begin[{] method[createLayoutData, return_type[type[LayoutData]], modifier[public static], parameter[horizontalAlignment, verticalAlignment, grabExtraHorizontalSpace, grabExtraVerticalSpace, horizontalSpan, verticalSpan]] begin[{] return[ClassCreator(arguments=[MemberReference(member=horizontalAlignment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=verticalAlignment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=grabExtraHorizontalSpace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=grabExtraVerticalSpace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=horizontalSpan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=verticalSpan, 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=GridLayoutData, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[LayoutData] identifier[createLayoutData] operator[SEP] identifier[Alignment] identifier[horizontalAlignment] , identifier[Alignment] identifier[verticalAlignment] , Keyword[boolean] identifier[grabExtraHorizontalSpace] , Keyword[boolean] identifier[grabExtraVerticalSpace] , Keyword[int] identifier[horizontalSpan] , Keyword[int] identifier[verticalSpan] operator[SEP] { Keyword[return] Keyword[new] identifier[GridLayoutData] operator[SEP] identifier[horizontalAlignment] , identifier[verticalAlignment] , identifier[grabExtraHorizontalSpace] , identifier[grabExtraVerticalSpace] , identifier[horizontalSpan] , identifier[verticalSpan] operator[SEP] operator[SEP] }
static <T> MaybeObserver<T> wrap(MaybeObserver<T> downstream, List<RunnableInstrumenter> instrumentations) { return new RxInstrumentedMaybeObserver<>(downstream, instrumentations); }
class class_name[name] begin[{] method[wrap, return_type[type[MaybeObserver]], modifier[static], parameter[downstream, instrumentations]] begin[{] return[ClassCreator(arguments=[MemberReference(member=downstream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=instrumentations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=RxInstrumentedMaybeObserver, sub_type=None))] end[}] END[}]
Keyword[static] operator[<] identifier[T] operator[>] identifier[MaybeObserver] operator[<] identifier[T] operator[>] identifier[wrap] operator[SEP] identifier[MaybeObserver] operator[<] identifier[T] operator[>] identifier[downstream] , identifier[List] operator[<] identifier[RunnableInstrumenter] operator[>] identifier[instrumentations] operator[SEP] { Keyword[return] Keyword[new] identifier[RxInstrumentedMaybeObserver] operator[<] operator[>] operator[SEP] identifier[downstream] , identifier[instrumentations] operator[SEP] operator[SEP] }
protected List<DisambiguationPatternRule> makeAntiPatterns(List<List<PatternToken>> patternList, Language language) { List<DisambiguationPatternRule> rules = new ArrayList<>(); for (List<PatternToken> patternTokens : patternList) { rules.add(new DisambiguationPatternRule("INTERNAL_ANTIPATTERN", "(no description)", language, patternTokens, null, null, DisambiguationPatternRule.DisambiguatorAction.IMMUNIZE)); } return rules; }
class class_name[name] begin[{] method[makeAntiPatterns, return_type[type[List]], modifier[protected], parameter[patternList, language]] begin[{] local_variable[type[List], rules] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTERNAL_ANTIPATTERN"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(no description)"), MemberReference(member=language, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=patternTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=IMMUNIZE, postfix_operators=[], prefix_operators=[], qualifier=DisambiguationPatternRule.DisambiguatorAction, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DisambiguationPatternRule, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=rules, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=patternList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=patternTokens)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PatternToken, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) return[member[.rules]] end[}] END[}]
Keyword[protected] identifier[List] operator[<] identifier[DisambiguationPatternRule] operator[>] identifier[makeAntiPatterns] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[PatternToken] operator[>] operator[>] identifier[patternList] , identifier[Language] identifier[language] operator[SEP] { identifier[List] operator[<] identifier[DisambiguationPatternRule] operator[>] identifier[rules] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] identifier[PatternToken] operator[>] identifier[patternTokens] operator[:] identifier[patternList] operator[SEP] { identifier[rules] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[DisambiguationPatternRule] operator[SEP] literal[String] , literal[String] , identifier[language] , identifier[patternTokens] , Other[null] , Other[null] , identifier[DisambiguationPatternRule] operator[SEP] identifier[DisambiguatorAction] operator[SEP] identifier[IMMUNIZE] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[rules] operator[SEP] }
private static CharSequence validValue(final CharSequence value) { if (!RsWithCookie.CVALUE_PTRN.matcher(value).matches()) { throw new IllegalArgumentException( String.format( "Cookie value \"%s\" contains invalid characters", value ) ); } return value; }
class class_name[name] begin[{] method[validValue, return_type[type[CharSequence]], modifier[private static], parameter[value]] begin[{] if[call[RsWithCookie.CVALUE_PTRN.matcher, parameter[member[.value]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cookie value \"%s\" contains invalid characters"), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.value]] end[}] END[}]
Keyword[private] Keyword[static] identifier[CharSequence] identifier[validValue] operator[SEP] Keyword[final] identifier[CharSequence] identifier[value] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[RsWithCookie] operator[SEP] identifier[CVALUE_PTRN] operator[SEP] identifier[matcher] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[value] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[value] operator[SEP] }
protected boolean validateAtLeastOneExecutable(BpmnModel bpmnModel, List<ValidationError> errors) { int nrOfExecutableDefinitions = 0; for (Process process : bpmnModel.getProcesses()) { if (process.isExecutable()) { nrOfExecutableDefinitions++; } } if (nrOfExecutableDefinitions == 0) { addError(errors, Problems.ALL_PROCESS_DEFINITIONS_NOT_EXECUTABLE, "All process definition are set to be non-executable (property 'isExecutable' on process). This is not allowed."); } return nrOfExecutableDefinitions > 0; }
class class_name[name] begin[{] method[validateAtLeastOneExecutable, return_type[type[boolean]], modifier[protected], parameter[bpmnModel, errors]] begin[{] local_variable[type[int], nrOfExecutableDefinitions] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isExecutable, postfix_operators=[], prefix_operators=[], qualifier=process, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=nrOfExecutableDefinitions, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getProcesses, postfix_operators=[], prefix_operators=[], qualifier=bpmnModel, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=process)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Process, sub_type=None))), label=None) if[binary_operation[member[.nrOfExecutableDefinitions], ==, literal[0]]] begin[{] call[.addError, parameter[member[.errors], member[Problems.ALL_PROCESS_DEFINITIONS_NOT_EXECUTABLE], literal["All process definition are set to be non-executable (property 'isExecutable' on process). This is not allowed."]]] else begin[{] None end[}] return[binary_operation[member[.nrOfExecutableDefinitions], >, literal[0]]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[validateAtLeastOneExecutable] operator[SEP] identifier[BpmnModel] identifier[bpmnModel] , identifier[List] operator[<] identifier[ValidationError] operator[>] identifier[errors] operator[SEP] { Keyword[int] identifier[nrOfExecutableDefinitions] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Process] identifier[process] operator[:] identifier[bpmnModel] operator[SEP] identifier[getProcesses] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[process] operator[SEP] identifier[isExecutable] operator[SEP] operator[SEP] operator[SEP] { identifier[nrOfExecutableDefinitions] operator[++] operator[SEP] } } Keyword[if] operator[SEP] identifier[nrOfExecutableDefinitions] operator[==] Other[0] operator[SEP] { identifier[addError] operator[SEP] identifier[errors] , identifier[Problems] operator[SEP] identifier[ALL_PROCESS_DEFINITIONS_NOT_EXECUTABLE] , literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[nrOfExecutableDefinitions] operator[>] Other[0] operator[SEP] }
public Object convertExceptionToJson(Throwable pExp, JmxRequest pJmxReq) { JsonConvertOptions opts = getJsonConvertOptions(pJmxReq); try { JSONObject expObj = (JSONObject) converters.getToJsonConverter().convertToJson(pExp,null,opts); return expObj; } catch (AttributeNotFoundException e) { // Cannot happen, since we dont use a path return null; } }
class class_name[name] begin[{] method[convertExceptionToJson, return_type[type[Object]], modifier[public], parameter[pExp, pJmxReq]] begin[{] local_variable[type[JsonConvertOptions], opts] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getToJsonConverter, postfix_operators=[], prefix_operators=[], qualifier=converters, selectors=[MethodInvocation(arguments=[MemberReference(member=pExp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=opts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertToJson, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None)), name=expObj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None)), ReturnStatement(expression=MemberReference(member=expObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AttributeNotFoundException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Object] identifier[convertExceptionToJson] operator[SEP] identifier[Throwable] identifier[pExp] , identifier[JmxRequest] identifier[pJmxReq] operator[SEP] { identifier[JsonConvertOptions] identifier[opts] operator[=] identifier[getJsonConvertOptions] operator[SEP] identifier[pJmxReq] operator[SEP] operator[SEP] Keyword[try] { identifier[JSONObject] identifier[expObj] operator[=] operator[SEP] identifier[JSONObject] operator[SEP] identifier[converters] operator[SEP] identifier[getToJsonConverter] operator[SEP] operator[SEP] operator[SEP] identifier[convertToJson] operator[SEP] identifier[pExp] , Other[null] , identifier[opts] operator[SEP] operator[SEP] Keyword[return] identifier[expObj] operator[SEP] } Keyword[catch] operator[SEP] identifier[AttributeNotFoundException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } }
public void keys(IntArrayList list) { list.setSize(distinct); int[] elements = list.elements(); int[] tab = table; byte[] stat = state; int j=0; for (int i = tab.length ; i-- > 0 ;) { if (stat[i]==FULL) elements[j++]=tab[i]; } }
class class_name[name] begin[{] method[keys, return_type[void], modifier[public], parameter[list]] begin[{] call[list.setSize, parameter[member[.distinct]]] local_variable[type[int], elements] local_variable[type[int], tab] local_variable[type[byte], stat] local_variable[type[int], j] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=FULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=tab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=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=0), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tab, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=None), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[keys] operator[SEP] identifier[IntArrayList] identifier[list] operator[SEP] { identifier[list] operator[SEP] identifier[setSize] operator[SEP] identifier[distinct] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[elements] operator[=] identifier[list] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[tab] operator[=] identifier[table] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[stat] operator[=] identifier[state] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[tab] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[--] operator[>] Other[0] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[stat] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[FULL] operator[SEP] identifier[elements] operator[SEP] identifier[j] operator[++] operator[SEP] operator[=] identifier[tab] operator[SEP] identifier[i] operator[SEP] operator[SEP] } }
private File determineMainFile(final String rawName, final String name) { assert rawName != null; String mainName = null; if (name == null) { // Just use the default mainName = rawName; } else if (name.equals(LAST) || name.equals(INITIAL) || name.equals(BOOT)) { // Search for a *single* file in the configuration dir with suffix == name.xml mainName = findMainFileFromBackupSuffix(historyRoot, name); } else if (VERSION_PATTERN.matcher(name).matches()) { // Search for a *single* file in the currentHistory dir with suffix == name.xml mainName = findMainFileFromBackupSuffix(currentHistory, name); } if (mainName == null) { // Search for a *single* file in the snapshots dir with prefix == name.xml mainName = findMainFileFromSnapshotPrefix(name); } if (mainName == null) { // Try the basic case, where name is the name final File directoryFile = new File(configurationDir, name); if (directoryFile.exists()) { mainName = stripPrefixSuffix(name); // TODO what if the stripped name doesn't exist? And why would there be a file like configuration/standalone.last.xml? } else if (interactionPolicy.isReadOnly()) { // We allow absolute paths in this case final File absoluteFile = new File(name); if (absoluteFile.exists()) { return absoluteFile; } } } if (mainName == null && !interactionPolicy.isRequireExisting()) { mainName = stripPrefixSuffix(name); } if (mainName != null) { return new File(configurationDir, new File(mainName).getName()); } throw ControllerLogger.ROOT_LOGGER.mainFileNotFound(name != null ? name : rawName, configurationDir); }
class class_name[name] begin[{] method[determineMainFile, return_type[type[File]], modifier[private], parameter[rawName, name]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=rawName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) local_variable[type[String], mainName] if[binary_operation[member[.name], ==, literal[null]]] begin[{] assign[member[.mainName], member[.rawName]] else begin[{] if[binary_operation[binary_operation[call[name.equals, parameter[member[.LAST]]], ||, call[name.equals, parameter[member[.INITIAL]]]], ||, call[name.equals, parameter[member[.BOOT]]]]] begin[{] assign[member[.mainName], call[.findMainFileFromBackupSuffix, parameter[member[.historyRoot], member[.name]]]] else begin[{] if[call[VERSION_PATTERN.matcher, parameter[member[.name]]]] begin[{] assign[member[.mainName], call[.findMainFileFromBackupSuffix, parameter[member[.currentHistory], member[.name]]]] else begin[{] None end[}] end[}] end[}] if[binary_operation[member[.mainName], ==, literal[null]]] begin[{] assign[member[.mainName], call[.findMainFileFromSnapshotPrefix, parameter[member[.name]]]] else begin[{] None end[}] if[binary_operation[member[.mainName], ==, literal[null]]] begin[{] local_variable[type[File], directoryFile] if[call[directoryFile.exists, parameter[]]] begin[{] assign[member[.mainName], call[.stripPrefixSuffix, parameter[member[.name]]]] else begin[{] if[call[interactionPolicy.isReadOnly, parameter[]]] begin[{] local_variable[type[File], absoluteFile] if[call[absoluteFile.exists, parameter[]]] begin[{] return[member[.absoluteFile]] else begin[{] None end[}] else begin[{] None end[}] end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[.mainName], ==, literal[null]], &&, call[interactionPolicy.isRequireExisting, parameter[]]]] begin[{] assign[member[.mainName], call[.stripPrefixSuffix, parameter[member[.name]]]] else begin[{] None end[}] if[binary_operation[member[.mainName], !=, literal[null]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=configurationDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=mainName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] else begin[{] None end[}] ThrowStatement(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=rawName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=configurationDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mainFileNotFound, postfix_operators=[], prefix_operators=[], qualifier=ControllerLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[private] identifier[File] identifier[determineMainFile] operator[SEP] Keyword[final] identifier[String] identifier[rawName] , Keyword[final] identifier[String] identifier[name] operator[SEP] { Keyword[assert] identifier[rawName] operator[!=] Other[null] operator[SEP] identifier[String] identifier[mainName] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { identifier[mainName] operator[=] identifier[rawName] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[LAST] operator[SEP] operator[||] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[INITIAL] operator[SEP] operator[||] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[BOOT] operator[SEP] operator[SEP] { identifier[mainName] operator[=] identifier[findMainFileFromBackupSuffix] operator[SEP] identifier[historyRoot] , identifier[name] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[VERSION_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { identifier[mainName] operator[=] identifier[findMainFileFromBackupSuffix] operator[SEP] identifier[currentHistory] , identifier[name] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[mainName] operator[==] Other[null] operator[SEP] { identifier[mainName] operator[=] identifier[findMainFileFromSnapshotPrefix] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[mainName] operator[==] Other[null] operator[SEP] { Keyword[final] identifier[File] identifier[directoryFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[configurationDir] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[directoryFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[mainName] operator[=] identifier[stripPrefixSuffix] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[interactionPolicy] operator[SEP] identifier[isReadOnly] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[File] identifier[absoluteFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[absoluteFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[absoluteFile] operator[SEP] } } } Keyword[if] operator[SEP] identifier[mainName] operator[==] Other[null] operator[&&] operator[!] identifier[interactionPolicy] operator[SEP] identifier[isRequireExisting] operator[SEP] operator[SEP] operator[SEP] { identifier[mainName] operator[=] identifier[stripPrefixSuffix] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[mainName] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[File] operator[SEP] identifier[configurationDir] , Keyword[new] identifier[File] operator[SEP] identifier[mainName] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] identifier[ControllerLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[mainFileNotFound] operator[SEP] identifier[name] operator[!=] Other[null] operator[?] identifier[name] operator[:] identifier[rawName] , identifier[configurationDir] operator[SEP] operator[SEP] }
public void setDefactoForwardedHeaders() { if (xForwardedForHeader != null && xForwardedByHeader != null) { httpOutboundRequest.setHeader(Constants.X_FORWARDED_FOR, xForwardedForHeader.trim() + COMMA + " " + xForwardedByHeader.trim()); } else if (xForwardedByHeader != null) { httpOutboundRequest.setHeader(Constants.X_FORWARDED_FOR, xForwardedByHeader.trim()); } httpOutboundRequest.setHeader(Constants.X_FORWARDED_BY, localAddress); }
class class_name[name] begin[{] method[setDefactoForwardedHeaders, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[member[.xForwardedForHeader], !=, literal[null]], &&, binary_operation[member[.xForwardedByHeader], !=, literal[null]]]] begin[{] call[httpOutboundRequest.setHeader, parameter[member[Constants.X_FORWARDED_FOR], binary_operation[binary_operation[binary_operation[call[xForwardedForHeader.trim, parameter[]], +, member[.COMMA]], +, literal[" "]], +, call[xForwardedByHeader.trim, parameter[]]]]] else begin[{] if[binary_operation[member[.xForwardedByHeader], !=, literal[null]]] begin[{] call[httpOutboundRequest.setHeader, parameter[member[Constants.X_FORWARDED_FOR], call[xForwardedByHeader.trim, parameter[]]]] else begin[{] None end[}] end[}] call[httpOutboundRequest.setHeader, parameter[member[Constants.X_FORWARDED_BY], member[.localAddress]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDefactoForwardedHeaders] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[xForwardedForHeader] operator[!=] Other[null] operator[&&] identifier[xForwardedByHeader] operator[!=] Other[null] operator[SEP] { identifier[httpOutboundRequest] operator[SEP] identifier[setHeader] operator[SEP] identifier[Constants] operator[SEP] identifier[X_FORWARDED_FOR] , identifier[xForwardedForHeader] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[+] identifier[COMMA] operator[+] literal[String] operator[+] identifier[xForwardedByHeader] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[xForwardedByHeader] operator[!=] Other[null] operator[SEP] { identifier[httpOutboundRequest] operator[SEP] identifier[setHeader] operator[SEP] identifier[Constants] operator[SEP] identifier[X_FORWARDED_FOR] , identifier[xForwardedByHeader] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[httpOutboundRequest] operator[SEP] identifier[setHeader] operator[SEP] identifier[Constants] operator[SEP] identifier[X_FORWARDED_BY] , identifier[localAddress] operator[SEP] operator[SEP] }
public Object processInvocation(final InterceptorContext context) throws Exception { final SecurityIdentity identity = context.getPrivateData(SecurityIdentity.class); if (identity != null) try { return identity.runAs(context); } catch (PrivilegedActionException e) { throw e.getException(); } else { return context.proceed(); } }
class class_name[name] begin[{] method[processInvocation, return_type[type[Object]], modifier[public], parameter[context]] begin[{] local_variable[type[SecurityIdentity], identity] if[binary_operation[member[.identity], !=, literal[null]]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=runAs, postfix_operators=[], prefix_operators=[], qualifier=identity, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[], member=getException, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PrivilegedActionException']))], finally_block=None, label=None, resources=None) else begin[{] return[call[context.proceed, parameter[]]] end[}] end[}] END[}]
Keyword[public] identifier[Object] identifier[processInvocation] operator[SEP] Keyword[final] identifier[InterceptorContext] identifier[context] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[final] identifier[SecurityIdentity] identifier[identity] operator[=] identifier[context] operator[SEP] identifier[getPrivateData] operator[SEP] identifier[SecurityIdentity] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[identity] operator[!=] Other[null] operator[SEP] Keyword[try] { Keyword[return] identifier[identity] operator[SEP] identifier[runAs] operator[SEP] identifier[context] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[PrivilegedActionException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] identifier[getException] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[context] operator[SEP] identifier[proceed] operator[SEP] operator[SEP] operator[SEP] } }
public String getState() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getState"); String state = null; TickRange r = getTickRange(); byte tickState = r.type; switch ( tickState ) { case TickRange.Requested : { state = State.REQUEST.toString(); break; } case TickRange.Accepted : { state = State.ACKNOWLEDGED.toString(); break; } case TickRange.Completed : { state = State.ACKNOWLEDGED.toString(); break; } case TickRange.Rejected : { state = State.REJECT.toString(); break; } case TickRange.Value : { if (((AOValue) r.value).removing) state = State.REMOVING.toString(); else state = State.PENDING_ACKNOWLEDGEMENT.toString(); break; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getState", state); return state; }
class class_name[name] begin[{] method[getState, return_type[type[String]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["getState"]]] else begin[{] None end[}] local_variable[type[String], state] local_variable[type[TickRange], r] local_variable[type[byte], tickState] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=Requested, postfix_operators=[], prefix_operators=[], qualifier=TickRange, selectors=[])], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=State.REQUEST, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=Accepted, postfix_operators=[], prefix_operators=[], qualifier=TickRange, selectors=[])], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=State.ACKNOWLEDGED, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=Completed, postfix_operators=[], prefix_operators=[], qualifier=TickRange, selectors=[])], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=State.ACKNOWLEDGED, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=Rejected, postfix_operators=[], prefix_operators=[], qualifier=TickRange, selectors=[])], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=State.REJECT, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[MemberReference(member=Value, postfix_operators=[], prefix_operators=[], qualifier=TickRange, selectors=[])], statements=[BlockStatement(label=None, statements=[IfStatement(condition=Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AOValue, sub_type=None)), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=State.PENDING_ACKNOWLEDGEMENT, selectors=[], type_arguments=None)), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=State.REMOVING, selectors=[], type_arguments=None)), label=None)), BreakStatement(goto=None, label=None)])])], expression=MemberReference(member=tickState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["getState"], member[.state]]] else begin[{] None end[}] return[member[.state]] end[}] END[}]
Keyword[public] identifier[String] identifier[getState] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[state] operator[=] Other[null] operator[SEP] identifier[TickRange] identifier[r] operator[=] identifier[getTickRange] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] identifier[tickState] operator[=] identifier[r] operator[SEP] identifier[type] operator[SEP] Keyword[switch] operator[SEP] identifier[tickState] operator[SEP] { Keyword[case] identifier[TickRange] operator[SEP] identifier[Requested] operator[:] { identifier[state] operator[=] identifier[State] operator[SEP] identifier[REQUEST] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] identifier[TickRange] operator[SEP] identifier[Accepted] operator[:] { identifier[state] operator[=] identifier[State] operator[SEP] identifier[ACKNOWLEDGED] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] identifier[TickRange] operator[SEP] identifier[Completed] operator[:] { identifier[state] operator[=] identifier[State] operator[SEP] identifier[ACKNOWLEDGED] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] identifier[TickRange] operator[SEP] identifier[Rejected] operator[:] { identifier[state] operator[=] identifier[State] operator[SEP] identifier[REJECT] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] identifier[TickRange] operator[SEP] identifier[Value] operator[:] { Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[AOValue] operator[SEP] identifier[r] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[removing] operator[SEP] identifier[state] operator[=] identifier[State] operator[SEP] identifier[REMOVING] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[state] operator[=] identifier[State] operator[SEP] identifier[PENDING_ACKNOWLEDGEMENT] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] 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[state] operator[SEP] operator[SEP] Keyword[return] identifier[state] operator[SEP] }
private void initCipher(int mode) throws InvalidKeyException, InvalidAlgorithmParameterException { if (key != null) { if (params != null) { if (random != null) { cipher.init(mode, key, params, random); } else { cipher.init(mode, key, params); } } else if (spec != null) { if (random != null) { cipher.init(mode, key, spec, random); } else { cipher.init(mode, key, spec); } } else { if (random != null) { cipher.init(mode, key, random); } else { cipher.init(mode, key); } } } else { if (random != null) { cipher.init(mode, certificate, random); } else { cipher.init(mode, certificate); } } }
class class_name[name] begin[{] method[initCipher, return_type[void], modifier[private], parameter[mode]] begin[{] if[binary_operation[member[.key], !=, literal[null]]] begin[{] if[binary_operation[member[.params], !=, literal[null]]] begin[{] if[binary_operation[member[.random], !=, literal[null]]] begin[{] call[cipher.init, parameter[member[.mode], member[.key], member[.params], member[.random]]] else begin[{] call[cipher.init, parameter[member[.mode], member[.key], member[.params]]] end[}] else begin[{] if[binary_operation[member[.spec], !=, literal[null]]] begin[{] if[binary_operation[member[.random], !=, literal[null]]] begin[{] call[cipher.init, parameter[member[.mode], member[.key], member[.spec], member[.random]]] else begin[{] call[cipher.init, parameter[member[.mode], member[.key], member[.spec]]] end[}] else begin[{] if[binary_operation[member[.random], !=, literal[null]]] begin[{] call[cipher.init, parameter[member[.mode], member[.key], member[.random]]] else begin[{] call[cipher.init, parameter[member[.mode], member[.key]]] end[}] end[}] end[}] else begin[{] if[binary_operation[member[.random], !=, literal[null]]] begin[{] call[cipher.init, parameter[member[.mode], member[.certificate], member[.random]]] else begin[{] call[cipher.init, parameter[member[.mode], member[.certificate]]] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[initCipher] operator[SEP] Keyword[int] identifier[mode] operator[SEP] Keyword[throws] identifier[InvalidKeyException] , identifier[InvalidAlgorithmParameterException] { Keyword[if] operator[SEP] identifier[key] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[params] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[random] operator[!=] Other[null] operator[SEP] { identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[mode] , identifier[key] , identifier[params] , identifier[random] operator[SEP] operator[SEP] } Keyword[else] { identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[mode] , identifier[key] , identifier[params] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[spec] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[random] operator[!=] Other[null] operator[SEP] { identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[mode] , identifier[key] , identifier[spec] , identifier[random] operator[SEP] operator[SEP] } Keyword[else] { identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[mode] , identifier[key] , identifier[spec] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[random] operator[!=] Other[null] operator[SEP] { identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[mode] , identifier[key] , identifier[random] operator[SEP] operator[SEP] } Keyword[else] { identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[mode] , identifier[key] operator[SEP] operator[SEP] } } } Keyword[else] { Keyword[if] operator[SEP] identifier[random] operator[!=] Other[null] operator[SEP] { identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[mode] , identifier[certificate] , identifier[random] operator[SEP] operator[SEP] } Keyword[else] { identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[mode] , identifier[certificate] operator[SEP] operator[SEP] } } }
public static Method getMatchingAccessibleMethod(Class<?> clazz, String methodName, Class<?>[] paramTypes) { return getMatchingAccessibleMethod(clazz, methodName, null, paramTypes); }
class class_name[name] begin[{] method[getMatchingAccessibleMethod, return_type[type[Method]], modifier[public static], parameter[clazz, methodName, paramTypes]] begin[{] return[call[.getMatchingAccessibleMethod, parameter[member[.clazz], member[.methodName], literal[null], member[.paramTypes]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Method] identifier[getMatchingAccessibleMethod] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[String] identifier[methodName] , identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[paramTypes] operator[SEP] { Keyword[return] identifier[getMatchingAccessibleMethod] operator[SEP] identifier[clazz] , identifier[methodName] , Other[null] , identifier[paramTypes] operator[SEP] operator[SEP] }
private WebIdentitySessionContext parseWebIdentitySessionContext(SessionContext sessionContext) throws IOException { if (jsonParser.nextToken() != JsonToken.START_OBJECT) { throw new JsonParseException("Not a WebIdentitySessionContext object", jsonParser.getCurrentLocation()); } WebIdentitySessionContext webIdFederationData = new WebIdentitySessionContext(); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { String key = jsonParser.getCurrentName(); switch (key) { case "attributes": webIdFederationData.add(CloudTrailEventField.attributes.name(), parseAttributes()); break; case "federatedProvider": webIdFederationData.add(CloudTrailEventField.federatedProvider.name(), jsonParser.nextTextValue()); break; default: webIdFederationData.add(key, parseDefaultValue(key)); break; } } return webIdFederationData; }
class class_name[name] begin[{] method[parseWebIdentitySessionContext, return_type[type[WebIdentitySessionContext]], modifier[private], parameter[sessionContext]] begin[{] if[binary_operation[call[jsonParser.nextToken, parameter[]], !=, member[JsonToken.START_OBJECT]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not a WebIdentitySessionContext object"), MethodInvocation(arguments=[], member=getCurrentLocation, postfix_operators=[], prefix_operators=[], qualifier=jsonParser, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonParseException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[WebIdentitySessionContext], webIdFederationData] while[binary_operation[call[jsonParser.nextToken, parameter[]], !=, member[JsonToken.END_OBJECT]]] begin[{] local_variable[type[String], key] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="attributes")], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=CloudTrailEventField.attributes, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=parseAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=webIdFederationData, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="federatedProvider")], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=CloudTrailEventField.federatedProvider, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=nextTextValue, postfix_operators=[], prefix_operators=[], qualifier=jsonParser, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=webIdFederationData, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=webIdFederationData, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] return[member[.webIdFederationData]] end[}] END[}]
Keyword[private] identifier[WebIdentitySessionContext] identifier[parseWebIdentitySessionContext] operator[SEP] identifier[SessionContext] identifier[sessionContext] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[jsonParser] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[!=] identifier[JsonToken] operator[SEP] identifier[START_OBJECT] operator[SEP] { Keyword[throw] Keyword[new] identifier[JsonParseException] operator[SEP] literal[String] , identifier[jsonParser] operator[SEP] identifier[getCurrentLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[WebIdentitySessionContext] identifier[webIdFederationData] operator[=] Keyword[new] identifier[WebIdentitySessionContext] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[jsonParser] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[!=] identifier[JsonToken] operator[SEP] identifier[END_OBJECT] operator[SEP] { identifier[String] identifier[key] operator[=] identifier[jsonParser] operator[SEP] identifier[getCurrentName] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[key] operator[SEP] { Keyword[case] literal[String] operator[:] identifier[webIdFederationData] operator[SEP] identifier[add] operator[SEP] identifier[CloudTrailEventField] operator[SEP] identifier[attributes] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[parseAttributes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[webIdFederationData] operator[SEP] identifier[add] operator[SEP] identifier[CloudTrailEventField] operator[SEP] identifier[federatedProvider] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[jsonParser] operator[SEP] identifier[nextTextValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[webIdFederationData] operator[SEP] identifier[add] operator[SEP] identifier[key] , identifier[parseDefaultValue] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[return] identifier[webIdFederationData] operator[SEP] }
private static IndexedTypeSet toRootEntities(ExtendedSearchIntegrator extendedIntegrator, Class<?>... selection) { Set<Class<?>> entities = new HashSet<Class<?>>(); //first build the "entities" set containing all indexed subtypes of "selection". for ( Class<?> entityType : selection ) { IndexedTypeSet targetedClasses = extendedIntegrator.getIndexedTypesPolymorphic( IndexedTypeSets.fromClass( entityType ) ); if ( targetedClasses.isEmpty() ) { String msg = entityType.getName() + " is not an indexed entity or a subclass of an indexed entity"; throw new IllegalArgumentException( msg ); } entities.addAll( targetedClasses.toPojosSet() ); } Set<Class<?>> cleaned = new HashSet<Class<?>>(); Set<Class<?>> toRemove = new HashSet<Class<?>>(); //now remove all repeated types to avoid duplicate loading by polymorphic query loading for ( Class<?> type : entities ) { boolean typeIsOk = true; for ( Class<?> existing : cleaned ) { if ( existing.isAssignableFrom( type ) ) { typeIsOk = false; break; } if ( type.isAssignableFrom( existing ) ) { toRemove.add( existing ); } } if ( typeIsOk ) { cleaned.add( type ); } } cleaned.removeAll( toRemove ); log.debugf( "Targets for indexing job: %s", cleaned ); return IndexedTypeSets.fromClasses( cleaned.toArray( new Class[cleaned.size()] ) ); }
class class_name[name] begin[{] method[toRootEntities, return_type[type[IndexedTypeSet]], modifier[private static], parameter[extendedIntegrator, selection]] begin[{] local_variable[type[Set], entities] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=entityType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromClass, postfix_operators=[], prefix_operators=[], qualifier=IndexedTypeSets, selectors=[], type_arguments=None)], member=getIndexedTypesPolymorphic, postfix_operators=[], prefix_operators=[], qualifier=extendedIntegrator, selectors=[], type_arguments=None), name=targetedClasses)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IndexedTypeSet, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=targetedClasses, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entityType, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not an indexed entity or a subclass of an indexed entity"), operator=+), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toPojosSet, postfix_operators=[], prefix_operators=[], qualifier=targetedClasses, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=entities, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=selection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entityType)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) local_variable[type[Set], cleaned] local_variable[type[Set], toRemove] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=typeIsOk)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=existing, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=typeIsOk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=existing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=existing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=toRemove, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=cleaned, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=existing)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=typeIsOk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=cleaned, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=entities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) call[cleaned.removeAll, parameter[member[.toRemove]]] call[log.debugf, parameter[literal["Targets for indexing job: %s"], member[.cleaned]]] return[call[IndexedTypeSets.fromClasses, parameter[call[cleaned.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=cleaned, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))]]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[IndexedTypeSet] identifier[toRootEntities] operator[SEP] identifier[ExtendedSearchIntegrator] identifier[extendedIntegrator] , identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[selection] operator[SEP] { identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[entities] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[entityType] operator[:] identifier[selection] operator[SEP] { identifier[IndexedTypeSet] identifier[targetedClasses] operator[=] identifier[extendedIntegrator] operator[SEP] identifier[getIndexedTypesPolymorphic] operator[SEP] identifier[IndexedTypeSets] operator[SEP] identifier[fromClass] operator[SEP] identifier[entityType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetedClasses] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[msg] operator[=] identifier[entityType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } identifier[entities] operator[SEP] identifier[addAll] operator[SEP] identifier[targetedClasses] operator[SEP] identifier[toPojosSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[cleaned] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[toRemove] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[:] identifier[entities] operator[SEP] { Keyword[boolean] identifier[typeIsOk] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[existing] operator[:] identifier[cleaned] operator[SEP] { Keyword[if] operator[SEP] identifier[existing] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[typeIsOk] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[existing] operator[SEP] operator[SEP] { identifier[toRemove] operator[SEP] identifier[add] operator[SEP] identifier[existing] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[typeIsOk] operator[SEP] { identifier[cleaned] operator[SEP] identifier[add] operator[SEP] identifier[type] operator[SEP] operator[SEP] } } identifier[cleaned] operator[SEP] identifier[removeAll] operator[SEP] identifier[toRemove] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debugf] operator[SEP] literal[String] , identifier[cleaned] operator[SEP] operator[SEP] Keyword[return] identifier[IndexedTypeSets] operator[SEP] identifier[fromClasses] operator[SEP] identifier[cleaned] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Class] operator[SEP] identifier[cleaned] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public P end() { parent.addChildObject(English.plural(object.getType()), object); return parent; }
class class_name[name] begin[{] method[end, return_type[type[P]], modifier[public], parameter[]] begin[{] call[parent.addChildObject, parameter[call[English.plural, parameter[call[object.getType, parameter[]]]], member[.object]]] return[member[.parent]] end[}] END[}]
Keyword[public] identifier[P] identifier[end] operator[SEP] operator[SEP] { identifier[parent] operator[SEP] identifier[addChildObject] operator[SEP] identifier[English] operator[SEP] identifier[plural] operator[SEP] identifier[object] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] , identifier[object] operator[SEP] operator[SEP] Keyword[return] identifier[parent] operator[SEP] }
private void parseDefault(String elementName, String name, String type, String enumer) throws Exception { int valueType = ATTRIBUTE_DEFAULT_SPECIFIED; String value = null; int flags = LIT_ATTRIBUTE; boolean saved = expandPE; String defaultType = null; // LIT_ATTRIBUTE forces '<' checks now (ASAP) and turns whitespace // chars to spaces (doesn't matter when that's done if it doesn't // interfere with char refs expanding to whitespace). if (!skippedPE) { flags |= LIT_ENTITY_REF; if (handler.stringInterning) { if ("CDATA" != type) { flags |= LIT_NORMALIZE; } } else { if (!"CDATA".equals(type)) { flags |= LIT_NORMALIZE; } } } expandPE = false; if (tryRead('#')) { if (tryRead("FIXED")) { defaultType = "#FIXED"; valueType = ATTRIBUTE_DEFAULT_FIXED; requireWhitespace(); value = readLiteral(flags); } else if (tryRead("REQUIRED")) { defaultType = "#REQUIRED"; valueType = ATTRIBUTE_DEFAULT_REQUIRED; } else if (tryRead("IMPLIED")) { defaultType = "#IMPLIED"; valueType = ATTRIBUTE_DEFAULT_IMPLIED; } else { fatal("illegal keyword for attribute default value"); } } else { value = readLiteral(flags); } expandPE = saved; setAttribute(elementName, name, type, enumer, value, valueType); if (handler.stringInterning) { if ("ENUMERATION" == type) { type = enumer; } else if ("NOTATION" == type) { type = "NOTATION " + enumer; } } else { if ("ENUMERATION".equals(type)) { type = enumer; } else if ("NOTATION".equals(type)) { type = "NOTATION " + enumer; } } if (!skippedPE) { handler.getDeclHandler().attributeDecl(elementName, name, type, defaultType, value); } }
class class_name[name] begin[{] method[parseDefault, return_type[void], modifier[private], parameter[elementName, name, type, enumer]] begin[{] local_variable[type[int], valueType] local_variable[type[String], value] local_variable[type[int], flags] local_variable[type[boolean], saved] local_variable[type[String], defaultType] if[member[.skippedPE]] begin[{] assign[member[.flags], member[.LIT_ENTITY_REF]] if[member[handler.stringInterning]] begin[{] if[binary_operation[literal["CDATA"], !=, member[.type]]] begin[{] assign[member[.flags], member[.LIT_NORMALIZE]] else begin[{] None end[}] else begin[{] if[literal["CDATA"]] begin[{] assign[member[.flags], member[.LIT_NORMALIZE]] else begin[{] None end[}] end[}] else begin[{] None end[}] assign[member[.expandPE], literal[false]] if[call[.tryRead, parameter[literal['#']]]] begin[{] if[call[.tryRead, parameter[literal["FIXED"]]]] begin[{] assign[member[.defaultType], literal["#FIXED"]] assign[member[.valueType], member[.ATTRIBUTE_DEFAULT_FIXED]] call[.requireWhitespace, parameter[]] assign[member[.value], call[.readLiteral, parameter[member[.flags]]]] else begin[{] if[call[.tryRead, parameter[literal["REQUIRED"]]]] begin[{] assign[member[.defaultType], literal["#REQUIRED"]] assign[member[.valueType], member[.ATTRIBUTE_DEFAULT_REQUIRED]] else begin[{] if[call[.tryRead, parameter[literal["IMPLIED"]]]] begin[{] assign[member[.defaultType], literal["#IMPLIED"]] assign[member[.valueType], member[.ATTRIBUTE_DEFAULT_IMPLIED]] else begin[{] call[.fatal, parameter[literal["illegal keyword for attribute default value"]]] end[}] end[}] end[}] else begin[{] assign[member[.value], call[.readLiteral, parameter[member[.flags]]]] end[}] assign[member[.expandPE], member[.saved]] call[.setAttribute, parameter[member[.elementName], member[.name], member[.type], member[.enumer], member[.value], member[.valueType]]] if[member[handler.stringInterning]] begin[{] if[binary_operation[literal["ENUMERATION"], ==, member[.type]]] begin[{] assign[member[.type], member[.enumer]] else begin[{] if[binary_operation[literal["NOTATION"], ==, member[.type]]] begin[{] assign[member[.type], binary_operation[literal["NOTATION "], +, member[.enumer]]] else begin[{] None end[}] end[}] else begin[{] if[literal["ENUMERATION"]] begin[{] assign[member[.type], member[.enumer]] else begin[{] if[literal["NOTATION"]] begin[{] assign[member[.type], binary_operation[literal["NOTATION "], +, member[.enumer]]] else begin[{] None end[}] end[}] end[}] if[member[.skippedPE]] begin[{] call[handler.getDeclHandler, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[parseDefault] operator[SEP] identifier[String] identifier[elementName] , identifier[String] identifier[name] , identifier[String] identifier[type] , identifier[String] identifier[enumer] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[int] identifier[valueType] operator[=] identifier[ATTRIBUTE_DEFAULT_SPECIFIED] operator[SEP] identifier[String] identifier[value] operator[=] Other[null] operator[SEP] Keyword[int] identifier[flags] operator[=] identifier[LIT_ATTRIBUTE] operator[SEP] Keyword[boolean] identifier[saved] operator[=] identifier[expandPE] operator[SEP] identifier[String] identifier[defaultType] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[skippedPE] operator[SEP] { identifier[flags] operator[|=] identifier[LIT_ENTITY_REF] operator[SEP] Keyword[if] operator[SEP] identifier[handler] operator[SEP] identifier[stringInterning] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[!=] identifier[type] operator[SEP] { identifier[flags] operator[|=] identifier[LIT_NORMALIZE] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[LIT_NORMALIZE] operator[SEP] } } } identifier[expandPE] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[tryRead] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tryRead] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[defaultType] operator[=] literal[String] operator[SEP] identifier[valueType] operator[=] identifier[ATTRIBUTE_DEFAULT_FIXED] operator[SEP] identifier[requireWhitespace] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[readLiteral] operator[SEP] identifier[flags] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[tryRead] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[defaultType] operator[=] literal[String] operator[SEP] identifier[valueType] operator[=] identifier[ATTRIBUTE_DEFAULT_REQUIRED] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[tryRead] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[defaultType] operator[=] literal[String] operator[SEP] identifier[valueType] operator[=] identifier[ATTRIBUTE_DEFAULT_IMPLIED] operator[SEP] } Keyword[else] { identifier[fatal] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[else] { identifier[value] operator[=] identifier[readLiteral] operator[SEP] identifier[flags] operator[SEP] operator[SEP] } identifier[expandPE] operator[=] identifier[saved] operator[SEP] identifier[setAttribute] operator[SEP] identifier[elementName] , identifier[name] , identifier[type] , identifier[enumer] , identifier[value] , identifier[valueType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handler] operator[SEP] identifier[stringInterning] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[==] identifier[type] operator[SEP] { identifier[type] operator[=] identifier[enumer] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[==] identifier[type] operator[SEP] { identifier[type] operator[=] literal[String] operator[+] identifier[enumer] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[type] operator[=] identifier[enumer] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[type] operator[=] literal[String] operator[+] identifier[enumer] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[skippedPE] operator[SEP] { identifier[handler] operator[SEP] identifier[getDeclHandler] operator[SEP] operator[SEP] operator[SEP] identifier[attributeDecl] operator[SEP] identifier[elementName] , identifier[name] , identifier[type] , identifier[defaultType] , identifier[value] operator[SEP] operator[SEP] } }
protected void setValue(int newValue, boolean updateTextField, boolean firePropertyChange) { int oldValue = value; if (newValue < min) { value = min; } else if (newValue > max) { value = max; } else { value = newValue; } if (updateTextField) { textField.setText(Integer.toString(value)); textField.setForeground(Color.black); } if (firePropertyChange) { firePropertyChange("value", oldValue, value); } }
class class_name[name] begin[{] method[setValue, return_type[void], modifier[protected], parameter[newValue, updateTextField, firePropertyChange]] begin[{] local_variable[type[int], oldValue] if[binary_operation[member[.newValue], <, member[.min]]] begin[{] assign[member[.value], member[.min]] else begin[{] if[binary_operation[member[.newValue], >, member[.max]]] begin[{] assign[member[.value], member[.max]] else begin[{] assign[member[.value], member[.newValue]] end[}] end[}] if[member[.updateTextField]] begin[{] call[textField.setText, parameter[call[Integer.toString, parameter[member[.value]]]]] call[textField.setForeground, parameter[member[Color.black]]] else begin[{] None end[}] if[member[.firePropertyChange]] begin[{] call[.firePropertyChange, parameter[literal["value"], member[.oldValue], member[.value]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[setValue] operator[SEP] Keyword[int] identifier[newValue] , Keyword[boolean] identifier[updateTextField] , Keyword[boolean] identifier[firePropertyChange] operator[SEP] { Keyword[int] identifier[oldValue] operator[=] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[newValue] operator[<] identifier[min] operator[SEP] { identifier[value] operator[=] identifier[min] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[newValue] operator[>] identifier[max] operator[SEP] { identifier[value] operator[=] identifier[max] operator[SEP] } Keyword[else] { identifier[value] operator[=] identifier[newValue] operator[SEP] } Keyword[if] operator[SEP] identifier[updateTextField] operator[SEP] { identifier[textField] operator[SEP] identifier[setText] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] identifier[textField] operator[SEP] identifier[setForeground] operator[SEP] identifier[Color] operator[SEP] identifier[black] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[firePropertyChange] operator[SEP] { identifier[firePropertyChange] operator[SEP] literal[String] , identifier[oldValue] , identifier[value] operator[SEP] operator[SEP] } }
public void register(InstanceInfo registrant, int leaseDuration, boolean isReplication) { try { read.lock(); Map<String, Lease<InstanceInfo>> gMap = registry.get(registrant.getAppName()); REGISTER.increment(isReplication); if (gMap == null) { final ConcurrentHashMap<String, Lease<InstanceInfo>> gNewMap = new ConcurrentHashMap<String, Lease<InstanceInfo>>(); gMap = registry.putIfAbsent(registrant.getAppName(), gNewMap); if (gMap == null) { gMap = gNewMap; } } Lease<InstanceInfo> existingLease = gMap.get(registrant.getId()); // Retain the last dirty timestamp without overwriting it, if there is already a lease if (existingLease != null && (existingLease.getHolder() != null)) { Long existingLastDirtyTimestamp = existingLease.getHolder().getLastDirtyTimestamp(); Long registrationLastDirtyTimestamp = registrant.getLastDirtyTimestamp(); logger.debug("Existing lease found (existing={}, provided={}", existingLastDirtyTimestamp, registrationLastDirtyTimestamp); // this is a > instead of a >= because if the timestamps are equal, we still take the remote transmitted // InstanceInfo instead of the server local copy. if (existingLastDirtyTimestamp > registrationLastDirtyTimestamp) { logger.warn("There is an existing lease and the existing lease's dirty timestamp {} is greater" + " than the one that is being registered {}", existingLastDirtyTimestamp, registrationLastDirtyTimestamp); logger.warn("Using the existing instanceInfo instead of the new instanceInfo as the registrant"); registrant = existingLease.getHolder(); } } else { // The lease does not exist and hence it is a new registration synchronized (lock) { if (this.expectedNumberOfClientsSendingRenews > 0) { // Since the client wants to register it, increase the number of clients sending renews this.expectedNumberOfClientsSendingRenews = this.expectedNumberOfClientsSendingRenews + 1; updateRenewsPerMinThreshold(); } } logger.debug("No previous lease information found; it is new registration"); } Lease<InstanceInfo> lease = new Lease<InstanceInfo>(registrant, leaseDuration); if (existingLease != null) { lease.setServiceUpTimestamp(existingLease.getServiceUpTimestamp()); } gMap.put(registrant.getId(), lease); synchronized (recentRegisteredQueue) { recentRegisteredQueue.add(new Pair<Long, String>( System.currentTimeMillis(), registrant.getAppName() + "(" + registrant.getId() + ")")); } // This is where the initial state transfer of overridden status happens if (!InstanceStatus.UNKNOWN.equals(registrant.getOverriddenStatus())) { logger.debug("Found overridden status {} for instance {}. Checking to see if needs to be add to the " + "overrides", registrant.getOverriddenStatus(), registrant.getId()); if (!overriddenInstanceStatusMap.containsKey(registrant.getId())) { logger.info("Not found overridden id {} and hence adding it", registrant.getId()); overriddenInstanceStatusMap.put(registrant.getId(), registrant.getOverriddenStatus()); } } InstanceStatus overriddenStatusFromMap = overriddenInstanceStatusMap.get(registrant.getId()); if (overriddenStatusFromMap != null) { logger.info("Storing overridden status {} from map", overriddenStatusFromMap); registrant.setOverriddenStatus(overriddenStatusFromMap); } // Set the status based on the overridden status rules InstanceStatus overriddenInstanceStatus = getOverriddenInstanceStatus(registrant, existingLease, isReplication); registrant.setStatusWithoutDirty(overriddenInstanceStatus); // If the lease is registered with UP status, set lease service up timestamp if (InstanceStatus.UP.equals(registrant.getStatus())) { lease.serviceUp(); } registrant.setActionType(ActionType.ADDED); recentlyChangedQueue.add(new RecentlyChangedItem(lease)); registrant.setLastUpdatedTimestamp(); invalidateCache(registrant.getAppName(), registrant.getVIPAddress(), registrant.getSecureVipAddress()); logger.info("Registered instance {}/{} with status {} (replication={})", registrant.getAppName(), registrant.getId(), registrant.getStatus(), isReplication); } finally { read.unlock(); } }
class class_name[name] begin[{] method[register, return_type[void], modifier[public], parameter[registrant, leaseDuration, isReplication]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=lock, postfix_operators=[], prefix_operators=[], qualifier=read, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAppName, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=registry, selectors=[], type_arguments=None), name=gMap)], 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InstanceInfo, sub_type=None))], dimensions=[], name=Lease, sub_type=None))], dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=isReplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=increment, postfix_operators=[], prefix_operators=[], qualifier=REGISTER, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=gMap, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InstanceInfo, sub_type=None))], dimensions=[], name=Lease, sub_type=None))], dimensions=None, name=ConcurrentHashMap, sub_type=None)), name=gNewMap)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InstanceInfo, sub_type=None))], dimensions=[], name=Lease, sub_type=None))], dimensions=[], name=ConcurrentHashMap, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=gMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAppName, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), MemberReference(member=gNewMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putIfAbsent, postfix_operators=[], prefix_operators=[], qualifier=registry, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=gMap, 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=gMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=gNewMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=gMap, selectors=[], type_arguments=None), name=existingLease)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InstanceInfo, sub_type=None))], dimensions=[], name=Lease, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=existingLease, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHolder, postfix_operators=[], prefix_operators=[], qualifier=existingLease, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=BlockStatement(label=None, statements=[SynchronizedStatement(block=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=expectedNumberOfClientsSendingRenews, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=expectedNumberOfClientsSendingRenews, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=expectedNumberOfClientsSendingRenews, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=updateRenewsPerMinThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, lock=MemberReference(member=lock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No previous lease information found; it is new registration")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getHolder, postfix_operators=[], prefix_operators=[], qualifier=existingLease, selectors=[MethodInvocation(arguments=[], member=getLastDirtyTimestamp, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=existingLastDirtyTimestamp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLastDirtyTimestamp, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), name=registrationLastDirtyTimestamp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Existing lease found (existing={}, provided={}"), MemberReference(member=existingLastDirtyTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=registrationLastDirtyTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=existingLastDirtyTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=registrationLastDirtyTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), 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="There is an existing lease and the existing lease's dirty timestamp {} is greater"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" than the one that is being registered {}"), operator=+), MemberReference(member=existingLastDirtyTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=registrationLastDirtyTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Using the existing instanceInfo instead of the new instanceInfo as the registrant")], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=registrant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getHolder, postfix_operators=[], prefix_operators=[], qualifier=existingLease, selectors=[], type_arguments=None)), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=registrant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=leaseDuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InstanceInfo, sub_type=None))], dimensions=None, name=Lease, sub_type=None)), name=lease)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InstanceInfo, sub_type=None))], dimensions=[], name=Lease, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=existingLease, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getServiceUpTimestamp, postfix_operators=[], prefix_operators=[], qualifier=existingLease, selectors=[], type_arguments=None)], member=setServiceUpTimestamp, postfix_operators=[], prefix_operators=[], qualifier=lease, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), MemberReference(member=lease, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=gMap, selectors=[], type_arguments=None), label=None), SynchronizedStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getAppName, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="("), operator=+), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=registrant, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Pair, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=recentRegisteredQueue, selectors=[], type_arguments=None), label=None)], label=None, lock=MemberReference(member=recentRegisteredQueue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOverriddenStatus, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=InstanceStatus.UNKNOWN, 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="Found overridden status {} for instance {}. Checking to see if needs to be add to the "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="overrides"), operator=+), MethodInvocation(arguments=[], member=getOverriddenStatus, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=overriddenInstanceStatusMap, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not found overridden id {} and hence adding it"), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getOverriddenStatus, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=overriddenInstanceStatusMap, selectors=[], type_arguments=None), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=overriddenInstanceStatusMap, selectors=[], type_arguments=None), name=overriddenStatusFromMap)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InstanceStatus, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=overriddenStatusFromMap, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Storing overridden status {} from map"), MemberReference(member=overriddenStatusFromMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=overriddenStatusFromMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOverriddenStatus, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=registrant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=existingLease, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isReplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOverriddenInstanceStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=overriddenInstanceStatus)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InstanceStatus, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=overriddenInstanceStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setStatusWithoutDirty, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=InstanceStatus.UP, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=serviceUp, postfix_operators=[], prefix_operators=[], qualifier=lease, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ADDED, postfix_operators=[], prefix_operators=[], qualifier=ActionType, selectors=[])], member=setActionType, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=lease, 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=RecentlyChangedItem, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=recentlyChangedQueue, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=setLastUpdatedTimestamp, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAppName, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getVIPAddress, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSecureVipAddress, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None)], member=invalidateCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Registered instance {}/{} with status {} (replication={})"), MethodInvocation(arguments=[], member=getAppName, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=registrant, selectors=[], type_arguments=None), MemberReference(member=isReplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=read, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[register] operator[SEP] identifier[InstanceInfo] identifier[registrant] , Keyword[int] identifier[leaseDuration] , Keyword[boolean] identifier[isReplication] operator[SEP] { Keyword[try] { identifier[read] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Lease] operator[<] identifier[InstanceInfo] operator[>] operator[>] identifier[gMap] operator[=] identifier[registry] operator[SEP] identifier[get] operator[SEP] identifier[registrant] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[REGISTER] operator[SEP] identifier[increment] operator[SEP] identifier[isReplication] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gMap] operator[==] Other[null] operator[SEP] { Keyword[final] identifier[ConcurrentHashMap] operator[<] identifier[String] , identifier[Lease] operator[<] identifier[InstanceInfo] operator[>] operator[>] identifier[gNewMap] operator[=] Keyword[new] identifier[ConcurrentHashMap] operator[<] identifier[String] , identifier[Lease] operator[<] identifier[InstanceInfo] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[gMap] operator[=] identifier[registry] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[registrant] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] , identifier[gNewMap] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gMap] operator[==] Other[null] operator[SEP] { identifier[gMap] operator[=] identifier[gNewMap] operator[SEP] } } identifier[Lease] operator[<] identifier[InstanceInfo] operator[>] identifier[existingLease] operator[=] identifier[gMap] operator[SEP] identifier[get] operator[SEP] identifier[registrant] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existingLease] operator[!=] Other[null] operator[&&] operator[SEP] identifier[existingLease] operator[SEP] identifier[getHolder] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] { identifier[Long] identifier[existingLastDirtyTimestamp] operator[=] identifier[existingLease] operator[SEP] identifier[getHolder] operator[SEP] operator[SEP] operator[SEP] identifier[getLastDirtyTimestamp] operator[SEP] operator[SEP] operator[SEP] identifier[Long] identifier[registrationLastDirtyTimestamp] operator[=] identifier[registrant] operator[SEP] identifier[getLastDirtyTimestamp] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[existingLastDirtyTimestamp] , identifier[registrationLastDirtyTimestamp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existingLastDirtyTimestamp] operator[>] identifier[registrationLastDirtyTimestamp] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] literal[String] , identifier[existingLastDirtyTimestamp] , identifier[registrationLastDirtyTimestamp] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[registrant] operator[=] identifier[existingLease] operator[SEP] identifier[getHolder] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[expectedNumberOfClientsSendingRenews] operator[>] Other[0] operator[SEP] { Keyword[this] operator[SEP] identifier[expectedNumberOfClientsSendingRenews] operator[=] Keyword[this] operator[SEP] identifier[expectedNumberOfClientsSendingRenews] operator[+] Other[1] operator[SEP] identifier[updateRenewsPerMinThreshold] operator[SEP] operator[SEP] operator[SEP] } } identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Lease] operator[<] identifier[InstanceInfo] operator[>] identifier[lease] operator[=] Keyword[new] identifier[Lease] operator[<] identifier[InstanceInfo] operator[>] operator[SEP] identifier[registrant] , identifier[leaseDuration] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existingLease] operator[!=] Other[null] operator[SEP] { identifier[lease] operator[SEP] identifier[setServiceUpTimestamp] operator[SEP] identifier[existingLease] operator[SEP] identifier[getServiceUpTimestamp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[gMap] operator[SEP] identifier[put] operator[SEP] identifier[registrant] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[lease] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[recentRegisteredQueue] operator[SEP] { identifier[recentRegisteredQueue] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Pair] operator[<] identifier[Long] , identifier[String] operator[>] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] , identifier[registrant] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[registrant] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[InstanceStatus] operator[SEP] identifier[UNKNOWN] operator[SEP] identifier[equals] operator[SEP] identifier[registrant] operator[SEP] identifier[getOverriddenStatus] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] literal[String] , identifier[registrant] operator[SEP] identifier[getOverriddenStatus] operator[SEP] operator[SEP] , identifier[registrant] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[overriddenInstanceStatusMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[registrant] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[registrant] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[overriddenInstanceStatusMap] operator[SEP] identifier[put] operator[SEP] identifier[registrant] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[registrant] operator[SEP] identifier[getOverriddenStatus] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[InstanceStatus] identifier[overriddenStatusFromMap] operator[=] identifier[overriddenInstanceStatusMap] operator[SEP] identifier[get] operator[SEP] identifier[registrant] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[overriddenStatusFromMap] operator[!=] Other[null] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[overriddenStatusFromMap] operator[SEP] operator[SEP] identifier[registrant] operator[SEP] identifier[setOverriddenStatus] operator[SEP] identifier[overriddenStatusFromMap] operator[SEP] operator[SEP] } identifier[InstanceStatus] identifier[overriddenInstanceStatus] operator[=] identifier[getOverriddenInstanceStatus] operator[SEP] identifier[registrant] , identifier[existingLease] , identifier[isReplication] operator[SEP] operator[SEP] identifier[registrant] operator[SEP] identifier[setStatusWithoutDirty] operator[SEP] identifier[overriddenInstanceStatus] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[InstanceStatus] operator[SEP] identifier[UP] operator[SEP] identifier[equals] operator[SEP] identifier[registrant] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[lease] operator[SEP] identifier[serviceUp] operator[SEP] operator[SEP] operator[SEP] } identifier[registrant] operator[SEP] identifier[setActionType] operator[SEP] identifier[ActionType] operator[SEP] identifier[ADDED] operator[SEP] operator[SEP] identifier[recentlyChangedQueue] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[RecentlyChangedItem] operator[SEP] identifier[lease] operator[SEP] operator[SEP] operator[SEP] identifier[registrant] operator[SEP] identifier[setLastUpdatedTimestamp] operator[SEP] operator[SEP] operator[SEP] identifier[invalidateCache] operator[SEP] identifier[registrant] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] , identifier[registrant] operator[SEP] identifier[getVIPAddress] operator[SEP] operator[SEP] , identifier[registrant] operator[SEP] identifier[getSecureVipAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[registrant] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] , identifier[registrant] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[registrant] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[isReplication] operator[SEP] operator[SEP] } Keyword[finally] { identifier[read] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public static CPDefinitionOptionRel findByUuid_C_First(String uuid, long companyId, OrderByComparator<CPDefinitionOptionRel> orderByComparator) throws com.liferay.commerce.product.exception.NoSuchCPDefinitionOptionRelException { return getPersistence() .findByUuid_C_First(uuid, companyId, orderByComparator); }
class class_name[name] begin[{] method[findByUuid_C_First, return_type[type[CPDefinitionOptionRel]], modifier[public static], parameter[uuid, companyId, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CPDefinitionOptionRel] identifier[findByUuid_C_First] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[companyId] , identifier[OrderByComparator] operator[<] identifier[CPDefinitionOptionRel] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[product] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchCPDefinitionOptionRelException] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByUuid_C_First] operator[SEP] identifier[uuid] , identifier[companyId] , identifier[orderByComparator] operator[SEP] operator[SEP] }
public final Ix<Boolean> sequenceEqual(Iterable<? extends T> other, IxPredicate2<? super T, ? super T> comparer) { return new IxSequenceEqual<T>(this, nullCheck(other, "other is null"), nullCheck(comparer, "comparer is null")); }
class class_name[name] begin[{] method[sequenceEqual, return_type[type[Ix]], modifier[final public], parameter[other, comparer]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="other is null")], member=nullCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=comparer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="comparer is null")], member=nullCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=IxSequenceEqual, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[final] identifier[Ix] operator[<] identifier[Boolean] operator[>] identifier[sequenceEqual] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[other] , identifier[IxPredicate2] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[super] identifier[T] operator[>] identifier[comparer] operator[SEP] { Keyword[return] Keyword[new] identifier[IxSequenceEqual] operator[<] identifier[T] operator[>] operator[SEP] Keyword[this] , identifier[nullCheck] operator[SEP] identifier[other] , literal[String] operator[SEP] , identifier[nullCheck] operator[SEP] identifier[comparer] , literal[String] operator[SEP] operator[SEP] operator[SEP] }
public int[] getValue() { int[] valueDestination = new int[size()]; for (int i = 0; i < size(); i++) { valueDestination[i] = value.get(i); } return valueDestination; }
class class_name[name] begin[{] method[getValue, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[int], valueDestination] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueDestination, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.valueDestination]] end[}] END[}]
Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[valueDestination] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[valueDestination] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[value] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[valueDestination] operator[SEP] }
public Long setnx(final Object key, final int expiration, final Object obj) { List<RedisClient> clients = this.getAliveClients(key); if (isAtLeastOneAvailable(clients)) { return this.execute(new BaseRedisCallBack<Long>() { public Long doOperation(RedisClient client) throws Exception { return client.setnx(key.toString(), obj, expiration); } public String getOptionType() { return "SETNX"; } }, clients, key, false); } return 0L; }
class class_name[name] begin[{] method[setnx, return_type[type[Long]], modifier[public], parameter[key, expiration, obj]] begin[{] local_variable[type[List], clients] if[call[.isAtLeastOneAvailable, parameter[member[.clients]]]] begin[{] return[THIS[call[None.execute, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=expiration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setnx, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=doOperation, parameters=[FormalParameter(annotations=[], modifiers=set(), name=client, type=ReferenceType(arguments=None, dimensions=[], name=RedisClient, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None), throws=['Exception'], type_parameters=None), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SETNX"), label=None)], documentation=None, modifiers={'public'}, name=getOptionType, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=None, name=BaseRedisCallBack, sub_type=None)), member[.clients], member[.key], literal[false]]]]] else begin[{] None end[}] return[literal[0L]] end[}] END[}]
Keyword[public] identifier[Long] identifier[setnx] operator[SEP] Keyword[final] identifier[Object] identifier[key] , Keyword[final] Keyword[int] identifier[expiration] , Keyword[final] identifier[Object] identifier[obj] operator[SEP] { identifier[List] operator[<] identifier[RedisClient] operator[>] identifier[clients] operator[=] Keyword[this] operator[SEP] identifier[getAliveClients] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isAtLeastOneAvailable] operator[SEP] identifier[clients] operator[SEP] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[BaseRedisCallBack] operator[<] identifier[Long] operator[>] operator[SEP] operator[SEP] { Keyword[public] identifier[Long] identifier[doOperation] operator[SEP] identifier[RedisClient] identifier[client] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[return] identifier[client] operator[SEP] identifier[setnx] operator[SEP] identifier[key] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[obj] , identifier[expiration] operator[SEP] operator[SEP] } Keyword[public] identifier[String] identifier[getOptionType] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } } , identifier[clients] , identifier[key] , literal[boolean] operator[SEP] operator[SEP] } Keyword[return] Other[0L] operator[SEP] }
private void assign(Relation<V> database, List<ORCLUSCluster> clusters) { NumberVectorDistanceFunction<? super V> distFunc = SquaredEuclideanDistanceFunction.STATIC; // clear the current clusters for(ORCLUSCluster cluster : clusters) { cluster.objectIDs.clear(); } // projected centroids of the clusters List<NumberVector> projectedCentroids = new ArrayList<>(clusters.size()); for(ORCLUSCluster c : clusters) { projectedCentroids.add(DoubleVector.wrap(project(c, c.centroid))); } // for each data point o do for(DBIDIter it = database.iterDBIDs(); it.valid(); it.advance()) { double[] o = database.get(it).toArray(); double minDist = Double.POSITIVE_INFINITY; ORCLUSCluster minCluster = null; // determine projected distance between o and cluster for(int i = 0; i < clusters.size(); i++) { ORCLUSCluster c = clusters.get(i); NumberVector o_proj = DoubleVector.wrap(project(c, o)); double dist = distFunc.distance(o_proj, projectedCentroids.get(i)); if(dist < minDist) { minDist = dist; minCluster = c; } } // add p to the cluster with the least value of projected distance minCluster.objectIDs.add(it); } // recompute the seed in each clusters for(ORCLUSCluster cluster : clusters) { if(cluster.objectIDs.size() > 0) { cluster.centroid = Centroid.make(database, cluster.objectIDs).toArray(); } } }
class class_name[name] begin[{] method[assign, return_type[void], modifier[private], parameter[database, clusters]] begin[{] local_variable[type[NumberVectorDistanceFunction], distFunc] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=cluster.objectIDs, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=clusters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cluster)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ORCLUSCluster, sub_type=None))), label=None) local_variable[type[List], projectedCentroids] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=centroid, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[])], member=project, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=DoubleVector, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=projectedCentroids, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=clusters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ORCLUSCluster, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=it, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=database, selectors=[MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=o)], modifiers=set(), type=BasicType(dimensions=[None], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=POSITIVE_INFINITY, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]), name=minDist)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=minCluster)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ORCLUSCluster, sub_type=None)), 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=clusters, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ORCLUSCluster, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=project, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=DoubleVector, selectors=[], type_arguments=None), name=o_proj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NumberVector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=o_proj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=projectedCentroids, selectors=[], type_arguments=None)], member=distance, postfix_operators=[], prefix_operators=[], qualifier=distFunc, selectors=[], type_arguments=None), name=dist)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=minDist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=minDist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=minCluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=clusters, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=it, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=minCluster.objectIDs, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=valid, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterDBIDs, postfix_operators=[], prefix_operators=[], qualifier=database, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DBIDIter, sub_type=None)), update=[MethodInvocation(arguments=[], member=advance, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None)]), label=None) ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=cluster.objectIDs, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=centroid, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=database, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=objectIDs, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[])], member=make, postfix_operators=[], prefix_operators=[], qualifier=Centroid, selectors=[MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=clusters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cluster)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ORCLUSCluster, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[assign] operator[SEP] identifier[Relation] operator[<] identifier[V] operator[>] identifier[database] , identifier[List] operator[<] identifier[ORCLUSCluster] operator[>] identifier[clusters] operator[SEP] { identifier[NumberVectorDistanceFunction] operator[<] operator[?] Keyword[super] identifier[V] operator[>] identifier[distFunc] operator[=] identifier[SquaredEuclideanDistanceFunction] operator[SEP] identifier[STATIC] operator[SEP] Keyword[for] operator[SEP] identifier[ORCLUSCluster] identifier[cluster] operator[:] identifier[clusters] operator[SEP] { identifier[cluster] operator[SEP] identifier[objectIDs] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[NumberVector] operator[>] identifier[projectedCentroids] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[clusters] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ORCLUSCluster] identifier[c] operator[:] identifier[clusters] operator[SEP] { identifier[projectedCentroids] operator[SEP] identifier[add] operator[SEP] identifier[DoubleVector] operator[SEP] identifier[wrap] operator[SEP] identifier[project] operator[SEP] identifier[c] , identifier[c] operator[SEP] identifier[centroid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[DBIDIter] identifier[it] operator[=] identifier[database] operator[SEP] identifier[iterDBIDs] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[valid] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[advance] operator[SEP] operator[SEP] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] identifier[o] operator[=] identifier[database] operator[SEP] identifier[get] operator[SEP] identifier[it] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[minDist] operator[=] identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] operator[SEP] identifier[ORCLUSCluster] identifier[minCluster] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[clusters] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ORCLUSCluster] identifier[c] operator[=] identifier[clusters] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[NumberVector] identifier[o_proj] operator[=] identifier[DoubleVector] operator[SEP] identifier[wrap] operator[SEP] identifier[project] operator[SEP] identifier[c] , identifier[o] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[dist] operator[=] identifier[distFunc] operator[SEP] identifier[distance] operator[SEP] identifier[o_proj] , identifier[projectedCentroids] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dist] operator[<] identifier[minDist] operator[SEP] { identifier[minDist] operator[=] identifier[dist] operator[SEP] identifier[minCluster] operator[=] identifier[c] operator[SEP] } } identifier[minCluster] operator[SEP] identifier[objectIDs] operator[SEP] identifier[add] operator[SEP] identifier[it] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ORCLUSCluster] identifier[cluster] operator[:] identifier[clusters] operator[SEP] { Keyword[if] operator[SEP] identifier[cluster] operator[SEP] identifier[objectIDs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[cluster] operator[SEP] identifier[centroid] operator[=] identifier[Centroid] operator[SEP] identifier[make] operator[SEP] identifier[database] , identifier[cluster] operator[SEP] identifier[objectIDs] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] } } }
public Process runWithConfirmation(String id, Class<?> klass, String[] javaArguments, String[] processArguments) throws IOException, InterruptedException { Process process = startProcess(id, klass, javaArguments, processArguments, true); waitConfirmation(klass.getSimpleName(), process); new StreamRedirector(process.getInputStream(), klass.getSimpleName() + PROCESS_STDOUT_STREAM_PREFIX, redirectProcessInputStreamToParentProcessStdOut).start(); return process; }
class class_name[name] begin[{] method[runWithConfirmation, return_type[type[Process]], modifier[public], parameter[id, klass, javaArguments, processArguments]] begin[{] local_variable[type[Process], process] call[.waitConfirmation, parameter[call[klass.getSimpleName, parameter[]], member[.process]]] ClassCreator(arguments=[MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=process, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=klass, selectors=[], type_arguments=None), operandr=MemberReference(member=PROCESS_STDOUT_STREAM_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=redirectProcessInputStreamToParentProcessStdOut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=start, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StreamRedirector, sub_type=None)) return[member[.process]] end[}] END[}]
Keyword[public] identifier[Process] identifier[runWithConfirmation] operator[SEP] identifier[String] identifier[id] , identifier[Class] operator[<] operator[?] operator[>] identifier[klass] , identifier[String] operator[SEP] operator[SEP] identifier[javaArguments] , identifier[String] operator[SEP] operator[SEP] identifier[processArguments] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] { identifier[Process] identifier[process] operator[=] identifier[startProcess] operator[SEP] identifier[id] , identifier[klass] , identifier[javaArguments] , identifier[processArguments] , literal[boolean] operator[SEP] operator[SEP] identifier[waitConfirmation] operator[SEP] identifier[klass] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[process] operator[SEP] operator[SEP] Keyword[new] identifier[StreamRedirector] operator[SEP] identifier[process] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] , identifier[klass] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] identifier[PROCESS_STDOUT_STREAM_PREFIX] , identifier[redirectProcessInputStreamToParentProcessStdOut] operator[SEP] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[process] operator[SEP] }
public void marshall(ResolveCustomerRequest resolveCustomerRequest, ProtocolMarshaller protocolMarshaller) { if (resolveCustomerRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(resolveCustomerRequest.getRegistrationToken(), REGISTRATIONTOKEN_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[resolveCustomerRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.resolveCustomerRequest], ==, 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=getRegistrationToken, postfix_operators=[], prefix_operators=[], qualifier=resolveCustomerRequest, selectors=[], type_arguments=None), MemberReference(member=REGISTRATIONTOKEN_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[ResolveCustomerRequest] identifier[resolveCustomerRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[resolveCustomerRequest] 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[resolveCustomerRequest] operator[SEP] identifier[getRegistrationToken] operator[SEP] operator[SEP] , identifier[REGISTRATIONTOKEN_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] } }
@SuppressWarnings("unchecked") void resize(int newCapacity) { Entry<K,V>[] oldTable = table; int oldCapacity = oldTable.length; if (oldCapacity == MAXIMUM_CAPACITY) { threshold = Integer.MAX_VALUE; return; } Entry<K,V>[] newTable = new Entry[newCapacity]; transfer(newTable); table = newTable; threshold = (int)(newCapacity * loadFactor); }
class class_name[name] begin[{] method[resize, return_type[void], modifier[default], parameter[newCapacity]] begin[{] local_variable[type[Entry], oldTable] local_variable[type[int], oldCapacity] if[binary_operation[member[.oldCapacity], ==, member[.MAXIMUM_CAPACITY]]] begin[{] assign[member[.threshold], member[Integer.MAX_VALUE]] return[None] else begin[{] None end[}] local_variable[type[Entry], newTable] call[.transfer, parameter[member[.newTable]]] assign[member[.table], member[.newTable]] assign[member[.threshold], Cast(expression=BinaryOperation(operandl=MemberReference(member=newCapacity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=loadFactor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), type=BasicType(dimensions=[], name=int))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[void] identifier[resize] operator[SEP] Keyword[int] identifier[newCapacity] operator[SEP] { identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] operator[SEP] identifier[oldTable] operator[=] identifier[table] operator[SEP] Keyword[int] identifier[oldCapacity] operator[=] identifier[oldTable] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[oldCapacity] operator[==] identifier[MAXIMUM_CAPACITY] operator[SEP] { identifier[threshold] operator[=] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[return] operator[SEP] } identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] operator[SEP] identifier[newTable] operator[=] Keyword[new] identifier[Entry] operator[SEP] identifier[newCapacity] operator[SEP] operator[SEP] identifier[transfer] operator[SEP] identifier[newTable] operator[SEP] operator[SEP] identifier[table] operator[=] identifier[newTable] operator[SEP] identifier[threshold] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[newCapacity] operator[*] identifier[loadFactor] operator[SEP] operator[SEP] }
public static <K,V> Storage<K,V> createHashMapStorage(){ return new Storage<K,V>(new MapStorageWrapper<K, V>(new HashMap<K, V>())); }
class class_name[name] begin[{] method[createHashMapStorage, return_type[type[Storage]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[ClassCreator(arguments=[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=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))], 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=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=MapStorageWrapper, sub_type=None))], 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=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=Storage, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Storage] operator[<] identifier[K] , identifier[V] operator[>] identifier[createHashMapStorage] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Storage] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] Keyword[new] identifier[MapStorageWrapper] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] Keyword[new] identifier[HashMap] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public WebElement waitForElement(By by) { int attempts = 0; int size = driver.findElements(by).size(); while (size == 0) { size = driver.findElements(by).size(); if (attempts == MAX_ATTEMPTS) fail(String.format("Could not find %s after %d seconds", by.toString(), MAX_ATTEMPTS)); attempts++; try { Thread.sleep(1000); // sleep for 1 second. } catch (Exception x) { fail("Failed due to an exception during Thread.sleep!"); x.printStackTrace(); } } if (size > 1) System.err.println("WARN: There are more than 1 " + by.toString() + " 's!"); return driver.findElement(by); }
class class_name[name] begin[{] method[waitForElement, return_type[type[WebElement]], modifier[public], parameter[by]] begin[{] local_variable[type[int], attempts] local_variable[type[int], size] while[binary_operation[member[.size], ==, literal[0]]] begin[{] assign[member[.size], call[driver.findElements, parameter[member[.by]]]] if[binary_operation[member[.attempts], ==, member[.MAX_ATTEMPTS]]] begin[{] call[.fail, parameter[call[String.format, parameter[literal["Could not find %s after %d seconds"], call[by.toString, parameter[]], member[.MAX_ATTEMPTS]]]]] else begin[{] None end[}] member[.attempts] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed due to an exception during Thread.sleep!")], member=fail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=x, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] if[binary_operation[member[.size], >, literal[1]]] begin[{] call[System.err.println, parameter[binary_operation[binary_operation[literal["WARN: There are more than 1 "], +, call[by.toString, parameter[]]], +, literal[" 's!"]]]] else begin[{] None end[}] return[call[driver.findElement, parameter[member[.by]]]] end[}] END[}]
Keyword[public] identifier[WebElement] identifier[waitForElement] operator[SEP] identifier[By] identifier[by] operator[SEP] { Keyword[int] identifier[attempts] operator[=] Other[0] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[driver] operator[SEP] identifier[findElements] operator[SEP] identifier[by] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[size] operator[==] Other[0] operator[SEP] { identifier[size] operator[=] identifier[driver] operator[SEP] identifier[findElements] operator[SEP] identifier[by] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attempts] operator[==] identifier[MAX_ATTEMPTS] operator[SEP] identifier[fail] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[by] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[MAX_ATTEMPTS] operator[SEP] operator[SEP] operator[SEP] identifier[attempts] operator[++] operator[SEP] Keyword[try] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[1000] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[x] operator[SEP] { identifier[fail] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[x] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[size] operator[>] Other[1] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[by] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[driver] operator[SEP] identifier[findElement] operator[SEP] identifier[by] operator[SEP] operator[SEP] }
public static Map<String, String[]> parameter2Map(final IRequestParameters _parameters) { final Map<String, String[]> ret = new HashMap<>(); for (final String name : _parameters.getParameterNames()) { ret.put(name, ParameterUtil.parameter2Array(_parameters, name)); } return ret; }
class class_name[name] begin[{] method[parameter2Map, return_type[type[Map]], modifier[public static], parameter[_parameters]] begin[{] local_variable[type[Map], ret] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=_parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parameter2Array, postfix_operators=[], prefix_operators=[], qualifier=ParameterUtil, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getParameterNames, postfix_operators=[], prefix_operators=[], qualifier=_parameters, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[SEP] operator[SEP] operator[>] identifier[parameter2Map] operator[SEP] Keyword[final] identifier[IRequestParameters] identifier[_parameters] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[SEP] operator[SEP] operator[>] identifier[ret] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[:] identifier[_parameters] operator[SEP] identifier[getParameterNames] operator[SEP] operator[SEP] operator[SEP] { identifier[ret] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[ParameterUtil] operator[SEP] identifier[parameter2Array] operator[SEP] identifier[_parameters] , identifier[name] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
public Converter<OrmDescriptor> getOrCreateConverter() { List<Node> nodeList = model.get("converter"); if (nodeList != null && nodeList.size() > 0) { return new ConverterImpl<OrmDescriptor>(this, "converter", model, nodeList.get(0)); } return createConverter(); }
class class_name[name] begin[{] method[getOrCreateConverter, return_type[type[Converter]], modifier[public], parameter[]] begin[{] local_variable[type[List], nodeList] if[binary_operation[binary_operation[member[.nodeList], !=, literal[null]], &&, binary_operation[call[nodeList.size, parameter[]], >, literal[0]]]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="converter"), MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=nodeList, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=OrmDescriptor, sub_type=None))], dimensions=None, name=ConverterImpl, sub_type=None))] else begin[{] None end[}] return[call[.createConverter, parameter[]]] end[}] END[}]
Keyword[public] identifier[Converter] operator[<] identifier[OrmDescriptor] operator[>] identifier[getOrCreateConverter] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Node] operator[>] identifier[nodeList] operator[=] identifier[model] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodeList] operator[!=] Other[null] operator[&&] identifier[nodeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] Keyword[new] identifier[ConverterImpl] operator[<] identifier[OrmDescriptor] operator[>] operator[SEP] Keyword[this] , literal[String] , identifier[model] , identifier[nodeList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[createConverter] operator[SEP] operator[SEP] operator[SEP] }
public String resolveProps(@Nullable String s) { if (s == null) { return null; } int ipos = 0; int pos = s.indexOf("${", ipos); if (pos == -1) return s; StringBuilder sb = new StringBuilder(); while (ipos < s.length()) { pos = s.indexOf("${", ipos); if (pos < 0) { sb.append(s.substring(ipos)); break; } if (pos != ipos) sb.append(s.substring(ipos, pos)); int end = s.indexOf('}', pos); if (end < 0) break; int start = pos + 2; String key = s.substring(start, end); String val = resolveString(key); if (val != null) sb.append(val); else sb.append("${").append(key).append("}"); ipos = end + 1; } return sb.toString(); }
class class_name[name] begin[{] method[resolveProps, return_type[type[String]], modifier[public], parameter[s]] begin[{] if[binary_operation[member[.s], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], ipos] local_variable[type[int], pos] if[binary_operation[member[.pos], ==, literal[1]]] begin[{] return[member[.s]] else begin[{] None end[}] local_variable[type[StringBuilder], sb] while[binary_operation[member[.ipos], <, call[s.length, parameter[]]]] begin[{] assign[member[.pos], call[s.indexOf, parameter[literal["${"], member[.ipos]]]] if[binary_operation[member[.pos], <, literal[0]]] begin[{] call[sb.append, parameter[call[s.substring, parameter[member[.ipos]]]]] BreakStatement(goto=None, label=None) else begin[{] None end[}] if[binary_operation[member[.pos], !=, member[.ipos]]] begin[{] call[sb.append, parameter[call[s.substring, parameter[member[.ipos], member[.pos]]]]] else begin[{] None end[}] local_variable[type[int], end] if[binary_operation[member[.end], <, literal[0]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[int], start] local_variable[type[String], key] local_variable[type[String], val] if[binary_operation[member[.val], !=, literal[null]]] begin[{] call[sb.append, parameter[member[.val]]] else begin[{] call[sb.append, parameter[literal["${"]]] end[}] assign[member[.ipos], binary_operation[member[.end], +, literal[1]]] end[}] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[resolveProps] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[s] operator[SEP] { Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[ipos] operator[=] Other[0] operator[SEP] Keyword[int] identifier[pos] operator[=] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[ipos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[==] operator[-] Other[1] operator[SEP] Keyword[return] identifier[s] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[ipos] operator[<] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[pos] operator[=] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[ipos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[<] Other[0] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[ipos] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[if] operator[SEP] identifier[pos] operator[!=] identifier[ipos] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[ipos] , identifier[pos] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[pos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[end] operator[<] Other[0] operator[SEP] Keyword[break] operator[SEP] Keyword[int] identifier[start] operator[=] identifier[pos] operator[+] Other[2] operator[SEP] identifier[String] identifier[key] operator[=] identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[end] operator[SEP] operator[SEP] identifier[String] identifier[val] operator[=] identifier[resolveString] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[!=] Other[null] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[val] operator[SEP] operator[SEP] Keyword[else] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ipos] operator[=] identifier[end] operator[+] Other[1] operator[SEP] } Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
ServiceName serviceName(final String name) { RuntimeCapability<?> dynamicCapability = runtimeCapability.fromBaseCapability(name); return dynamicCapability.getCapabilityServiceName(clazz); }
class class_name[name] begin[{] method[serviceName, return_type[type[ServiceName]], modifier[default], parameter[name]] begin[{] local_variable[type[RuntimeCapability], dynamicCapability] return[call[dynamicCapability.getCapabilityServiceName, parameter[member[.clazz]]]] end[}] END[}]
identifier[ServiceName] identifier[serviceName] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] { identifier[RuntimeCapability] operator[<] operator[?] operator[>] identifier[dynamicCapability] operator[=] identifier[runtimeCapability] operator[SEP] identifier[fromBaseCapability] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[dynamicCapability] operator[SEP] identifier[getCapabilityServiceName] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] }
public Pair<Expr[], Context> translateExpressionsWithChecks(Tuple<WyilFile.Expr> exprs, Context context) { // Generate expression preconditions as verification conditions for (WyilFile.Expr expr : exprs) { checkExpressionPreconditions(expr, context); } // Gather up any postconditions from function invocations. for (WyilFile.Expr expr : exprs) { context = assumeExpressionPostconditions(expr, context); } // Translate expression in the normal fashion return new Pair<>(translateExpressions(exprs, context.getEnvironment()), context); }
class class_name[name] begin[{] method[translateExpressionsWithChecks, return_type[type[Pair]], modifier[public], parameter[exprs, context]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkExpressionPreconditions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=exprs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=expr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WyilFile, sub_type=ReferenceType(arguments=None, dimensions=None, name=Expr, sub_type=None)))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=assumeExpressionPostconditions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=exprs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=expr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WyilFile, sub_type=ReferenceType(arguments=None, dimensions=None, name=Expr, sub_type=None)))), label=None) return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=exprs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getEnvironment, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=translateExpressions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Pair, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Pair] operator[<] identifier[Expr] operator[SEP] operator[SEP] , identifier[Context] operator[>] identifier[translateExpressionsWithChecks] operator[SEP] identifier[Tuple] operator[<] identifier[WyilFile] operator[SEP] identifier[Expr] operator[>] identifier[exprs] , identifier[Context] identifier[context] operator[SEP] { Keyword[for] operator[SEP] identifier[WyilFile] operator[SEP] identifier[Expr] identifier[expr] operator[:] identifier[exprs] operator[SEP] { identifier[checkExpressionPreconditions] operator[SEP] identifier[expr] , identifier[context] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[WyilFile] operator[SEP] identifier[Expr] identifier[expr] operator[:] identifier[exprs] operator[SEP] { identifier[context] operator[=] identifier[assumeExpressionPostconditions] operator[SEP] identifier[expr] , identifier[context] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Pair] operator[<] operator[>] operator[SEP] identifier[translateExpressions] operator[SEP] identifier[exprs] , identifier[context] operator[SEP] identifier[getEnvironment] operator[SEP] operator[SEP] operator[SEP] , identifier[context] operator[SEP] operator[SEP] }
public static void manage(String domain, Injector injector) { manage(ManagementFactory.getPlatformMBeanServer(), domain, injector); }
class class_name[name] begin[{] method[manage, return_type[void], modifier[public static], parameter[domain, injector]] begin[{] call[.manage, parameter[call[ManagementFactory.getPlatformMBeanServer, parameter[]], member[.domain], member[.injector]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[manage] operator[SEP] identifier[String] identifier[domain] , identifier[Injector] identifier[injector] operator[SEP] { identifier[manage] operator[SEP] identifier[ManagementFactory] operator[SEP] identifier[getPlatformMBeanServer] operator[SEP] operator[SEP] , identifier[domain] , identifier[injector] operator[SEP] operator[SEP] }
@Override public <X> EntityType<X> entity(Class<X> paramClass) { EntityType entityType = entityTypes.get(paramClass); if (entityType == null) { throw new IllegalArgumentException("Not an entity, {class:" + paramClass + "}"); } return entityType; }
class class_name[name] begin[{] method[entity, return_type[type[EntityType]], modifier[public], parameter[paramClass]] begin[{] local_variable[type[EntityType], entityType] if[binary_operation[member[.entityType], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not an entity, {class:"), operandr=MemberReference(member=paramClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="}"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.entityType]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[X] operator[>] identifier[EntityType] operator[<] identifier[X] operator[>] identifier[entity] operator[SEP] identifier[Class] operator[<] identifier[X] operator[>] identifier[paramClass] operator[SEP] { identifier[EntityType] identifier[entityType] operator[=] identifier[entityTypes] operator[SEP] identifier[get] operator[SEP] identifier[paramClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entityType] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[paramClass] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[entityType] operator[SEP] }
public static <T1, T2, T3, T4> Quadruple<T1, T2, T3, T4> newTuple( T1 e1, T2 e2, T3 e3, T4 e4) { return new Quadruple<T1, T2, T3, T4>(e1, e2, e3, e4); }
class class_name[name] begin[{] method[newTuple, return_type[type[Quadruple]], modifier[public static], parameter[e1, e2, e3, e4]] begin[{] return[ClassCreator(arguments=[MemberReference(member=e1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T1, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T2, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T3, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T4, sub_type=None))], dimensions=None, name=Quadruple, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] operator[>] identifier[Quadruple] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] operator[>] identifier[newTuple] operator[SEP] identifier[T1] identifier[e1] , identifier[T2] identifier[e2] , identifier[T3] identifier[e3] , identifier[T4] identifier[e4] operator[SEP] { Keyword[return] Keyword[new] identifier[Quadruple] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] operator[>] operator[SEP] identifier[e1] , identifier[e2] , identifier[e3] , identifier[e4] operator[SEP] operator[SEP] }
private int getAvailableSlots(TaskTrackerStatus tts, TaskType type) { return getMaxSlots(tts, type) - occupiedSlotsAfterHeartbeat(tts, type); }
class class_name[name] begin[{] method[getAvailableSlots, return_type[type[int]], modifier[private], parameter[tts, type]] begin[{] return[binary_operation[call[.getMaxSlots, parameter[member[.tts], member[.type]]], -, call[.occupiedSlotsAfterHeartbeat, parameter[member[.tts], member[.type]]]]] end[}] END[}]
Keyword[private] Keyword[int] identifier[getAvailableSlots] operator[SEP] identifier[TaskTrackerStatus] identifier[tts] , identifier[TaskType] identifier[type] operator[SEP] { Keyword[return] identifier[getMaxSlots] operator[SEP] identifier[tts] , identifier[type] operator[SEP] operator[-] identifier[occupiedSlotsAfterHeartbeat] operator[SEP] identifier[tts] , identifier[type] operator[SEP] operator[SEP] }
private void readMessage() throws IOException { while (true) { if (closed) throw new IOException("closed"); if (frameLength > 0) { source.readFully(messageFrameBuffer, frameLength); if (!isClient) { messageFrameBuffer.readAndWriteUnsafe(maskCursor); maskCursor.seek(messageFrameBuffer.size() - frameLength); toggleMask(maskCursor, maskKey); maskCursor.close(); } } if (isFinalFrame) break; // We are exhausted and have no continuations. readUntilNonControlFrame(); if (opcode != OPCODE_CONTINUATION) { throw new ProtocolException("Expected continuation opcode. Got: " + toHexString(opcode)); } } }
class class_name[name] begin[{] method[readMessage, return_type[void], modifier[private], parameter[]] begin[{] while[literal[true]] begin[{] if[member[.closed]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="closed")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.frameLength], >, literal[0]]] begin[{] call[source.readFully, parameter[member[.messageFrameBuffer], member[.frameLength]]] if[member[.isClient]] begin[{] call[messageFrameBuffer.readAndWriteUnsafe, parameter[member[.maskCursor]]] call[maskCursor.seek, parameter[binary_operation[call[messageFrameBuffer.size, parameter[]], -, member[.frameLength]]]] call[.toggleMask, parameter[member[.maskCursor], member[.maskKey]]] call[maskCursor.close, parameter[]] else begin[{] None end[}] else begin[{] None end[}] if[member[.isFinalFrame]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] call[.readUntilNonControlFrame, parameter[]] if[binary_operation[member[.opcode], !=, member[.OPCODE_CONTINUATION]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected continuation opcode. Got: "), operandr=MethodInvocation(arguments=[MemberReference(member=opcode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProtocolException, sub_type=None)), label=None) else begin[{] None end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[readMessage] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[closed] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[frameLength] operator[>] Other[0] operator[SEP] { identifier[source] operator[SEP] identifier[readFully] operator[SEP] identifier[messageFrameBuffer] , identifier[frameLength] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isClient] operator[SEP] { identifier[messageFrameBuffer] operator[SEP] identifier[readAndWriteUnsafe] operator[SEP] identifier[maskCursor] operator[SEP] operator[SEP] identifier[maskCursor] operator[SEP] identifier[seek] operator[SEP] identifier[messageFrameBuffer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] identifier[frameLength] operator[SEP] operator[SEP] identifier[toggleMask] operator[SEP] identifier[maskCursor] , identifier[maskKey] operator[SEP] operator[SEP] identifier[maskCursor] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[isFinalFrame] operator[SEP] Keyword[break] operator[SEP] identifier[readUntilNonControlFrame] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[opcode] operator[!=] identifier[OPCODE_CONTINUATION] operator[SEP] { Keyword[throw] Keyword[new] identifier[ProtocolException] operator[SEP] literal[String] operator[+] identifier[toHexString] operator[SEP] identifier[opcode] operator[SEP] operator[SEP] operator[SEP] } } }
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "median") public JAXBElement<MedianType> createMedian(MedianType value) { return new JAXBElement<MedianType>(_Median_QNAME, MedianType.class, null, value); }
class class_name[name] begin[{] method[createMedian, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Median_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MedianType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MedianType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[MedianType] operator[>] identifier[createMedian] operator[SEP] identifier[MedianType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[MedianType] operator[>] operator[SEP] identifier[_Median_QNAME] , identifier[MedianType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public static String toHex(byte[] b) { char[] buf = new char[b.length * 2]; int j = 0; int k; for (byte aB : b) { k = aB; buf[j++] = HEX[(k >>> 4) & 0x0F]; buf[j++] = HEX[k & 0x0F]; } return new String(buf); }
class class_name[name] begin[{] method[toHex, return_type[type[String]], modifier[public static], parameter[b]] begin[{] local_variable[type[char], buf] local_variable[type[int], j] local_variable[type[int], k] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=aB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=HEX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=>>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x0F), operator=&))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=HEX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x0F), operator=&))])), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aB)], modifiers=set(), type=BasicType(dimensions=[], name=byte))), label=None) return[ClassCreator(arguments=[MemberReference(member=buf, 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=String, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[toHex] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[SEP] { Keyword[char] operator[SEP] operator[SEP] identifier[buf] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[b] operator[SEP] identifier[length] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[int] identifier[k] operator[SEP] Keyword[for] operator[SEP] Keyword[byte] identifier[aB] operator[:] identifier[b] operator[SEP] { identifier[k] operator[=] identifier[aB] operator[SEP] identifier[buf] operator[SEP] identifier[j] operator[++] operator[SEP] operator[=] identifier[HEX] operator[SEP] operator[SEP] identifier[k] operator[>] operator[>] operator[>] Other[4] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[j] operator[++] operator[SEP] operator[=] identifier[HEX] operator[SEP] identifier[k] operator[&] literal[Integer] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[buf] operator[SEP] operator[SEP] }
public synchronized int write(int plane, byte data[], int offset, int length) { if (offset < 0 || length < 0 || length > data.length - offset) { throw new IndexOutOfBoundsException(); } if (bytesToWrite[plane] == 0) return 0; if (bytesToWrite[plane] < length) length = bytesToWrite[plane]; buffer[plane].position(writePointer[plane]); int partLength = buffer[plane].capacity() - writePointer[plane]; if (partLength > length) { buffer[plane].put(data, offset, length); writePointer[plane] += length; } else { buffer[plane].put(data, offset, partLength); buffer[plane].position(0); buffer[plane].put(data, offset + partLength, length - partLength); writePointer[plane] = length - partLength; } bytesToRead[plane] += length; bytesToWrite[plane] -= length; return length; }
class class_name[name] begin[{] method[write, return_type[type[int]], modifier[synchronized public], parameter[plane, data, offset, length]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.offset], <, literal[0]], ||, binary_operation[member[.length], <, literal[0]]], ||, binary_operation[member[.length], >, binary_operation[member[data.length], -, member[.offset]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.bytesToWrite], ==, literal[0]]] begin[{] return[literal[0]] else begin[{] None end[}] if[binary_operation[member[.bytesToWrite], <, member[.length]]] begin[{] assign[member[.length], member[.bytesToWrite]] else begin[{] None end[}] member[.buffer] local_variable[type[int], partLength] if[binary_operation[member[.partLength], >, member[.length]]] begin[{] member[.buffer] assign[member[.writePointer], member[.length]] else begin[{] member[.buffer] member[.buffer] member[.buffer] assign[member[.writePointer], binary_operation[member[.length], -, member[.partLength]]] end[}] assign[member[.bytesToRead], member[.length]] assign[member[.bytesToWrite], member[.length]] return[member[.length]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[int] identifier[write] operator[SEP] Keyword[int] identifier[plane] , Keyword[byte] identifier[data] operator[SEP] operator[SEP] , Keyword[int] identifier[offset] , Keyword[int] identifier[length] operator[SEP] { Keyword[if] operator[SEP] identifier[offset] operator[<] Other[0] operator[||] identifier[length] operator[<] Other[0] operator[||] identifier[length] operator[>] identifier[data] operator[SEP] identifier[length] operator[-] identifier[offset] operator[SEP] { Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[bytesToWrite] operator[SEP] identifier[plane] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[bytesToWrite] operator[SEP] identifier[plane] operator[SEP] operator[<] identifier[length] operator[SEP] identifier[length] operator[=] identifier[bytesToWrite] operator[SEP] identifier[plane] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[plane] operator[SEP] operator[SEP] identifier[position] operator[SEP] identifier[writePointer] operator[SEP] identifier[plane] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[partLength] operator[=] identifier[buffer] operator[SEP] identifier[plane] operator[SEP] operator[SEP] identifier[capacity] operator[SEP] operator[SEP] operator[-] identifier[writePointer] operator[SEP] identifier[plane] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[partLength] operator[>] identifier[length] operator[SEP] { identifier[buffer] operator[SEP] identifier[plane] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[data] , identifier[offset] , identifier[length] operator[SEP] operator[SEP] identifier[writePointer] operator[SEP] identifier[plane] operator[SEP] operator[+=] identifier[length] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[plane] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[data] , identifier[offset] , identifier[partLength] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[plane] operator[SEP] operator[SEP] identifier[position] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[plane] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[data] , identifier[offset] operator[+] identifier[partLength] , identifier[length] operator[-] identifier[partLength] operator[SEP] operator[SEP] identifier[writePointer] operator[SEP] identifier[plane] operator[SEP] operator[=] identifier[length] operator[-] identifier[partLength] operator[SEP] } identifier[bytesToRead] operator[SEP] identifier[plane] operator[SEP] operator[+=] identifier[length] operator[SEP] identifier[bytesToWrite] operator[SEP] identifier[plane] operator[SEP] operator[-=] identifier[length] operator[SEP] Keyword[return] identifier[length] operator[SEP] }
public byte[] toBytes() { this.allIndex += this.index; item.setLimit(this.index); byte[] result = new byte[this.allIndex]; if (null != otherItem) { otherItem.add(item); item = null; for (int i = 0; i < otherItem.size(); i++) { ByteArrayItem temp = otherItem.get(i); int limit = temp.getLimit(); if (limit > 0) { System.arraycopy(temp.getArray(), 0, result, temp.getBaIndex(), limit); } temp.recycle(); } otherItem.clear(); otherItem = null; } else { byte[] buffer = item.getArray(); System.arraycopy(buffer, 0, result, 0, this.allIndex); item.recycle(); item = null; } return result; }
class class_name[name] begin[{] method[toBytes, return_type[type[byte]], modifier[public], parameter[]] begin[{] assign[THIS[member[None.allIndex]], THIS[member[None.index]]] call[item.setLimit, parameter[THIS[member[None.index]]]] local_variable[type[byte], result] if[binary_operation[literal[null], !=, member[.otherItem]]] begin[{] call[otherItem.add, parameter[member[.item]]] assign[member[.item], literal[null]] 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=otherItem, selectors=[], type_arguments=None), name=temp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayItem, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLimit, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), name=limit)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getArray, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getBaIndex, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=recycle, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=otherItem, 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) call[otherItem.clear, parameter[]] assign[member[.otherItem], literal[null]] else begin[{] local_variable[type[byte], buffer] call[System.arraycopy, parameter[member[.buffer], literal[0], member[.result], literal[0], THIS[member[None.allIndex]]]] call[item.recycle, parameter[]] assign[member[.item], literal[null]] end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[toBytes] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[allIndex] operator[+=] Keyword[this] operator[SEP] identifier[index] operator[SEP] identifier[item] operator[SEP] identifier[setLimit] operator[SEP] Keyword[this] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] Keyword[byte] operator[SEP] Keyword[this] operator[SEP] identifier[allIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[otherItem] operator[SEP] { identifier[otherItem] operator[SEP] identifier[add] operator[SEP] identifier[item] operator[SEP] operator[SEP] identifier[item] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[otherItem] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ByteArrayItem] identifier[temp] operator[=] identifier[otherItem] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[limit] operator[=] identifier[temp] operator[SEP] identifier[getLimit] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[limit] operator[>] Other[0] operator[SEP] { identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[temp] operator[SEP] identifier[getArray] operator[SEP] operator[SEP] , Other[0] , identifier[result] , identifier[temp] operator[SEP] identifier[getBaIndex] operator[SEP] operator[SEP] , identifier[limit] operator[SEP] operator[SEP] } identifier[temp] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP] } identifier[otherItem] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[otherItem] operator[=] Other[null] operator[SEP] } Keyword[else] { Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] identifier[item] operator[SEP] identifier[getArray] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[buffer] , Other[0] , identifier[result] , Other[0] , Keyword[this] operator[SEP] identifier[allIndex] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP] identifier[item] operator[=] Other[null] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public int setTraceLevel(final int level) { final int oldLevel = traceLevel; // pin the value int theLevel = level; if (level < 0) { theLevel = 0; } else if (level > 4) { theLevel = 4; } traceLevel = theLevel; return oldLevel; }
class class_name[name] begin[{] method[setTraceLevel, return_type[type[int]], modifier[public], parameter[level]] begin[{] local_variable[type[int], oldLevel] local_variable[type[int], theLevel] if[binary_operation[member[.level], <, literal[0]]] begin[{] assign[member[.theLevel], literal[0]] else begin[{] if[binary_operation[member[.level], >, literal[4]]] begin[{] assign[member[.theLevel], literal[4]] else begin[{] None end[}] end[}] assign[member[.traceLevel], member[.theLevel]] return[member[.oldLevel]] end[}] END[}]
Keyword[public] Keyword[int] identifier[setTraceLevel] operator[SEP] Keyword[final] Keyword[int] identifier[level] operator[SEP] { Keyword[final] Keyword[int] identifier[oldLevel] operator[=] identifier[traceLevel] operator[SEP] Keyword[int] identifier[theLevel] operator[=] identifier[level] operator[SEP] Keyword[if] operator[SEP] identifier[level] operator[<] Other[0] operator[SEP] { identifier[theLevel] operator[=] Other[0] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[level] operator[>] Other[4] operator[SEP] { identifier[theLevel] operator[=] Other[4] operator[SEP] } identifier[traceLevel] operator[=] identifier[theLevel] operator[SEP] Keyword[return] identifier[oldLevel] operator[SEP] }
public static DMatrixRMaj toHomogeneous( Se3_F64 se, DMatrixRMaj ret ) { if( ret == null ) ret = new DMatrixRMaj( 4, 4 ); else { ret.set( 3, 0, 0 ); ret.set( 3, 1, 0 ); ret.set( 3, 2, 0 ); } CommonOps_DDRM.insert( se.getR(), ret, 0, 0 ); Vector3D_F64 T = se.getT(); ret.set( 0, 3, T.x ); ret.set( 1, 3, T.y ); ret.set( 2, 3, T.z ); ret.set( 3, 3, 1 ); return ret; }
class class_name[name] begin[{] method[toHomogeneous, return_type[type[DMatrixRMaj]], modifier[public static], parameter[se, ret]] begin[{] if[binary_operation[member[.ret], ==, literal[null]]] begin[{] assign[member[.ret], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DMatrixRMaj, sub_type=None))] else begin[{] call[ret.set, parameter[literal[3], literal[0], literal[0]]] call[ret.set, parameter[literal[3], literal[1], literal[0]]] call[ret.set, parameter[literal[3], literal[2], literal[0]]] end[}] call[CommonOps_DDRM.insert, parameter[call[se.getR, parameter[]], member[.ret], literal[0], literal[0]]] local_variable[type[Vector3D_F64], T] call[ret.set, parameter[literal[0], literal[3], member[T.x]]] call[ret.set, parameter[literal[1], literal[3], member[T.y]]] call[ret.set, parameter[literal[2], literal[3], member[T.z]]] call[ret.set, parameter[literal[3], literal[3], literal[1]]] return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DMatrixRMaj] identifier[toHomogeneous] operator[SEP] identifier[Se3_F64] identifier[se] , identifier[DMatrixRMaj] identifier[ret] operator[SEP] { Keyword[if] operator[SEP] identifier[ret] operator[==] Other[null] operator[SEP] identifier[ret] operator[=] Keyword[new] identifier[DMatrixRMaj] operator[SEP] Other[4] , Other[4] operator[SEP] operator[SEP] Keyword[else] { identifier[ret] operator[SEP] identifier[set] operator[SEP] Other[3] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[set] operator[SEP] Other[3] , Other[1] , Other[0] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[set] operator[SEP] Other[3] , Other[2] , Other[0] operator[SEP] operator[SEP] } identifier[CommonOps_DDRM] operator[SEP] identifier[insert] operator[SEP] identifier[se] operator[SEP] identifier[getR] operator[SEP] operator[SEP] , identifier[ret] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[Vector3D_F64] identifier[T] operator[=] identifier[se] operator[SEP] identifier[getT] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[set] operator[SEP] Other[0] , Other[3] , identifier[T] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[set] operator[SEP] Other[1] , Other[3] , identifier[T] operator[SEP] identifier[y] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[set] operator[SEP] Other[2] , Other[3] , identifier[T] operator[SEP] identifier[z] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[set] operator[SEP] Other[3] , Other[3] , Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
private void writeDefaultPortableFieldList(JField field, PDescriptor descriptor) throws GeneratorException { switch (descriptor.getType()) { case BYTE: writer.formatln("%s.writeByteArray(\"%s\", new %s[0]);", PORTABLE_WRITER, field.name(), helper.getValueType(descriptor)); break; case BINARY: writer.formatln("%s.writeByteArray(\"%s\", new %s[0]);", PORTABLE_WRITER, field.name(), "byte"); //TODO becomes binary otherwise, and doesn't fit with byte array. break; case BOOL: writer.formatln("%s.writeBooleanArray(\"%s\", new %s[0]);", PORTABLE_WRITER, field.name(), helper.getValueType(descriptor)); break; case DOUBLE: writer.formatln("%s.writeDoubleArray(\"%s\", new %s[0]);", PORTABLE_WRITER, field.name(), helper.getValueType(descriptor)); break; case ENUM: writer.formatln("%s.writeIntArray(\"%s\", new %s[0]);", PORTABLE_WRITER, field.name(), int.class.getName()); // TODO need fixed as value isn't doable. break; case I16: writer.formatln("%s.writeShortArray(\"%s\", new %s[0]);", PORTABLE_WRITER, field.name(), helper.getValueType(descriptor)); break; case I32: writer.formatln("%s.writeIntArray(\"%s\", new %s[0]);", PORTABLE_WRITER, field.name(), helper.getValueType(descriptor)); break; case I64: writer.formatln("%s.writeLongArray(\"%s\", new %s[0]);", PORTABLE_WRITER, field.name(), helper.getValueType(descriptor)); break; case STRING: writer.formatln("%s.writeUTFArray(\"%s\", new %s[0]);", PORTABLE_WRITER, field.name(), helper.getValueType(descriptor)); break; case MESSAGE: writer.formatln("%s.writePortableArray(\"%s\", new %s._Builder[0]);", PORTABLE_WRITER, field.name(), helper.getValueType(descriptor)); break; default: throw new GeneratorException( "Not implemented writeDefaultPortableFieldList for list with type: " + descriptor.getType() + " in " + this.getClass() .getSimpleName()); } }
class class_name[name] begin[{] method[writeDefaultPortableFieldList, return_type[void], modifier[private], parameter[field, descriptor]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['BYTE'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.writeByteArray(\"%s\", new %s[0]);"), MemberReference(member=PORTABLE_WRITER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=descriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueType, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None)], member=formatln, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['BINARY'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.writeByteArray(\"%s\", new %s[0]);"), MemberReference(member=PORTABLE_WRITER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="byte")], member=formatln, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['BOOL'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.writeBooleanArray(\"%s\", new %s[0]);"), MemberReference(member=PORTABLE_WRITER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=descriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueType, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None)], member=formatln, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['DOUBLE'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.writeDoubleArray(\"%s\", new %s[0]);"), MemberReference(member=PORTABLE_WRITER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=descriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueType, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None)], member=formatln, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ENUM'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.writeIntArray(\"%s\", new %s[0]);"), MemberReference(member=PORTABLE_WRITER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=BasicType(dimensions=[], name=int))], member=formatln, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['I16'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.writeShortArray(\"%s\", new %s[0]);"), MemberReference(member=PORTABLE_WRITER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=descriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueType, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None)], member=formatln, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['I32'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.writeIntArray(\"%s\", new %s[0]);"), MemberReference(member=PORTABLE_WRITER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=descriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueType, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None)], member=formatln, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['I64'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.writeLongArray(\"%s\", new %s[0]);"), MemberReference(member=PORTABLE_WRITER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=descriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueType, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None)], member=formatln, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['STRING'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.writeUTFArray(\"%s\", new %s[0]);"), MemberReference(member=PORTABLE_WRITER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=descriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueType, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None)], member=formatln, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['MESSAGE'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.writePortableArray(\"%s\", new %s._Builder[0]);"), MemberReference(member=PORTABLE_WRITER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=descriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueType, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None)], member=formatln, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not implemented writeDefaultPortableFieldList for list with type: "), operandr=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" in "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GeneratorException, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[writeDefaultPortableFieldList] operator[SEP] identifier[JField] identifier[field] , identifier[PDescriptor] identifier[descriptor] operator[SEP] Keyword[throws] identifier[GeneratorException] { Keyword[switch] operator[SEP] identifier[descriptor] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[BYTE] operator[:] identifier[writer] operator[SEP] identifier[formatln] operator[SEP] literal[String] , identifier[PORTABLE_WRITER] , identifier[field] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[helper] operator[SEP] identifier[getValueType] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[BINARY] operator[:] identifier[writer] operator[SEP] identifier[formatln] operator[SEP] literal[String] , identifier[PORTABLE_WRITER] , identifier[field] operator[SEP] identifier[name] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[BOOL] operator[:] identifier[writer] operator[SEP] identifier[formatln] operator[SEP] literal[String] , identifier[PORTABLE_WRITER] , identifier[field] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[helper] operator[SEP] identifier[getValueType] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[DOUBLE] operator[:] identifier[writer] operator[SEP] identifier[formatln] operator[SEP] literal[String] , identifier[PORTABLE_WRITER] , identifier[field] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[helper] operator[SEP] identifier[getValueType] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ENUM] operator[:] identifier[writer] operator[SEP] identifier[formatln] operator[SEP] literal[String] , identifier[PORTABLE_WRITER] , identifier[field] operator[SEP] identifier[name] operator[SEP] operator[SEP] , Keyword[int] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[I16] operator[:] identifier[writer] operator[SEP] identifier[formatln] operator[SEP] literal[String] , identifier[PORTABLE_WRITER] , identifier[field] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[helper] operator[SEP] identifier[getValueType] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[I32] operator[:] identifier[writer] operator[SEP] identifier[formatln] operator[SEP] literal[String] , identifier[PORTABLE_WRITER] , identifier[field] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[helper] operator[SEP] identifier[getValueType] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[I64] operator[:] identifier[writer] operator[SEP] identifier[formatln] operator[SEP] literal[String] , identifier[PORTABLE_WRITER] , identifier[field] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[helper] operator[SEP] identifier[getValueType] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[STRING] operator[:] identifier[writer] operator[SEP] identifier[formatln] operator[SEP] literal[String] , identifier[PORTABLE_WRITER] , identifier[field] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[helper] operator[SEP] identifier[getValueType] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[MESSAGE] operator[:] identifier[writer] operator[SEP] identifier[formatln] operator[SEP] literal[String] , identifier[PORTABLE_WRITER] , identifier[field] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[helper] operator[SEP] identifier[getValueType] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[GeneratorException] operator[SEP] literal[String] operator[+] identifier[descriptor] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
private InputStream connect(String url) throws IOException { URLConnection conn = new URL(URL_BASE + url).openConnection(); conn.setConnectTimeout(CONNECT_TIMEOUT); conn.setReadTimeout(READ_TIMEOUT); conn.setRequestProperty("User-Agent", USER_AGENT); return conn.getInputStream(); }
class class_name[name] begin[{] method[connect, return_type[type[InputStream]], modifier[private], parameter[url]] begin[{] local_variable[type[URLConnection], conn] call[conn.setConnectTimeout, parameter[member[.CONNECT_TIMEOUT]]] call[conn.setReadTimeout, parameter[member[.READ_TIMEOUT]]] call[conn.setRequestProperty, parameter[literal["User-Agent"], member[.USER_AGENT]]] return[call[conn.getInputStream, parameter[]]] end[}] END[}]
Keyword[private] identifier[InputStream] identifier[connect] operator[SEP] identifier[String] identifier[url] operator[SEP] Keyword[throws] identifier[IOException] { identifier[URLConnection] identifier[conn] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[URL_BASE] operator[+] identifier[url] operator[SEP] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setConnectTimeout] operator[SEP] identifier[CONNECT_TIMEOUT] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setReadTimeout] operator[SEP] identifier[READ_TIMEOUT] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setRequestProperty] operator[SEP] literal[String] , identifier[USER_AGENT] operator[SEP] operator[SEP] Keyword[return] identifier[conn] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] }
public final void acquire(long timeout) throws RuntimeException { synchronized (this.LOCK) { long start = System.currentTimeMillis(); while (this.owner != null) { if (this.owner.get() == Thread.currentThread()) { this.acquire++; return; } try { if (timeout == -1) { this.LOCK.wait(); } else { this.LOCK.wait(timeout); } } catch (InterruptedException e) { // } long end = System.currentTimeMillis(); if ((this.owner != null) && (timeout != -1) && ((end - start) >= timeout)) { throw new RuntimeException("TimeoutException"); } } this.owner = new WeakReference(Thread.currentThread()); this.acquire++; } }
class class_name[name] begin[{] method[acquire, return_type[void], modifier[final public], parameter[timeout]] begin[{] SYNCHRONIZED[THIS[member[None.LOCK]]] BEGIN[{] local_variable[type[long], start] while[binary_operation[THIS[member[None.owner]], !=, literal[null]]] begin[{] if[binary_operation[THIS[member[None.owner]call[None.get, parameter[]]], ==, call[Thread.currentThread, parameter[]]]] begin[{] THIS[member[None.acquire]] return[None] else begin[{] None end[}] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=LOCK, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wait, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=LOCK, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=wait, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) local_variable[type[long], end] if[binary_operation[binary_operation[binary_operation[THIS[member[None.owner]], !=, literal[null]], &&, binary_operation[member[.timeout], !=, literal[1]]], &&, binary_operation[binary_operation[member[.end], -, member[.start]], >=, member[.timeout]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TimeoutException")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None) else begin[{] None end[}] end[}] assign[THIS[member[None.owner]], ClassCreator(arguments=[MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WeakReference, sub_type=None))] THIS[member[None.acquire]] END[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[acquire] operator[SEP] Keyword[long] identifier[timeout] operator[SEP] Keyword[throws] identifier[RuntimeException] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[LOCK] operator[SEP] { Keyword[long] identifier[start] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] Keyword[this] operator[SEP] identifier[owner] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[owner] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[acquire] operator[++] operator[SEP] Keyword[return] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[timeout] operator[==] operator[-] Other[1] operator[SEP] { Keyword[this] operator[SEP] identifier[LOCK] operator[SEP] identifier[wait] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[LOCK] operator[SEP] identifier[wait] operator[SEP] identifier[timeout] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { } Keyword[long] identifier[end] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[owner] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[timeout] operator[!=] operator[-] Other[1] operator[SEP] operator[&&] operator[SEP] operator[SEP] identifier[end] operator[-] identifier[start] operator[SEP] operator[>=] identifier[timeout] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[this] operator[SEP] identifier[owner] operator[=] Keyword[new] identifier[WeakReference] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[acquire] operator[++] operator[SEP] } }
public void setLogSubscriptions(java.util.Collection<LogSubscription> logSubscriptions) { if (logSubscriptions == null) { this.logSubscriptions = null; return; } this.logSubscriptions = new com.amazonaws.internal.SdkInternalList<LogSubscription>(logSubscriptions); }
class class_name[name] begin[{] method[setLogSubscriptions, return_type[void], modifier[public], parameter[logSubscriptions]] begin[{] if[binary_operation[member[.logSubscriptions], ==, literal[null]]] begin[{] assign[THIS[member[None.logSubscriptions]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.logSubscriptions]], ClassCreator(arguments=[MemberReference(member=logSubscriptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=LogSubscription, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setLogSubscriptions] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[LogSubscription] operator[>] identifier[logSubscriptions] operator[SEP] { Keyword[if] operator[SEP] identifier[logSubscriptions] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[logSubscriptions] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[logSubscriptions] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[LogSubscription] operator[>] operator[SEP] identifier[logSubscriptions] operator[SEP] operator[SEP] }
static boolean scrubContents(ContextNode node) { boolean emptied = true; Iterator<Entry<String, Object>> entries = node.children.entrySet().iterator(); while (entries.hasNext()) { Entry<String, Object> entry = entries.next(); Object child = entry.getValue(); if (child instanceof AutoBindNode) { emptied = false; } else if (child instanceof ServiceRegistration) { ServiceRegistration<?> reg = (ServiceRegistration<?>) child; unregister(reg); entries.remove(); } else if (child instanceof ContextNode) { ContextNode childNode = (ContextNode) child; if (scrubContents(childNode)) // if it was emptied, remove the node // TODO - potential race condition here - need to prevent any additions during clean entries.remove(); else // if it wasn't emptied we need to keep its parent too emptied = false; } else { // there shouldn't be any other types of object in there! if (tc.isDebugEnabled()) Tr.debug(tc, "Unexpected object type found in internal tree", node.fullName + WSName.SEPARATOR + entry.getKey(), child); // remove it anyway entries.remove(); } } return emptied; }
class class_name[name] begin[{] method[scrubContents, return_type[type[boolean]], modifier[static], parameter[node]] begin[{] local_variable[type[boolean], emptied] local_variable[type[Iterator], entries] while[call[entries.hasNext, parameter[]]] begin[{] local_variable[type[Entry], entry] local_variable[type[Object], child] if[binary_operation[member[.child], instanceof, type[AutoBindNode]]] begin[{] assign[member[.emptied], literal[false]] else begin[{] if[binary_operation[member[.child], instanceof, type[ServiceRegistration]]] begin[{] local_variable[type[ServiceRegistration], reg] call[.unregister, parameter[member[.reg]]] call[entries.remove, parameter[]] else begin[{] if[binary_operation[member[.child], instanceof, type[ContextNode]]] begin[{] local_variable[type[ContextNode], childNode] if[call[.scrubContents, parameter[member[.childNode]]]] begin[{] call[entries.remove, parameter[]] else begin[{] assign[member[.emptied], literal[false]] end[}] else begin[{] if[call[tc.isDebugEnabled, parameter[]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["Unexpected object type found in internal tree"], binary_operation[binary_operation[member[node.fullName], +, member[WSName.SEPARATOR]], +, call[entry.getKey, parameter[]]], member[.child]]] else begin[{] None end[}] call[entries.remove, parameter[]] end[}] end[}] end[}] end[}] return[member[.emptied]] end[}] END[}]
Keyword[static] Keyword[boolean] identifier[scrubContents] operator[SEP] identifier[ContextNode] identifier[node] operator[SEP] { Keyword[boolean] identifier[emptied] operator[=] literal[boolean] operator[SEP] identifier[Iterator] operator[<] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[entries] operator[=] identifier[node] operator[SEP] identifier[children] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[entries] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[=] identifier[entries] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[child] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[child] Keyword[instanceof] identifier[AutoBindNode] operator[SEP] { identifier[emptied] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[child] Keyword[instanceof] identifier[ServiceRegistration] operator[SEP] { identifier[ServiceRegistration] operator[<] operator[?] operator[>] identifier[reg] operator[=] operator[SEP] identifier[ServiceRegistration] operator[<] operator[?] operator[>] operator[SEP] identifier[child] operator[SEP] identifier[unregister] operator[SEP] identifier[reg] operator[SEP] operator[SEP] identifier[entries] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[child] Keyword[instanceof] identifier[ContextNode] operator[SEP] { identifier[ContextNode] identifier[childNode] operator[=] operator[SEP] identifier[ContextNode] operator[SEP] identifier[child] operator[SEP] Keyword[if] operator[SEP] identifier[scrubContents] operator[SEP] identifier[childNode] operator[SEP] operator[SEP] identifier[entries] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[emptied] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[node] operator[SEP] identifier[fullName] operator[+] identifier[WSName] operator[SEP] identifier[SEPARATOR] operator[+] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[child] operator[SEP] operator[SEP] identifier[entries] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[emptied] operator[SEP] }
@Pure public static double toRadiansPerSecond(double value, AngularUnit inputUnit) { switch (inputUnit) { case TURNS_PER_SECOND: return value * (2. * MathConstants.PI); case DEGREES_PER_SECOND: return Math.toRadians(value); case RADIANS_PER_SECOND: default: } return value; }
class class_name[name] begin[{] method[toRadiansPerSecond, return_type[type[double]], modifier[public static], parameter[value, inputUnit]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['TURNS_PER_SECOND'], statements=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2.), operandr=MemberReference(member=PI, postfix_operators=[], prefix_operators=[], qualifier=MathConstants, selectors=[]), operator=*), operator=*), label=None)]), SwitchStatementCase(case=['DEGREES_PER_SECOND'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toRadians, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['RADIANS_PER_SECOND'], statements=[])], expression=MemberReference(member=inputUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[member[.value]] end[}] END[}]
annotation[@] identifier[Pure] Keyword[public] Keyword[static] Keyword[double] identifier[toRadiansPerSecond] operator[SEP] Keyword[double] identifier[value] , identifier[AngularUnit] identifier[inputUnit] operator[SEP] { Keyword[switch] operator[SEP] identifier[inputUnit] operator[SEP] { Keyword[case] identifier[TURNS_PER_SECOND] operator[:] Keyword[return] identifier[value] operator[*] operator[SEP] literal[Float] operator[*] identifier[MathConstants] operator[SEP] identifier[PI] operator[SEP] operator[SEP] Keyword[case] identifier[DEGREES_PER_SECOND] operator[:] Keyword[return] identifier[Math] operator[SEP] identifier[toRadians] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[case] identifier[RADIANS_PER_SECOND] operator[:] Keyword[default] operator[:] } Keyword[return] identifier[value] operator[SEP] }
public void resultsMustBeCassandra(DataTable expectedResults) throws Exception { if (getCassandraResults() != null) { //Map for query results ColumnDefinitions columns = getCassandraResults().getColumnDefinitions(); List<Row> rows = getCassandraResults().all(); List<Map<String, Object>> resultsListObtained = new ArrayList<Map<String, Object>>(); Map<String, Object> results; for (int i = 0; i < rows.size(); i++) { results = new HashMap<String, Object>(); for (int e = 0; e < columns.size(); e++) { results.put(columns.getName(e), rows.get(i).getObject(e)); } resultsListObtained.add(results); } getLogger().debug("Results: " + resultsListObtained.toString()); //Map for cucumber expected results List<Map<String, Object>> resultsListExpected = new ArrayList<Map<String, Object>>(); Map<String, Object> resultsCucumber; for (int e = 1; e < expectedResults.getPickleRows().size(); e++) { resultsCucumber = new HashMap<String, Object>(); for (int i = 0; i < expectedResults.getPickleRows().get(0).getCells().size(); i++) { resultsCucumber.put(expectedResults.getPickleRows().get(0).getCells().get(i).getValue(), expectedResults.getPickleRows().get(e).getCells().get(i).getValue()); } resultsListExpected.add(resultsCucumber); } getLogger().debug("Expected Results: " + resultsListExpected.toString()); //Comparisons int occurrencesObtained = 0; int iterations = 0; int occurrencesExpected = 0; String nextKey; for (int e = 0; e < resultsListExpected.size(); e++) { iterations = 0; occurrencesObtained = 0; occurrencesExpected = Integer.parseInt(resultsListExpected.get(e).get("occurrences").toString()); for (int i = 0; i < resultsListObtained.size(); i++) { Iterator<String> it = resultsListExpected.get(0).keySet().iterator(); while (it.hasNext()) { nextKey = it.next(); if (!nextKey.equals("occurrences")) { if (resultsListObtained.get(i).get(nextKey).toString().equals(resultsListExpected.get(e).get(nextKey).toString())) { iterations++; } } if (iterations == resultsListExpected.get(0).keySet().size() - 1) { occurrencesObtained++; iterations = 0; } } iterations = 0; } assertThat(occurrencesExpected).overridingErrorMessage("In row " + e + " have been found " + occurrencesObtained + " results and " + occurrencesExpected + " were expected").isEqualTo(occurrencesObtained); } } else { throw new Exception("You must execute a query before trying to get results"); } }
class class_name[name] begin[{] method[resultsMustBeCassandra, return_type[void], modifier[public], parameter[expectedResults]] begin[{] if[binary_operation[call[.getCassandraResults, parameter[]], !=, literal[null]]] begin[{] local_variable[type[ColumnDefinitions], columns] local_variable[type[List], rows] local_variable[type[List], resultsListObtained] local_variable[type[Map], results] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=results, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getName, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=rows, selectors=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=e)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=e, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=resultsListObtained, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=rows, 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) call[.getLogger, parameter[]] local_variable[type[List], resultsListExpected] local_variable[type[Map], resultsCucumber] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=resultsCucumber, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPickleRows, postfix_operators=[], prefix_operators=[], qualifier=expectedResults, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCells, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=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), MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getPickleRows, postfix_operators=[], prefix_operators=[], qualifier=expectedResults, selectors=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCells, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=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), MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=resultsCucumber, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getPickleRows, postfix_operators=[], prefix_operators=[], qualifier=expectedResults, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCells, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resultsCucumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=resultsListExpected, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getPickleRows, postfix_operators=[], prefix_operators=[], qualifier=expectedResults, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=e)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=e, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[.getLogger, parameter[]] local_variable[type[int], occurrencesObtained] local_variable[type[int], iterations] local_variable[type[int], occurrencesExpected] local_variable[type[String], nextKey] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=iterations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=occurrencesObtained, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=occurrencesExpected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=resultsListExpected, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="occurrences")], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=resultsListExpected, selectors=[MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nextKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="occurrences")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=nextKey, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=resultsListObtained, selectors=[MethodInvocation(arguments=[MemberReference(member=nextKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=resultsListExpected, selectors=[MethodInvocation(arguments=[MemberReference(member=nextKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=iterations, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=iterations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=resultsListExpected, selectors=[MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=occurrencesObtained, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=iterations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]))]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=iterations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=resultsListObtained, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=occurrencesExpected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=assertThat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="In row "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" have been found "), operator=+), operandr=MemberReference(member=occurrencesObtained, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" results and "), operator=+), operandr=MemberReference(member=occurrencesExpected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" were expected"), operator=+)], member=overridingErrorMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=occurrencesObtained, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEqualTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=resultsListExpected, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=e)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=e, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You must execute a query before trying to get results")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[resultsMustBeCassandra] operator[SEP] identifier[DataTable] identifier[expectedResults] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[getCassandraResults] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[ColumnDefinitions] identifier[columns] operator[=] identifier[getCassandraResults] operator[SEP] operator[SEP] operator[SEP] identifier[getColumnDefinitions] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Row] operator[>] identifier[rows] operator[=] identifier[getCassandraResults] operator[SEP] operator[SEP] operator[SEP] identifier[all] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[resultsListObtained] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[results] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[rows] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[results] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[e] operator[=] Other[0] operator[SEP] identifier[e] operator[<] identifier[columns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[++] operator[SEP] { identifier[results] operator[SEP] identifier[put] operator[SEP] identifier[columns] operator[SEP] identifier[getName] operator[SEP] identifier[e] operator[SEP] , identifier[rows] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getObject] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] } identifier[resultsListObtained] operator[SEP] identifier[add] operator[SEP] identifier[results] operator[SEP] operator[SEP] } identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[resultsListObtained] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[resultsListExpected] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[resultsCucumber] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[e] operator[=] Other[1] operator[SEP] identifier[e] operator[<] identifier[expectedResults] operator[SEP] identifier[getPickleRows] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[++] operator[SEP] { identifier[resultsCucumber] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[expectedResults] operator[SEP] identifier[getPickleRows] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getCells] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[resultsCucumber] operator[SEP] identifier[put] operator[SEP] identifier[expectedResults] operator[SEP] identifier[getPickleRows] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getCells] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[expectedResults] operator[SEP] identifier[getPickleRows] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[getCells] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[resultsListExpected] operator[SEP] identifier[add] operator[SEP] identifier[resultsCucumber] operator[SEP] operator[SEP] } identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[resultsListExpected] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[occurrencesObtained] operator[=] Other[0] operator[SEP] Keyword[int] identifier[iterations] operator[=] Other[0] operator[SEP] Keyword[int] identifier[occurrencesExpected] operator[=] Other[0] operator[SEP] identifier[String] identifier[nextKey] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[e] operator[=] Other[0] operator[SEP] identifier[e] operator[<] identifier[resultsListExpected] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[++] operator[SEP] { identifier[iterations] operator[=] Other[0] operator[SEP] identifier[occurrencesObtained] operator[=] Other[0] operator[SEP] identifier[occurrencesExpected] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[resultsListExpected] operator[SEP] identifier[get] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[resultsListObtained] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Iterator] operator[<] identifier[String] operator[>] identifier[it] operator[=] identifier[resultsListExpected] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[nextKey] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[nextKey] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[resultsListObtained] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nextKey] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[resultsListExpected] operator[SEP] identifier[get] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nextKey] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[iterations] operator[++] operator[SEP] } } Keyword[if] operator[SEP] identifier[iterations] operator[==] identifier[resultsListExpected] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] { identifier[occurrencesObtained] operator[++] operator[SEP] identifier[iterations] operator[=] Other[0] operator[SEP] } } identifier[iterations] operator[=] Other[0] operator[SEP] } identifier[assertThat] operator[SEP] identifier[occurrencesExpected] operator[SEP] operator[SEP] identifier[overridingErrorMessage] operator[SEP] literal[String] operator[+] identifier[e] operator[+] literal[String] operator[+] identifier[occurrencesObtained] operator[+] literal[String] operator[+] identifier[occurrencesExpected] operator[+] literal[String] operator[SEP] operator[SEP] identifier[isEqualTo] operator[SEP] identifier[occurrencesObtained] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP] } }