code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public GeometryMetadata create(String geoPackage, String tableName, long geomId, GeometryEnvelope envelope) { return create(getGeoPackageId(geoPackage), tableName, geomId, envelope); }
class class_name[name] begin[{] method[create, return_type[type[GeometryMetadata]], modifier[public], parameter[geoPackage, tableName, geomId, envelope]] begin[{] return[call[.create, parameter[call[.getGeoPackageId, parameter[member[.geoPackage]]], member[.tableName], member[.geomId], member[.envelope]]]] end[}] END[}]
Keyword[public] identifier[GeometryMetadata] identifier[create] operator[SEP] identifier[String] identifier[geoPackage] , identifier[String] identifier[tableName] , Keyword[long] identifier[geomId] , identifier[GeometryEnvelope] identifier[envelope] operator[SEP] { Keyword[return] identifier[create] operator[SEP] identifier[getGeoPackageId] operator[SEP] identifier[geoPackage] operator[SEP] , identifier[tableName] , identifier[geomId] , identifier[envelope] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") @Override public Set<JsonEntityBean> search(String entityType, String searchTerm) { Set<JsonEntityBean> results = new HashSet<>(); EntityEnum entityEnum = EntityEnum.getEntityEnum(entityType); if (entityEnum == null) { throw new IllegalArgumentException( String.format("Parameter entityType has an unknown value of [%s]", entityType)); } EntityIdentifier[] identifiers; Class identifierType; // if the entity type is a group, use the group service's findGroup method // to locate it if (entityEnum.isGroup()) { identifiers = GroupService.searchForGroups( searchTerm, GroupService.SearchMethod.CONTAINS_CI, entityEnum.getClazz()); identifierType = IEntityGroup.class; } // otherwise use the getGroupMember method else { identifiers = GroupService.searchForEntities( searchTerm, GroupService.SearchMethod.CONTAINS_CI, entityEnum.getClazz()); identifierType = entityEnum.getClazz(); } for (int i = 0; i < identifiers.length; i++) { if (identifiers[i].getType().equals(identifierType)) { IGroupMember entity = GroupService.getGroupMember(identifiers[i]); if (entity != null) { JsonEntityBean jsonBean = getEntity(entity); results.add(jsonBean); } else { log.warn("Grouper member entity of " + identifiers[i].getKey() + " is null."); } } } return results; }
class class_name[name] begin[{] method[search, return_type[type[Set]], modifier[public], parameter[entityType, searchTerm]] begin[{] local_variable[type[Set], results] local_variable[type[EntityEnum], entityEnum] if[binary_operation[member[.entityEnum], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter entityType has an unknown value of [%s]"), MemberReference(member=entityType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[EntityIdentifier], identifiers] local_variable[type[Class], identifierType] if[call[entityEnum.isGroup, parameter[]]] begin[{] assign[member[.identifiers], call[GroupService.searchForGroups, parameter[member[.searchTerm], member[GroupService.SearchMethod.CONTAINS_CI], call[entityEnum.getClazz, parameter[]]]]] assign[member[.identifierType], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IEntityGroup, sub_type=None))] else begin[{] assign[member[.identifiers], call[GroupService.searchForEntities, parameter[member[.searchTerm], member[GroupService.SearchMethod.CONTAINS_CI], call[entityEnum.getClazz, parameter[]]]]] assign[member[.identifierType], call[entityEnum.getClazz, parameter[]]] end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=identifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=identifierType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=identifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getGroupMember, postfix_operators=[], prefix_operators=[], qualifier=GroupService, selectors=[], type_arguments=None), name=entity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IGroupMember, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=entity, 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=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Grouper member entity of "), operandr=MemberReference(member=identifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is null."), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=jsonBean)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonEntityBean, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=jsonBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=identifiers, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.results]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[JsonEntityBean] operator[>] identifier[search] operator[SEP] identifier[String] identifier[entityType] , identifier[String] identifier[searchTerm] operator[SEP] { identifier[Set] operator[<] identifier[JsonEntityBean] operator[>] identifier[results] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[EntityEnum] identifier[entityEnum] operator[=] identifier[EntityEnum] operator[SEP] identifier[getEntityEnum] operator[SEP] identifier[entityType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entityEnum] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entityType] operator[SEP] operator[SEP] operator[SEP] } identifier[EntityIdentifier] operator[SEP] operator[SEP] identifier[identifiers] operator[SEP] identifier[Class] identifier[identifierType] operator[SEP] Keyword[if] operator[SEP] identifier[entityEnum] operator[SEP] identifier[isGroup] operator[SEP] operator[SEP] operator[SEP] { identifier[identifiers] operator[=] identifier[GroupService] operator[SEP] identifier[searchForGroups] operator[SEP] identifier[searchTerm] , identifier[GroupService] operator[SEP] identifier[SearchMethod] operator[SEP] identifier[CONTAINS_CI] , identifier[entityEnum] operator[SEP] identifier[getClazz] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[identifierType] operator[=] identifier[IEntityGroup] operator[SEP] Keyword[class] operator[SEP] } Keyword[else] { identifier[identifiers] operator[=] identifier[GroupService] operator[SEP] identifier[searchForEntities] operator[SEP] identifier[searchTerm] , identifier[GroupService] operator[SEP] identifier[SearchMethod] operator[SEP] identifier[CONTAINS_CI] , identifier[entityEnum] operator[SEP] identifier[getClazz] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[identifierType] operator[=] identifier[entityEnum] operator[SEP] identifier[getClazz] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[identifiers] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[identifiers] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[identifierType] operator[SEP] operator[SEP] { identifier[IGroupMember] identifier[entity] operator[=] identifier[GroupService] operator[SEP] identifier[getGroupMember] operator[SEP] identifier[identifiers] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entity] operator[!=] Other[null] operator[SEP] { identifier[JsonEntityBean] identifier[jsonBean] operator[=] identifier[getEntity] operator[SEP] identifier[entity] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[jsonBean] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[identifiers] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } } } Keyword[return] identifier[results] operator[SEP] }
public static String generatePassphrase(final String delimiter, final int words) { return generatePassphrase(delimiter, words, new Dictionary("eff_large", DictionaryUtil.loadUnrankedDictionary(DictionaryUtil.eff_large), false)); }
class class_name[name] begin[{] method[generatePassphrase, return_type[type[String]], modifier[public static], parameter[delimiter, words]] begin[{] return[call[.generatePassphrase, parameter[member[.delimiter], member[.words], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="eff_large"), MethodInvocation(arguments=[MemberReference(member=eff_large, postfix_operators=[], prefix_operators=[], qualifier=DictionaryUtil, selectors=[])], member=loadUnrankedDictionary, postfix_operators=[], prefix_operators=[], qualifier=DictionaryUtil, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dictionary, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[generatePassphrase] operator[SEP] Keyword[final] identifier[String] identifier[delimiter] , Keyword[final] Keyword[int] identifier[words] operator[SEP] { Keyword[return] identifier[generatePassphrase] operator[SEP] identifier[delimiter] , identifier[words] , Keyword[new] identifier[Dictionary] operator[SEP] literal[String] , identifier[DictionaryUtil] operator[SEP] identifier[loadUnrankedDictionary] operator[SEP] identifier[DictionaryUtil] operator[SEP] identifier[eff_large] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] }
public ServiceFuture<CredentialInner> getAsync(String resourceGroupName, String automationAccountName, String credentialName, final ServiceCallback<CredentialInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, automationAccountName, credentialName), serviceCallback); }
class class_name[name] begin[{] method[getAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, automationAccountName, credentialName, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.getWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.automationAccountName], member[.credentialName]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[CredentialInner] operator[>] identifier[getAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[automationAccountName] , identifier[String] identifier[credentialName] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[CredentialInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[getWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[automationAccountName] , identifier[credentialName] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public void marshall(ListInstanceProfilesRequest listInstanceProfilesRequest, ProtocolMarshaller protocolMarshaller) { if (listInstanceProfilesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listInstanceProfilesRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(listInstanceProfilesRequest.getNextToken(), NEXTTOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[listInstanceProfilesRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.listInstanceProfilesRequest], ==, 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=getMaxResults, postfix_operators=[], prefix_operators=[], qualifier=listInstanceProfilesRequest, selectors=[], type_arguments=None), MemberReference(member=MAXRESULTS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNextToken, postfix_operators=[], prefix_operators=[], qualifier=listInstanceProfilesRequest, selectors=[], type_arguments=None), MemberReference(member=NEXTTOKEN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[ListInstanceProfilesRequest] identifier[listInstanceProfilesRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[listInstanceProfilesRequest] 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[listInstanceProfilesRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listInstanceProfilesRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public double[] featureset(double[] features, int label) { double[] fs = new double[features.length + 1]; System.arraycopy(features, 0, fs, 0, features.length); fs[features.length] = label; return fs; }
class class_name[name] begin[{] method[featureset, return_type[type[double]], modifier[public], parameter[features, label]] begin[{] local_variable[type[double], fs] call[System.arraycopy, parameter[member[.features], literal[0], member[.fs], literal[0], member[features.length]]] assign[member[.fs], member[.label]] return[member[.fs]] end[}] END[}]
Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[featureset] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[features] , Keyword[int] identifier[label] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] identifier[fs] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[features] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[features] , Other[0] , identifier[fs] , Other[0] , identifier[features] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[fs] operator[SEP] identifier[features] operator[SEP] identifier[length] operator[SEP] operator[=] identifier[label] operator[SEP] Keyword[return] identifier[fs] operator[SEP] }
private String mkPreview(int line) { StringBuilder sb = new StringBuilder(); int startLine = line - 3; int endLine = line + 3; List<String> lines = multiSourceReader.getData(); for (int i = 0; i < lines.size(); i++) { if (i >= startLine && i <= endLine) { sb.append(lines.get(i)).append('\n'); } } return sb.toString(); }
class class_name[name] begin[{] method[mkPreview, return_type[type[String]], modifier[private], parameter[line]] begin[{] local_variable[type[StringBuilder], sb] local_variable[type[int], startLine] local_variable[type[int], endLine] local_variable[type[List], lines] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=startLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=endLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=lines, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')], member=append, 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=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=lines, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[mkPreview] operator[SEP] Keyword[int] identifier[line] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[startLine] operator[=] identifier[line] operator[-] Other[3] operator[SEP] Keyword[int] identifier[endLine] operator[=] identifier[line] operator[+] Other[3] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[lines] operator[=] identifier[multiSourceReader] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[lines] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[>=] identifier[startLine] operator[&&] identifier[i] operator[<=] identifier[endLine] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[lines] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public char match(ISense source, ISense target) { String sSynset = source.getGloss(); String tSynset = target.getGloss(); StringTokenizer stSource = new StringTokenizer(sSynset, " ,.\"'();"); String lemmaS, lemmaT; int counter = 0; while (stSource.hasMoreTokens()) { StringTokenizer stTarget = new StringTokenizer(tSynset, " ,.\"'();"); lemmaS = stSource.nextToken(); if (!meaninglessWords.contains(lemmaS)) while (stTarget.hasMoreTokens()) { lemmaT = stTarget.nextToken(); if (!meaninglessWords.contains(lemmaT)) if (lemmaS.equals(lemmaT)) counter++; } } if (counter >= threshold) return IMappingElement.EQUIVALENCE; else return IMappingElement.IDK; }
class class_name[name] begin[{] method[match, return_type[type[char]], modifier[public], parameter[source, target]] begin[{] local_variable[type[String], sSynset] local_variable[type[String], tSynset] local_variable[type[StringTokenizer], stSource] local_variable[type[String], lemmaS] local_variable[type[int], counter] while[call[stSource.hasMoreTokens, parameter[]]] begin[{] local_variable[type[StringTokenizer], stTarget] assign[member[.lemmaS], call[stSource.nextToken, parameter[]]] if[call[meaninglessWords.contains, parameter[member[.lemmaS]]]] begin[{] while[call[stTarget.hasMoreTokens, parameter[]]] begin[{] assign[member[.lemmaT], call[stTarget.nextToken, parameter[]]] if[call[meaninglessWords.contains, parameter[member[.lemmaT]]]] begin[{] if[call[lemmaS.equals, parameter[member[.lemmaT]]]] begin[{] member[.counter] else begin[{] None end[}] else begin[{] None end[}] end[}] else begin[{] None end[}] end[}] if[binary_operation[member[.counter], >=, member[.threshold]]] begin[{] return[member[IMappingElement.EQUIVALENCE]] else begin[{] return[member[IMappingElement.IDK]] end[}] end[}] END[}]
Keyword[public] Keyword[char] identifier[match] operator[SEP] identifier[ISense] identifier[source] , identifier[ISense] identifier[target] operator[SEP] { identifier[String] identifier[sSynset] operator[=] identifier[source] operator[SEP] identifier[getGloss] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[tSynset] operator[=] identifier[target] operator[SEP] identifier[getGloss] operator[SEP] operator[SEP] operator[SEP] identifier[StringTokenizer] identifier[stSource] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[sSynset] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[lemmaS] , identifier[lemmaT] operator[SEP] Keyword[int] identifier[counter] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[stSource] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] { identifier[StringTokenizer] identifier[stTarget] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[tSynset] , literal[String] operator[SEP] operator[SEP] identifier[lemmaS] operator[=] identifier[stSource] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[meaninglessWords] operator[SEP] identifier[contains] operator[SEP] identifier[lemmaS] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[stTarget] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] { identifier[lemmaT] operator[=] identifier[stTarget] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[meaninglessWords] operator[SEP] identifier[contains] operator[SEP] identifier[lemmaT] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lemmaS] operator[SEP] identifier[equals] operator[SEP] identifier[lemmaT] operator[SEP] operator[SEP] identifier[counter] operator[++] operator[SEP] } } Keyword[if] operator[SEP] identifier[counter] operator[>=] identifier[threshold] operator[SEP] Keyword[return] identifier[IMappingElement] operator[SEP] identifier[EQUIVALENCE] operator[SEP] Keyword[else] Keyword[return] identifier[IMappingElement] operator[SEP] identifier[IDK] operator[SEP] }
public final void ruleTypeRef() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalXtext.g:308:2: ( ( ( rule__TypeRef__Group__0 ) ) ) // InternalXtext.g:309:2: ( ( rule__TypeRef__Group__0 ) ) { // InternalXtext.g:309:2: ( ( rule__TypeRef__Group__0 ) ) // InternalXtext.g:310:3: ( rule__TypeRef__Group__0 ) { before(grammarAccess.getTypeRefAccess().getGroup()); // InternalXtext.g:311:3: ( rule__TypeRef__Group__0 ) // InternalXtext.g:311:4: rule__TypeRef__Group__0 { pushFollow(FollowSets000.FOLLOW_2); rule__TypeRef__Group__0(); state._fsp--; } after(grammarAccess.getTypeRefAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; }
class class_name[name] begin[{] method[ruleTypeRef, return_type[void], modifier[final public], parameter[]] begin[{] local_variable[type[int], stackSize] TryStatement(block=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTypeRefAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getGroup, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=before, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=FollowSets000, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=rule__TypeRef__Group__0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None)]), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTypeRefAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getGroup, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=after, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=restoreStackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[None] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[ruleTypeRef] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[int] identifier[stackSize] operator[=] identifier[keepStackSize] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { { { identifier[before] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getTypeRefAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[pushFollow] operator[SEP] identifier[FollowSets000] operator[SEP] identifier[FOLLOW_2] operator[SEP] operator[SEP] identifier[rule__TypeRef__Group__0] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] } identifier[after] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getTypeRefAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] } Keyword[finally] { identifier[restoreStackSize] operator[SEP] identifier[stackSize] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] }
public Collection<Issue> issues(IssueFilter filter) { return get(Issue.class, (filter != null) ? filter : new IssueFilter()); }
class class_name[name] begin[{] method[issues, return_type[type[Collection]], modifier[public], parameter[filter]] begin[{] return[call[.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Issue, sub_type=None)), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IssueFilter, sub_type=None)), if_true=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]]] end[}] END[}]
Keyword[public] identifier[Collection] operator[<] identifier[Issue] operator[>] identifier[issues] operator[SEP] identifier[IssueFilter] identifier[filter] operator[SEP] { Keyword[return] identifier[get] operator[SEP] identifier[Issue] operator[SEP] Keyword[class] , operator[SEP] identifier[filter] operator[!=] Other[null] operator[SEP] operator[?] identifier[filter] operator[:] Keyword[new] identifier[IssueFilter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public String getAdjustedSiteRoot(String siteRoot, String resourcename) { if (resourcename.startsWith(VFS_PATH_SYSTEM)) { return ""; } else { return siteRoot; } }
class class_name[name] begin[{] method[getAdjustedSiteRoot, return_type[type[String]], modifier[public], parameter[siteRoot, resourcename]] begin[{] if[call[resourcename.startsWith, parameter[member[.VFS_PATH_SYSTEM]]]] begin[{] return[literal[""]] else begin[{] return[member[.siteRoot]] end[}] end[}] END[}]
Keyword[public] identifier[String] identifier[getAdjustedSiteRoot] operator[SEP] identifier[String] identifier[siteRoot] , identifier[String] identifier[resourcename] operator[SEP] { Keyword[if] operator[SEP] identifier[resourcename] operator[SEP] identifier[startsWith] operator[SEP] identifier[VFS_PATH_SYSTEM] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[else] { Keyword[return] identifier[siteRoot] operator[SEP] } }
public static AmazonKinesis buildKinesisClient(@Nullable String accessKey, @Nullable String secretKey, // @Nullable String endpoint, @Nullable Integer port, @Nullable String region) { AmazonKinesisClientBuilder builder = AmazonKinesisClientBuilder.standard(); setAws(builder, accessKey, secretKey, endpoint, port, region); return builder.build(); }
class class_name[name] begin[{] method[buildKinesisClient, return_type[type[AmazonKinesis]], modifier[public static], parameter[accessKey, secretKey, endpoint, port, region]] begin[{] local_variable[type[AmazonKinesisClientBuilder], builder] call[.setAws, parameter[member[.builder], member[.accessKey], member[.secretKey], member[.endpoint], member[.port], member[.region]]] return[call[builder.build, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[AmazonKinesis] identifier[buildKinesisClient] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[accessKey] , annotation[@] identifier[Nullable] identifier[String] identifier[secretKey] , annotation[@] identifier[Nullable] identifier[String] identifier[endpoint] , annotation[@] identifier[Nullable] identifier[Integer] identifier[port] , annotation[@] identifier[Nullable] identifier[String] identifier[region] operator[SEP] { identifier[AmazonKinesisClientBuilder] identifier[builder] operator[=] identifier[AmazonKinesisClientBuilder] operator[SEP] identifier[standard] operator[SEP] operator[SEP] operator[SEP] identifier[setAws] operator[SEP] identifier[builder] , identifier[accessKey] , identifier[secretKey] , identifier[endpoint] , identifier[port] , identifier[region] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public void setStageCreator(String stateCreator) { Preconditions.checkNotNull(stateCreator, "stateCreator cannot be null"); map.put(STAGE_CREATOR_INSTANCE_ATTR, stateCreator); }
class class_name[name] begin[{] method[setStageCreator, return_type[void], modifier[public], parameter[stateCreator]] begin[{] call[Preconditions.checkNotNull, parameter[member[.stateCreator], literal["stateCreator cannot be null"]]] call[map.put, parameter[member[.STAGE_CREATOR_INSTANCE_ATTR], member[.stateCreator]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setStageCreator] operator[SEP] identifier[String] identifier[stateCreator] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[stateCreator] , literal[String] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[STAGE_CREATOR_INSTANCE_ATTR] , identifier[stateCreator] operator[SEP] operator[SEP] }
public boolean advanceToRow(int rowIndex) { int rows_to_move = rowIndex - m_activeRowIndex; m_activeRowIndex = rowIndex; if (m_activeRowIndex >= getRowCount()) { return false; } if (rows_to_move < 0) {// this is "advance" to row, don't move backwards return false; } m_hasCalculatedOffsets = false; if (m_offsets == null) { m_offsets = new int[getColumnCount()]; } if (m_activeRowIndex == 0) { m_position = getRowStart() + ROW_COUNT_SIZE + ROW_HEADER_SIZE; } else { // Move n rows - this code assumes rows can be variable size, so we // have to fetch the size of each row in order to advance to the // next row if (rows_to_move > 0 && m_position < 0) throw new RuntimeException( "VoltTableRow is in an invalid state. Consider calling advanceRow()."); for (int i = 0; i < rows_to_move; i++) { int rowlength = m_buffer.getInt(m_position - ROW_HEADER_SIZE); if (rowlength <= 0) { throw new RuntimeException("Invalid row length."); } m_position += (rowlength + ROW_HEADER_SIZE); } if (m_position >= m_buffer.limit()) { throw new RuntimeException("Row length exceeds table boundary."); } } return true; }
class class_name[name] begin[{] method[advanceToRow, return_type[type[boolean]], modifier[public], parameter[rowIndex]] begin[{] local_variable[type[int], rows_to_move] assign[member[.m_activeRowIndex], member[.rowIndex]] if[binary_operation[member[.m_activeRowIndex], >=, call[.getRowCount, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.rows_to_move], <, literal[0]]] begin[{] return[literal[false]] else begin[{] None end[}] assign[member[.m_hasCalculatedOffsets], literal[false]] if[binary_operation[member[.m_offsets], ==, literal[null]]] begin[{] assign[member[.m_offsets], ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=getColumnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))] else begin[{] None end[}] if[binary_operation[member[.m_activeRowIndex], ==, literal[0]]] begin[{] assign[member[.m_position], binary_operation[binary_operation[call[.getRowStart, parameter[]], +, member[.ROW_COUNT_SIZE]], +, member[.ROW_HEADER_SIZE]]] else begin[{] if[binary_operation[binary_operation[member[.rows_to_move], >, literal[0]], &&, binary_operation[member[.m_position], <, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="VoltTableRow is in an invalid state. Consider calling advanceRow().")], 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[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=m_position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ROW_HEADER_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=m_buffer, selectors=[], type_arguments=None), name=rowlength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rowlength, 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=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid row length.")], 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)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=rowlength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ROW_HEADER_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rows_to_move, 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) if[binary_operation[member[.m_position], >=, call[m_buffer.limit, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Row length exceeds table boundary.")], 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[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[advanceToRow] operator[SEP] Keyword[int] identifier[rowIndex] operator[SEP] { Keyword[int] identifier[rows_to_move] operator[=] identifier[rowIndex] operator[-] identifier[m_activeRowIndex] operator[SEP] identifier[m_activeRowIndex] operator[=] identifier[rowIndex] operator[SEP] Keyword[if] operator[SEP] identifier[m_activeRowIndex] operator[>=] identifier[getRowCount] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[rows_to_move] operator[<] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[m_hasCalculatedOffsets] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[m_offsets] operator[==] Other[null] operator[SEP] { identifier[m_offsets] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[m_activeRowIndex] operator[==] Other[0] operator[SEP] { identifier[m_position] operator[=] identifier[getRowStart] operator[SEP] operator[SEP] operator[+] identifier[ROW_COUNT_SIZE] operator[+] identifier[ROW_HEADER_SIZE] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[rows_to_move] operator[>] Other[0] operator[&&] identifier[m_position] operator[<] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[rows_to_move] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[rowlength] operator[=] identifier[m_buffer] operator[SEP] identifier[getInt] operator[SEP] identifier[m_position] operator[-] identifier[ROW_HEADER_SIZE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rowlength] operator[<=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[m_position] operator[+=] operator[SEP] identifier[rowlength] operator[+] identifier[ROW_HEADER_SIZE] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[m_position] operator[>=] identifier[m_buffer] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public void freeSlot(WorkerSlot slot) { // remove the slot from the existing assignments for (SchedulerAssignmentImpl assignment : this.assignments.values()) { if (assignment.isSlotOccupied(slot)) { assignment.unassignBySlot(slot); } } }
class class_name[name] begin[{] method[freeSlot, return_type[void], modifier[public], parameter[slot]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=slot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSlotOccupied, postfix_operators=[], prefix_operators=[], qualifier=assignment, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=slot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unassignBySlot, postfix_operators=[], prefix_operators=[], qualifier=assignment, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=assignments, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=assignment)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SchedulerAssignmentImpl, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[freeSlot] operator[SEP] identifier[WorkerSlot] identifier[slot] operator[SEP] { Keyword[for] operator[SEP] identifier[SchedulerAssignmentImpl] identifier[assignment] operator[:] Keyword[this] operator[SEP] identifier[assignments] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[assignment] operator[SEP] identifier[isSlotOccupied] operator[SEP] identifier[slot] operator[SEP] operator[SEP] { identifier[assignment] operator[SEP] identifier[unassignBySlot] operator[SEP] identifier[slot] operator[SEP] operator[SEP] } } }
private void checkLowDiskSpaceRequestsAndReadOnlyConditions() { if (transaction.get() != null) { return; } if (lowDiskSpace != null) { if (checkpointInProgress.compareAndSet(false, true)) { try { if (writeCache.checkLowDiskSpace()) { OLogManager.instance().error(this, "Not enough disk space, force sync will be called", null); synch(); if (writeCache.checkLowDiskSpace()) { throw new OLowDiskSpaceException("Error occurred while executing a write operation to database '" + name + "' due to limited free space on the disk (" + (lowDiskSpace.freeSpace / (1024 * 1024)) + " MB). The database is now working in read-only mode." + " Please close the database (or stop OrientDB), make room on your hard drive and then reopen the database. " + "The minimal required space is " + (lowDiskSpace.requiredSpace / (1024 * 1024)) + " MB. " + "Required space is now set to " + configuration.getContextConfiguration() .getValueAsInteger(OGlobalConfiguration.DISK_CACHE_FREE_SPACE_LIMIT) + "MB (you can change it by setting parameter " + OGlobalConfiguration.DISK_CACHE_FREE_SPACE_LIMIT.getKey() + ") ."); } else { lowDiskSpace = null; } } else { lowDiskSpace = null; } } catch (final IOException e) { throw OException.wrapException(new OStorageException("Error during low disk space handling"), e); } finally { checkpointInProgress.set(false); } } } checkReadOnlyConditions(); }
class class_name[name] begin[{] method[checkLowDiskSpaceRequestsAndReadOnlyConditions, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[call[transaction.get, parameter[]], !=, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[member[.lowDiskSpace], !=, literal[null]]] begin[{] if[call[checkpointInProgress.compareAndSet, parameter[literal[false], literal[true]]]] begin[{] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=checkLowDiskSpace, postfix_operators=[], prefix_operators=[], qualifier=writeCache, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lowDiskSpace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=instance, postfix_operators=[], prefix_operators=[], qualifier=OLogManager, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not enough disk space, force sync will be called"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=synch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=checkLowDiskSpace, postfix_operators=[], prefix_operators=[], qualifier=writeCache, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lowDiskSpace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error occurred while executing a write operation to database '"), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' due to limited free space on the disk ("), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=freeSpace, postfix_operators=[], prefix_operators=[], qualifier=lowDiskSpace, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=*), operator=/), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" MB). The database is now working in read-only mode."), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Please close the database (or stop OrientDB), make room on your hard drive and then reopen the database. "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The minimal required space is "), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=requiredSpace, postfix_operators=[], prefix_operators=[], qualifier=lowDiskSpace, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=*), operator=/), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" MB. "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Required space is now set to "), operator=+), operandr=MethodInvocation(arguments=[], member=getContextConfiguration, postfix_operators=[], prefix_operators=[], qualifier=configuration, selectors=[MethodInvocation(arguments=[MemberReference(member=DISK_CACHE_FREE_SPACE_LIMIT, postfix_operators=[], prefix_operators=[], qualifier=OGlobalConfiguration, selectors=[])], member=getValueAsInteger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MB (you can change it by setting parameter "), operator=+), operandr=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=OGlobalConfiguration.DISK_CACHE_FREE_SPACE_LIMIT, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") ."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OLowDiskSpaceException, sub_type=None)), label=None)]))]))], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error during low disk space handling")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OStorageException, sub_type=None)), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrapException, postfix_operators=[], prefix_operators=[], qualifier=OException, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=set, postfix_operators=[], prefix_operators=[], qualifier=checkpointInProgress, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] else begin[{] None end[}] call[.checkReadOnlyConditions, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkLowDiskSpaceRequestsAndReadOnlyConditions] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[transaction] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[lowDiskSpace] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[checkpointInProgress] operator[SEP] identifier[compareAndSet] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[writeCache] operator[SEP] identifier[checkLowDiskSpace] operator[SEP] operator[SEP] operator[SEP] { identifier[OLogManager] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] Keyword[this] , literal[String] , Other[null] operator[SEP] operator[SEP] identifier[synch] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[writeCache] operator[SEP] identifier[checkLowDiskSpace] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[OLowDiskSpaceException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] operator[SEP] identifier[lowDiskSpace] operator[SEP] identifier[freeSpace] operator[/] operator[SEP] Other[1024] operator[*] Other[1024] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] operator[SEP] identifier[lowDiskSpace] operator[SEP] identifier[requiredSpace] operator[/] operator[SEP] Other[1024] operator[*] Other[1024] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[configuration] operator[SEP] identifier[getContextConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getValueAsInteger] operator[SEP] identifier[OGlobalConfiguration] operator[SEP] identifier[DISK_CACHE_FREE_SPACE_LIMIT] operator[SEP] operator[+] literal[String] operator[+] identifier[OGlobalConfiguration] operator[SEP] identifier[DISK_CACHE_FREE_SPACE_LIMIT] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[lowDiskSpace] operator[=] Other[null] operator[SEP] } } Keyword[else] { identifier[lowDiskSpace] operator[=] Other[null] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] identifier[OException] operator[SEP] identifier[wrapException] operator[SEP] Keyword[new] identifier[OStorageException] operator[SEP] literal[String] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[checkpointInProgress] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } } identifier[checkReadOnlyConditions] operator[SEP] operator[SEP] operator[SEP] }
protected Subject obtainSubject(ServletRequest request) { Authentication authentication = SecurityContextHolder.getContext() .getAuthentication(); if (logger.isDebugEnabled()) { logger.debug("Attempting to obtainSubject using authentication : " + authentication); } if (authentication == null) { return null; } if (!authentication.isAuthenticated()) { return null; } if (!(authentication instanceof JaasAuthenticationToken)) { return null; } JaasAuthenticationToken token = (JaasAuthenticationToken) authentication; LoginContext loginContext = token.getLoginContext(); if (loginContext == null) { return null; } return loginContext.getSubject(); }
class class_name[name] begin[{] method[obtainSubject, return_type[type[Subject]], modifier[protected], parameter[request]] begin[{] local_variable[type[Authentication], authentication] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[binary_operation[literal["Attempting to obtainSubject using authentication : "], +, member[.authentication]]]] else begin[{] None end[}] if[binary_operation[member[.authentication], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[call[authentication.isAuthenticated, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[member[.authentication], instanceof, type[JaasAuthenticationToken]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[JaasAuthenticationToken], token] local_variable[type[LoginContext], loginContext] if[binary_operation[member[.loginContext], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[loginContext.getSubject, parameter[]]] end[}] END[}]
Keyword[protected] identifier[Subject] identifier[obtainSubject] operator[SEP] identifier[ServletRequest] identifier[request] operator[SEP] { identifier[Authentication] identifier[authentication] operator[=] identifier[SecurityContextHolder] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getAuthentication] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[authentication] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[authentication] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[authentication] operator[SEP] identifier[isAuthenticated] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[authentication] Keyword[instanceof] identifier[JaasAuthenticationToken] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[JaasAuthenticationToken] identifier[token] operator[=] operator[SEP] identifier[JaasAuthenticationToken] operator[SEP] identifier[authentication] operator[SEP] identifier[LoginContext] identifier[loginContext] operator[=] identifier[token] operator[SEP] identifier[getLoginContext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[loginContext] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[loginContext] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] operator[SEP] }
public static Predicate<CuratorTransactionResult> ofTypeAndPath(final OperationType type, final String forPath) { return new Predicate<CuratorTransactionResult>() { @Override public boolean apply(CuratorTransactionResult result) { return (result.getType() == type) && result.getForPath().equals(forPath); } }; }
class class_name[name] begin[{] method[ofTypeAndPath, return_type[type[Predicate]], modifier[public static], parameter[type, forPath]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=MethodInvocation(arguments=[], member=getForPath, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[MemberReference(member=forPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=result, type=ReferenceType(arguments=None, dimensions=[], name=CuratorTransactionResult, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), 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=CuratorTransactionResult, sub_type=None))], dimensions=None, name=Predicate, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Predicate] operator[<] identifier[CuratorTransactionResult] operator[>] identifier[ofTypeAndPath] operator[SEP] Keyword[final] identifier[OperationType] identifier[type] , Keyword[final] identifier[String] identifier[forPath] operator[SEP] { Keyword[return] Keyword[new] identifier[Predicate] operator[<] identifier[CuratorTransactionResult] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[apply] operator[SEP] identifier[CuratorTransactionResult] identifier[result] operator[SEP] { Keyword[return] operator[SEP] identifier[result] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[type] operator[SEP] operator[&&] identifier[result] operator[SEP] identifier[getForPath] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[forPath] operator[SEP] operator[SEP] } } operator[SEP] }
private static void checkByte(int ch, int pos, int len) throws IOException { if ((ch & 0xc0) != 0x80) { throw new IOException( GT.tr("Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}", pos, len, ch)); } }
class class_name[name] begin[{] method[checkByte, return_type[void], modifier[private static], parameter[ch, pos, len]] begin[{] if[binary_operation[binary_operation[member[.ch], &, literal[0xc0]], !=, literal[0x80]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}"), MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=tr, postfix_operators=[], prefix_operators=[], qualifier=GT, 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[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[checkByte] operator[SEP] Keyword[int] identifier[ch] , Keyword[int] identifier[pos] , Keyword[int] identifier[len] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[SEP] identifier[ch] operator[&] literal[Integer] operator[SEP] operator[!=] literal[Integer] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[GT] operator[SEP] identifier[tr] operator[SEP] literal[String] , identifier[pos] , identifier[len] , identifier[ch] operator[SEP] operator[SEP] operator[SEP] } }
@Override public <T> void onCompletion(Future<T> work, CompletionListener<T> l) { boolean queue = true; FutureMonitorInfo<T> info = new FutureMonitorInfo<T>(work, l); if (info.test()) { queue = !!!info.notifyListener(); } if (queue && work instanceof NonCancelableResultFuture<?>) { ((NonCancelableResultFuture<T>) work).queueListener(l); queue = false; } if (queue) { _monitor.add(info); if (_threadRunning.compareAndSet(false, true)) { // run thread _executor.schedule(_thread, 100, TimeUnit.MILLISECONDS); } } }
class class_name[name] begin[{] method[onCompletion, return_type[void], modifier[public], parameter[work, l]] begin[{] local_variable[type[boolean], queue] local_variable[type[FutureMonitorInfo], info] if[call[info.test, parameter[]]] begin[{] assign[member[.queue], call[info.notifyListener, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.queue], &&, binary_operation[member[.work], instanceof, type[NonCancelableResultFuture]]]] begin[{] Cast(expression=MemberReference(member=work, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=NonCancelableResultFuture, sub_type=None)) assign[member[.queue], literal[false]] else begin[{] None end[}] if[member[.queue]] begin[{] call[_monitor.add, parameter[member[.info]]] if[call[_threadRunning.compareAndSet, parameter[literal[false], literal[true]]]] begin[{] call[_executor.schedule, parameter[member[._thread], literal[100], member[TimeUnit.MILLISECONDS]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] Keyword[void] identifier[onCompletion] operator[SEP] identifier[Future] operator[<] identifier[T] operator[>] identifier[work] , identifier[CompletionListener] operator[<] identifier[T] operator[>] identifier[l] operator[SEP] { Keyword[boolean] identifier[queue] operator[=] literal[boolean] operator[SEP] identifier[FutureMonitorInfo] operator[<] identifier[T] operator[>] identifier[info] operator[=] Keyword[new] identifier[FutureMonitorInfo] operator[<] identifier[T] operator[>] operator[SEP] identifier[work] , identifier[l] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[info] operator[SEP] identifier[test] operator[SEP] operator[SEP] operator[SEP] { identifier[queue] operator[=] operator[!] operator[!] operator[!] identifier[info] operator[SEP] identifier[notifyListener] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[queue] operator[&&] identifier[work] Keyword[instanceof] identifier[NonCancelableResultFuture] operator[<] operator[?] operator[>] operator[SEP] { operator[SEP] operator[SEP] identifier[NonCancelableResultFuture] operator[<] identifier[T] operator[>] operator[SEP] identifier[work] operator[SEP] operator[SEP] identifier[queueListener] operator[SEP] identifier[l] operator[SEP] operator[SEP] identifier[queue] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[queue] operator[SEP] { identifier[_monitor] operator[SEP] identifier[add] operator[SEP] identifier[info] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_threadRunning] operator[SEP] identifier[compareAndSet] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] { identifier[_executor] operator[SEP] identifier[schedule] operator[SEP] identifier[_thread] , Other[100] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] } } }
boolean confirmFormat(boolean force, boolean interactive) throws IOException { List<FormatConfirmable> confirms = Lists.newArrayList(); for (StorageDirectory sd : storage.dirIterable(null)) { confirms.add(sd); } confirms.addAll(editLog.getFormatConfirmables()); return Storage.confirmFormat(confirms, force, interactive); }
class class_name[name] begin[{] method[confirmFormat, return_type[type[boolean]], modifier[default], parameter[force, interactive]] begin[{] local_variable[type[List], confirms] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=confirms, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=dirIterable, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StorageDirectory, sub_type=None))), label=None) call[confirms.addAll, parameter[call[editLog.getFormatConfirmables, parameter[]]]] return[call[Storage.confirmFormat, parameter[member[.confirms], member[.force], member[.interactive]]]] end[}] END[}]
Keyword[boolean] identifier[confirmFormat] operator[SEP] Keyword[boolean] identifier[force] , Keyword[boolean] identifier[interactive] operator[SEP] Keyword[throws] identifier[IOException] { identifier[List] operator[<] identifier[FormatConfirmable] operator[>] identifier[confirms] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[StorageDirectory] identifier[sd] operator[:] identifier[storage] operator[SEP] identifier[dirIterable] operator[SEP] Other[null] operator[SEP] operator[SEP] { identifier[confirms] operator[SEP] identifier[add] operator[SEP] identifier[sd] operator[SEP] operator[SEP] } identifier[confirms] operator[SEP] identifier[addAll] operator[SEP] identifier[editLog] operator[SEP] identifier[getFormatConfirmables] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Storage] operator[SEP] identifier[confirmFormat] operator[SEP] identifier[confirms] , identifier[force] , identifier[interactive] operator[SEP] operator[SEP] }
public static String concatWithSpaces(final Object... osToString) { final StringBuilder b = new StringBuilder(); boolean notFirst = false; if (osToString != null) { for (final Object o : osToString) { if (notFirst) { b.append(" "); } else { notFirst = true; } b.append(o != null ? o.toString() : "null"); } } return b.toString(); }
class class_name[name] begin[{] method[concatWithSpaces, return_type[type[String]], modifier[public static], parameter[osToString]] begin[{] local_variable[type[StringBuilder], b] local_variable[type[boolean], notFirst] if[binary_operation[member[.osToString], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=notFirst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=notFirst, 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=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null"), if_true=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[], type_arguments=None))], member=append, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=osToString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) else begin[{] None end[}] return[call[b.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[concatWithSpaces] operator[SEP] Keyword[final] identifier[Object] operator[...] identifier[osToString] operator[SEP] { Keyword[final] identifier[StringBuilder] identifier[b] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[notFirst] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[osToString] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[Object] identifier[o] operator[:] identifier[osToString] operator[SEP] { Keyword[if] operator[SEP] identifier[notFirst] operator[SEP] { identifier[b] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[notFirst] operator[=] literal[boolean] operator[SEP] } identifier[b] operator[SEP] identifier[append] operator[SEP] identifier[o] operator[!=] Other[null] operator[?] identifier[o] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[:] literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[b] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
protected static void constructM(List<Point2D_F64> obsPts, DMatrixRMaj alphas, DMatrixRMaj M) { int N = obsPts.size(); M.reshape(3*alphas.numCols,2*N,false); for( int i = 0; i < N; i++ ) { Point2D_F64 p2 = obsPts.get(i); int row = i*2; for( int j = 0; j < alphas.numCols; j++ ) { int col = j*3; double alpha = alphas.unsafe_get(i, j); M.unsafe_set(col, row, alpha); M.unsafe_set(col + 1, row, 0); M.unsafe_set(col + 2, row, -alpha * p2.x); M.unsafe_set(col , row + 1, 0); M.unsafe_set(col + 1, row + 1, alpha); M.unsafe_set(col + 2, row + 1, -alpha * p2.y); } } }
class class_name[name] begin[{] method[constructM, return_type[void], modifier[static protected], parameter[obsPts, alphas, M]] begin[{] local_variable[type[int], N] call[M.reshape, parameter[binary_operation[literal[3], *, member[alphas.numCols]], binary_operation[literal[2], *, member[.N]], literal[false]]] 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=obsPts, selectors=[], type_arguments=None), name=p2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Point2D_F64, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), name=row)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=*), name=col)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unsafe_get, postfix_operators=[], prefix_operators=[], qualifier=alphas, selectors=[], type_arguments=None), name=alpha)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unsafe_set, postfix_operators=[], prefix_operators=[], qualifier=M, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=unsafe_set, postfix_operators=[], prefix_operators=[], qualifier=M, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=p2, selectors=[]), operator=*)], member=unsafe_set, postfix_operators=[], prefix_operators=[], qualifier=M, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=unsafe_set, postfix_operators=[], prefix_operators=[], qualifier=M, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unsafe_set, postfix_operators=[], prefix_operators=[], qualifier=M, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=p2, selectors=[]), operator=*)], member=unsafe_set, postfix_operators=[], prefix_operators=[], qualifier=M, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=alphas, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[protected] Keyword[static] Keyword[void] identifier[constructM] operator[SEP] identifier[List] operator[<] identifier[Point2D_F64] operator[>] identifier[obsPts] , identifier[DMatrixRMaj] identifier[alphas] , identifier[DMatrixRMaj] identifier[M] operator[SEP] { Keyword[int] identifier[N] operator[=] identifier[obsPts] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[M] operator[SEP] identifier[reshape] operator[SEP] Other[3] operator[*] identifier[alphas] operator[SEP] identifier[numCols] , Other[2] operator[*] identifier[N] , literal[boolean] 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] { identifier[Point2D_F64] identifier[p2] operator[=] identifier[obsPts] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[row] operator[=] identifier[i] operator[*] Other[2] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[alphas] operator[SEP] identifier[numCols] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[int] identifier[col] operator[=] identifier[j] operator[*] Other[3] operator[SEP] Keyword[double] identifier[alpha] operator[=] identifier[alphas] operator[SEP] identifier[unsafe_get] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] identifier[M] operator[SEP] identifier[unsafe_set] operator[SEP] identifier[col] , identifier[row] , identifier[alpha] operator[SEP] operator[SEP] identifier[M] operator[SEP] identifier[unsafe_set] operator[SEP] identifier[col] operator[+] Other[1] , identifier[row] , Other[0] operator[SEP] operator[SEP] identifier[M] operator[SEP] identifier[unsafe_set] operator[SEP] identifier[col] operator[+] Other[2] , identifier[row] , operator[-] identifier[alpha] operator[*] identifier[p2] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[M] operator[SEP] identifier[unsafe_set] operator[SEP] identifier[col] , identifier[row] operator[+] Other[1] , Other[0] operator[SEP] operator[SEP] identifier[M] operator[SEP] identifier[unsafe_set] operator[SEP] identifier[col] operator[+] Other[1] , identifier[row] operator[+] Other[1] , identifier[alpha] operator[SEP] operator[SEP] identifier[M] operator[SEP] identifier[unsafe_set] operator[SEP] identifier[col] operator[+] Other[2] , identifier[row] operator[+] Other[1] , operator[-] identifier[alpha] operator[*] identifier[p2] operator[SEP] identifier[y] operator[SEP] operator[SEP] } } }
public boolean filter(String searchText, String searchComment, MatchType matchType, boolean caseSensitive) { if (StringUtils.isNotEmpty(searchText)) { if (matchType == MatchType.EQUALS) { if (caseSensitive) { if (!getName().equals(searchText)) { return false; } } else { if (!getName().equalsIgnoreCase(searchText)) { return false; } } } else { if (caseSensitive) { if (getName().indexOf(searchText) == -1) { return false; } } else { if (getName().toUpperCase().indexOf(searchText.toUpperCase()) == -1) { return false; } } } } if (StringUtils.isNotEmpty(searchComment)) { if (matchType == MatchType.EQUALS) { if (caseSensitive) { if (getRemarks() == null || !getRemarks().equals(searchComment)) { return false; } } else { if (getRemarks() == null || !getRemarks().equalsIgnoreCase(searchComment)) { return false; } } } else { if (caseSensitive) { if (getRemarks() == null || getRemarks().indexOf(searchComment) == -1) { return false; } } else { if (getRemarks() == null || getRemarks().indexOf(searchComment) == -1) { return false; } } } } return true; }
class class_name[name] begin[{] method[filter, return_type[type[boolean]], modifier[public], parameter[searchText, searchComment, matchType, caseSensitive]] begin[{] if[call[StringUtils.isNotEmpty, parameter[member[.searchText]]]] begin[{] if[binary_operation[member[.matchType], ==, member[MatchType.EQUALS]]] begin[{] if[member[.caseSensitive]] begin[{] if[call[.getName, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] if[call[.getName, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] end[}] else begin[{] if[member[.caseSensitive]] begin[{] if[binary_operation[call[.getName, parameter[]], ==, literal[1]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] if[binary_operation[call[.getName, parameter[]], ==, literal[1]]] begin[{] return[literal[false]] else begin[{] None end[}] end[}] end[}] else begin[{] None end[}] if[call[StringUtils.isNotEmpty, parameter[member[.searchComment]]]] begin[{] if[binary_operation[member[.matchType], ==, member[MatchType.EQUALS]]] begin[{] if[member[.caseSensitive]] begin[{] if[binary_operation[binary_operation[call[.getRemarks, parameter[]], ==, literal[null]], ||, call[.getRemarks, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] if[binary_operation[binary_operation[call[.getRemarks, parameter[]], ==, literal[null]], ||, call[.getRemarks, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] end[}] else begin[{] if[member[.caseSensitive]] begin[{] if[binary_operation[binary_operation[call[.getRemarks, parameter[]], ==, literal[null]], ||, binary_operation[call[.getRemarks, parameter[]], ==, literal[1]]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] if[binary_operation[binary_operation[call[.getRemarks, parameter[]], ==, literal[null]], ||, binary_operation[call[.getRemarks, parameter[]], ==, literal[1]]]] begin[{] return[literal[false]] else begin[{] None end[}] end[}] end[}] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[filter] operator[SEP] identifier[String] identifier[searchText] , identifier[String] identifier[searchComment] , identifier[MatchType] identifier[matchType] , Keyword[boolean] identifier[caseSensitive] operator[SEP] { Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[searchText] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[matchType] operator[==] identifier[MatchType] operator[SEP] identifier[EQUALS] operator[SEP] { Keyword[if] operator[SEP] identifier[caseSensitive] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[searchText] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[searchText] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[else] { Keyword[if] operator[SEP] identifier[caseSensitive] operator[SEP] { Keyword[if] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[indexOf] operator[SEP] identifier[searchText] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] identifier[indexOf] operator[SEP] identifier[searchText] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[searchComment] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[matchType] operator[==] identifier[MatchType] operator[SEP] identifier[EQUALS] operator[SEP] { Keyword[if] operator[SEP] identifier[caseSensitive] operator[SEP] { Keyword[if] operator[SEP] identifier[getRemarks] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] operator[!] identifier[getRemarks] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[searchComment] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[getRemarks] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] operator[!] identifier[getRemarks] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[searchComment] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[else] { Keyword[if] operator[SEP] identifier[caseSensitive] operator[SEP] { Keyword[if] operator[SEP] identifier[getRemarks] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[getRemarks] operator[SEP] operator[SEP] operator[SEP] identifier[indexOf] operator[SEP] identifier[searchComment] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[getRemarks] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[getRemarks] operator[SEP] operator[SEP] operator[SEP] identifier[indexOf] operator[SEP] identifier[searchComment] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } } Keyword[return] literal[boolean] operator[SEP] }
public Observable<RouteFilterRuleInner> getAsync(String resourceGroupName, String routeFilterName, String ruleName) { return getWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName).map(new Func1<ServiceResponse<RouteFilterRuleInner>, RouteFilterRuleInner>() { @Override public RouteFilterRuleInner call(ServiceResponse<RouteFilterRuleInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[getAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, routeFilterName, ruleName]] begin[{] return[call[.getWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.routeFilterName], member[.ruleName]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[RouteFilterRuleInner] operator[>] identifier[getAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[routeFilterName] , identifier[String] identifier[ruleName] operator[SEP] { Keyword[return] identifier[getWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[routeFilterName] , identifier[ruleName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[RouteFilterRuleInner] operator[>] , identifier[RouteFilterRuleInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[RouteFilterRuleInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[RouteFilterRuleInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public boolean isServeServletsByClassnameEnabled() { // PK52059 START disallowServeServletsByClassnameProp = WCCustomProperties.DISALLOW_SERVE_SERVLETS_BY_CLASSNAME_PROP; if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) { logger.logp(Level.FINE, CLASS_NAME, "isServeServletsByClassnameEnabled", "disallowServeServletsByClassnameProp = " + disallowServeServletsByClassnameProp); } if (disallowServeServletsByClassnameProp != null) { try { if (Boolean.valueOf(disallowServeServletsByClassnameProp).booleanValue()) { this.serveServletsByClassnameEnabled = Boolean.FALSE; } if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) { logger.logp(Level.FINE, CLASS_NAME, "isServeServletsByClassnameEnabled", "PK52059: disallowServeServletsByClassnameProp set to " + disallowServeServletsByClassnameProp + " for application: " + this.getApplicationName()); } } catch (Exception x) { logger.logp(Level.SEVERE, CLASS_NAME, "isServeServletsByClassnameEnabled", "Illegal value set for property com.ibm.ws.webcontainer.disallowserveservletsbyclassname"); } } // PK52059 END if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) { logger.logp(Level.FINE, CLASS_NAME, "isServeServletsByClassnameEnabled", "value = " + (this.serveServletsByClassnameEnabled != null ? this.serveServletsByClassnameEnabled.booleanValue() : WCCustomProperties.SERVE_SERVLETS_BY_CLASSNAME_ENABLED)); } if (this.serveServletsByClassnameEnabled != null) return this.serveServletsByClassnameEnabled.booleanValue(); return WCCustomProperties.SERVE_SERVLETS_BY_CLASSNAME_ENABLED; }
class class_name[name] begin[{] method[isServeServletsByClassnameEnabled, return_type[type[boolean]], modifier[public], parameter[]] begin[{] assign[member[.disallowServeServletsByClassnameProp], member[WCCustomProperties.DISALLOW_SERVE_SERVLETS_BY_CLASSNAME_PROP]] if[binary_operation[call[com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[logger.isLoggable, parameter[member[Level.FINE]]]]] begin[{] call[logger.logp, parameter[member[Level.FINE], member[.CLASS_NAME], literal["isServeServletsByClassnameEnabled"], binary_operation[literal["disallowServeServletsByClassnameProp = "], +, member[.disallowServeServletsByClassnameProp]]]] else begin[{] None end[}] if[binary_operation[member[.disallowServeServletsByClassnameProp], !=, literal[null]]] begin[{] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=disallowServeServletsByClassnameProp, 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), 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=serveServletsByClassnameEnabled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=FALSE, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[])), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ejs.ras.TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="isServeServletsByClassnameEnabled"), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PK52059: disallowServeServletsByClassnameProp set to "), operandr=MemberReference(member=disallowServeServletsByClassnameProp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for application: "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getApplicationName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+)], member=logp, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="isServeServletsByClassnameEnabled"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Illegal value set for property com.ibm.ws.webcontainer.disallowserveservletsbyclassname")], member=logp, postfix_operators=[], prefix_operators=[], qualifier=logger, 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) else begin[{] None end[}] if[binary_operation[call[com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[logger.isLoggable, parameter[member[Level.FINE]]]]] begin[{] call[logger.logp, parameter[member[Level.FINE], member[.CLASS_NAME], literal["isServeServletsByClassnameEnabled"], binary_operation[literal["value = "], +, TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serveServletsByClassnameEnabled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=SERVE_SERVLETS_BY_CLASSNAME_ENABLED, postfix_operators=[], prefix_operators=[], qualifier=WCCustomProperties, selectors=[]), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serveServletsByClassnameEnabled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=booleanValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]))]]] else begin[{] None end[}] if[binary_operation[THIS[member[None.serveServletsByClassnameEnabled]], !=, literal[null]]] begin[{] return[THIS[member[None.serveServletsByClassnameEnabled]call[None.booleanValue, parameter[]]]] else begin[{] None end[}] return[member[WCCustomProperties.SERVE_SERVLETS_BY_CLASSNAME_ENABLED]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isServeServletsByClassnameEnabled] operator[SEP] operator[SEP] { identifier[disallowServeServletsByClassnameProp] operator[=] identifier[WCCustomProperties] operator[SEP] identifier[DISALLOW_SERVE_SERVLETS_BY_CLASSNAME_PROP] operator[SEP] Keyword[if] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ejs] operator[SEP] identifier[ras] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[+] identifier[disallowServeServletsByClassnameProp] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[disallowServeServletsByClassnameProp] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[disallowServeServletsByClassnameProp] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[serveServletsByClassnameEnabled] operator[=] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] } Keyword[if] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ejs] operator[SEP] identifier[ras] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[+] identifier[disallowServeServletsByClassnameProp] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getApplicationName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[x] operator[SEP] { identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ejs] operator[SEP] identifier[ras] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[+] operator[SEP] Keyword[this] operator[SEP] identifier[serveServletsByClassnameEnabled] operator[!=] Other[null] operator[?] Keyword[this] operator[SEP] identifier[serveServletsByClassnameEnabled] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[:] identifier[WCCustomProperties] operator[SEP] identifier[SERVE_SERVLETS_BY_CLASSNAME_ENABLED] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[serveServletsByClassnameEnabled] operator[!=] Other[null] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[serveServletsByClassnameEnabled] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[WCCustomProperties] operator[SEP] identifier[SERVE_SERVLETS_BY_CLASSNAME_ENABLED] operator[SEP] }
@VisibleForTesting static void getLocationsFromLink(List<String> possiblePaths, Path link) { try { Path resolvedLink = link.toRealPath(); Path possibleBinDir = resolvedLink.getParent(); // check if the parent is "bin", we actually depend on that for other resolution if (possibleBinDir != null && possibleBinDir.getFileName().toString().equals("bin")) { Path possibleCloudSdkHome = possibleBinDir.getParent(); if (possibleCloudSdkHome != null && Files.exists(possibleCloudSdkHome)) { possiblePaths.add(possibleCloudSdkHome.toString()); } } } catch (IOException ioe) { // intentionally ignore exception logger.log(Level.FINE, "Non-critical exception when searching for cloud-sdk", ioe); } }
class class_name[name] begin[{] method[getLocationsFromLink, return_type[void], modifier[static], parameter[possiblePaths, link]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toRealPath, postfix_operators=[], prefix_operators=[], qualifier=link, selectors=[], type_arguments=None), name=resolvedLink)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=resolvedLink, selectors=[], type_arguments=None), name=possibleBinDir)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=possibleBinDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=getFileName, postfix_operators=[], prefix_operators=[], qualifier=possibleBinDir, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bin")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=possibleBinDir, selectors=[], type_arguments=None), name=possibleCloudSdkHome)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=possibleCloudSdkHome, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=possibleCloudSdkHome, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exists, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=possibleCloudSdkHome, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=possiblePaths, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Non-critical exception when searching for cloud-sdk"), MemberReference(member=ioe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[VisibleForTesting] Keyword[static] Keyword[void] identifier[getLocationsFromLink] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[possiblePaths] , identifier[Path] identifier[link] operator[SEP] { Keyword[try] { identifier[Path] identifier[resolvedLink] operator[=] identifier[link] operator[SEP] identifier[toRealPath] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[possibleBinDir] operator[=] identifier[resolvedLink] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[possibleBinDir] operator[!=] Other[null] operator[&&] identifier[possibleBinDir] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[Path] identifier[possibleCloudSdkHome] operator[=] identifier[possibleBinDir] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[possibleCloudSdkHome] operator[!=] Other[null] operator[&&] identifier[Files] operator[SEP] identifier[exists] operator[SEP] identifier[possibleCloudSdkHome] operator[SEP] operator[SEP] { identifier[possiblePaths] operator[SEP] identifier[add] operator[SEP] identifier[possibleCloudSdkHome] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[ioe] operator[SEP] operator[SEP] } }
@Override protected boolean processRun(DBGPCommand c) throws DBGPException { checkArgs(c, 1, false); if (status == DBGPStatus.BREAK || status == DBGPStatus.STOPPING) { if (breakContext != null) { breakContext.threadState.setBreaks(null, null, null); status = DBGPStatus.RUNNING; statusReason = DBGPReason.OK; return false; // run means continue } else { throw new DBGPException(DBGPErrorCode.NOT_AVAILABLE, c.toString()); } } if (status == DBGPStatus.STARTING && expression == null) { status = DBGPStatus.RUNNING; statusReason = DBGPReason.OK; return false; // a run for a new thread, means continue } if (status != DBGPStatus.STARTING) { throw new DBGPException(DBGPErrorCode.NOT_AVAILABLE, c.toString()); } if (c.data != null) // data is in "expression" { throw new DBGPException(DBGPErrorCode.INVALID_OPTIONS, c.toString()); } if (remoteControl != null) { try { status = DBGPStatus.RUNNING; statusReason = DBGPReason.OK; final RemoteInterpreter remoteInterpreter = new RemoteInterpreter(interpreter, this); Thread remoteThread = new Thread(new Runnable() { public void run() { try { remoteControl.run(remoteInterpreter); } catch (Exception e) { status = DBGPStatus.STOPPED; statusReason = DBGPReason.ERROR; errorResponse(DBGPErrorCode.INTERNAL_ERROR, e.getMessage()); } } }); remoteThread.setName("RemoteControl runner"); remoteThread.setDaemon(true); remoteThread.start(); remoteInterpreter.processRemoteCalls(); stdout("Remote control completed"); statusResponse(DBGPStatus.STOPPED, DBGPReason.OK); run(); } catch (Exception e) { status = DBGPStatus.STOPPED; statusReason = DBGPReason.ERROR; errorResponse(DBGPErrorCode.INTERNAL_ERROR, e.getMessage()); } return false; // Do not continue after remote session } else { try { status = DBGPStatus.RUNNING; statusReason = DBGPReason.OK; if (!traceExpression) { long before = System.currentTimeMillis(); if (expression.equals("###CONSOLE###")) { run(); } else { theAnswer = interpreter.execute(expression, this); } stdout("\n" + expression + " = " + theAnswer.toString() + "\n"); long after = System.currentTimeMillis(); stdout("Executed in " + (double)(after-before)/1000 + " secs. "); } else { String[] parts = expression.split("\\s+"); int testNo = 0; float reduction = 1.0F; TraceReductionType reductionType = TraceReductionType.NONE; long seed = 999; // Test`T1 4 {subset,reduction,seed} if (parts.length >= 2 && !parts[1].startsWith("{")) { try { testNo = Integer.parseInt(parts[1]); } catch (NumberFormatException e) { errorResponse(DBGPErrorCode.INTERNAL_ERROR, parts[0] + " <name> [test number]"); return true; } } if (parts.length >= 2 && parts[parts.length - 1].length() > 7 && parts[parts.length - 1].startsWith("{")) { try { String settings = parts[parts.length - 1]; String[] tmp = settings.substring(1, settings.length() - 1).split(","); if (tmp.length == 3) { reduction = Float.parseFloat(tmp[0]); reductionType = TraceReductionType.valueOf(tmp[1]); seed = Long.parseLong(tmp[2]); } } catch (NumberFormatException e) { errorResponse(DBGPErrorCode.INTERNAL_ERROR, parts[0] + " <name> [test number]"); return true; } } String traceExpression1 = parts[0]; interpreter.runtrace(traceExpression1, testNo, true, reduction, reductionType, seed); stdout("\n" + expression + " = " + "Trace completed\n"); } statusResponse(DBGPStatus.STOPPED, DBGPReason.OK); } catch (ContextException e) { dyingThread(e); } catch (Exception e) { status = DBGPStatus.STOPPED; statusReason = DBGPReason.ERROR; errorResponse(DBGPErrorCode.EVALUATION_ERROR, e.getMessage()); } return true; } }
class class_name[name] begin[{] method[processRun, return_type[type[boolean]], modifier[protected], parameter[c]] begin[{] call[.checkArgs, parameter[member[.c], literal[1], literal[false]]] if[binary_operation[binary_operation[member[.status], ==, member[DBGPStatus.BREAK]], ||, binary_operation[member[.status], ==, member[DBGPStatus.STOPPING]]]] begin[{] if[binary_operation[member[.breakContext], !=, literal[null]]] begin[{] call[breakContext.threadState.setBreaks, parameter[literal[null], literal[null], literal[null]]] assign[member[.status], member[DBGPStatus.RUNNING]] assign[member[.statusReason], member[DBGPReason.OK]] return[literal[false]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=NOT_AVAILABLE, postfix_operators=[], prefix_operators=[], qualifier=DBGPErrorCode, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DBGPException, sub_type=None)), label=None) end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[.status], ==, member[DBGPStatus.STARTING]], &&, binary_operation[member[.expression], ==, literal[null]]]] begin[{] assign[member[.status], member[DBGPStatus.RUNNING]] assign[member[.statusReason], member[DBGPReason.OK]] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.status], !=, member[DBGPStatus.STARTING]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=NOT_AVAILABLE, postfix_operators=[], prefix_operators=[], qualifier=DBGPErrorCode, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DBGPException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[c.data], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INVALID_OPTIONS, postfix_operators=[], prefix_operators=[], qualifier=DBGPErrorCode, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DBGPException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.remoteControl], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=RUNNING, postfix_operators=[], prefix_operators=[], qualifier=DBGPStatus, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=statusReason, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=OK, postfix_operators=[], prefix_operators=[], qualifier=DBGPReason, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=interpreter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RemoteInterpreter, sub_type=None)), name=remoteInterpreter)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=RemoteInterpreter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=remoteInterpreter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=run, postfix_operators=[], prefix_operators=[], qualifier=remoteControl, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STOPPED, postfix_operators=[], prefix_operators=[], qualifier=DBGPStatus, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=statusReason, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=DBGPReason, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INTERNAL_ERROR, postfix_operators=[], prefix_operators=[], qualifier=DBGPErrorCode, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=errorResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Thread, sub_type=None)), name=remoteThread)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Thread, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="RemoteControl runner")], member=setName, postfix_operators=[], prefix_operators=[], qualifier=remoteThread, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setDaemon, postfix_operators=[], prefix_operators=[], qualifier=remoteThread, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=start, postfix_operators=[], prefix_operators=[], qualifier=remoteThread, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=processRemoteCalls, postfix_operators=[], prefix_operators=[], qualifier=remoteInterpreter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Remote control completed")], member=stdout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=STOPPED, postfix_operators=[], prefix_operators=[], qualifier=DBGPStatus, selectors=[]), MemberReference(member=OK, postfix_operators=[], prefix_operators=[], qualifier=DBGPReason, selectors=[])], member=statusResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STOPPED, postfix_operators=[], prefix_operators=[], qualifier=DBGPStatus, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=statusReason, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=DBGPReason, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INTERNAL_ERROR, postfix_operators=[], prefix_operators=[], qualifier=DBGPErrorCode, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=errorResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[literal[false]] else begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=RUNNING, postfix_operators=[], prefix_operators=[], qualifier=DBGPStatus, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=statusReason, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=OK, postfix_operators=[], prefix_operators=[], qualifier=DBGPReason, selectors=[])), label=None), IfStatement(condition=MemberReference(member=traceExpression, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\s+")], member=split, postfix_operators=[], prefix_operators=[], qualifier=expression, selectors=[], type_arguments=None), name=parts)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=testNo)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0F), name=reduction)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=NONE, postfix_operators=[], prefix_operators=[], qualifier=TraceReductionType, selectors=[]), name=reductionType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TraceReductionType, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=999), name=seed)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parts, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=>=), operandr=MemberReference(member=parts, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{")], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=testNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INTERNAL_ERROR, postfix_operators=[], prefix_operators=[], qualifier=DBGPErrorCode, selectors=[]), BinaryOperation(operandl=MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" <name> [test number]"), operator=+)], member=errorResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parts, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parts, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7), operator=>), operator=&&), operandr=MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parts, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{")], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parts, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), name=settings)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=settings, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=settings, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=tmp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=reduction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=parseFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=reductionType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=TraceReductionType, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=seed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INTERNAL_ERROR, postfix_operators=[], prefix_operators=[], qualifier=DBGPErrorCode, selectors=[]), BinaryOperation(operandl=MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" <name> [test number]"), operator=+)], member=errorResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), name=traceExpression1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=traceExpression1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=testNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=reduction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reductionType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=seed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=runtrace, postfix_operators=[], prefix_operators=[], qualifier=interpreter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operandr=MemberReference(member=expression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" = "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Trace completed\n"), operator=+)], member=stdout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), name=before)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="###CONSOLE###")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=expression, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=theAnswer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=expression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=interpreter, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operandr=MemberReference(member=expression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" = "), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=theAnswer, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=stdout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), name=after)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Executed in "), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=after, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=before, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), type=BasicType(dimensions=[], name=double)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=/), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" secs. "), operator=+)], member=stdout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=STOPPED, postfix_operators=[], prefix_operators=[], qualifier=DBGPStatus, selectors=[]), MemberReference(member=OK, postfix_operators=[], prefix_operators=[], qualifier=DBGPReason, selectors=[])], member=statusResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dyingThread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ContextException'])), CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STOPPED, postfix_operators=[], prefix_operators=[], qualifier=DBGPStatus, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=statusReason, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=DBGPReason, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=EVALUATION_ERROR, postfix_operators=[], prefix_operators=[], qualifier=DBGPErrorCode, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=errorResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[literal[true]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[boolean] identifier[processRun] operator[SEP] identifier[DBGPCommand] identifier[c] operator[SEP] Keyword[throws] identifier[DBGPException] { identifier[checkArgs] operator[SEP] identifier[c] , Other[1] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[status] operator[==] identifier[DBGPStatus] operator[SEP] identifier[BREAK] operator[||] identifier[status] operator[==] identifier[DBGPStatus] operator[SEP] identifier[STOPPING] operator[SEP] { Keyword[if] operator[SEP] identifier[breakContext] operator[!=] Other[null] operator[SEP] { identifier[breakContext] operator[SEP] identifier[threadState] operator[SEP] identifier[setBreaks] operator[SEP] Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[status] operator[=] identifier[DBGPStatus] operator[SEP] identifier[RUNNING] operator[SEP] identifier[statusReason] operator[=] identifier[DBGPReason] operator[SEP] identifier[OK] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[DBGPException] operator[SEP] identifier[DBGPErrorCode] operator[SEP] identifier[NOT_AVAILABLE] , identifier[c] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[status] operator[==] identifier[DBGPStatus] operator[SEP] identifier[STARTING] operator[&&] identifier[expression] operator[==] Other[null] operator[SEP] { identifier[status] operator[=] identifier[DBGPStatus] operator[SEP] identifier[RUNNING] operator[SEP] identifier[statusReason] operator[=] identifier[DBGPReason] operator[SEP] identifier[OK] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[status] operator[!=] identifier[DBGPStatus] operator[SEP] identifier[STARTING] operator[SEP] { Keyword[throw] Keyword[new] identifier[DBGPException] operator[SEP] identifier[DBGPErrorCode] operator[SEP] identifier[NOT_AVAILABLE] , identifier[c] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[data] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[DBGPException] operator[SEP] identifier[DBGPErrorCode] operator[SEP] identifier[INVALID_OPTIONS] , identifier[c] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[remoteControl] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[status] operator[=] identifier[DBGPStatus] operator[SEP] identifier[RUNNING] operator[SEP] identifier[statusReason] operator[=] identifier[DBGPReason] operator[SEP] identifier[OK] operator[SEP] Keyword[final] identifier[RemoteInterpreter] identifier[remoteInterpreter] operator[=] Keyword[new] identifier[RemoteInterpreter] operator[SEP] identifier[interpreter] , Keyword[this] operator[SEP] operator[SEP] identifier[Thread] identifier[remoteThread] operator[=] Keyword[new] identifier[Thread] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[try] { identifier[remoteControl] operator[SEP] identifier[run] operator[SEP] identifier[remoteInterpreter] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[status] operator[=] identifier[DBGPStatus] operator[SEP] identifier[STOPPED] operator[SEP] identifier[statusReason] operator[=] identifier[DBGPReason] operator[SEP] identifier[ERROR] operator[SEP] identifier[errorResponse] operator[SEP] identifier[DBGPErrorCode] operator[SEP] identifier[INTERNAL_ERROR] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] identifier[remoteThread] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[remoteThread] operator[SEP] identifier[setDaemon] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[remoteThread] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[remoteInterpreter] operator[SEP] identifier[processRemoteCalls] operator[SEP] operator[SEP] operator[SEP] identifier[stdout] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[statusResponse] operator[SEP] identifier[DBGPStatus] operator[SEP] identifier[STOPPED] , identifier[DBGPReason] operator[SEP] identifier[OK] operator[SEP] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[status] operator[=] identifier[DBGPStatus] operator[SEP] identifier[STOPPED] operator[SEP] identifier[statusReason] operator[=] identifier[DBGPReason] operator[SEP] identifier[ERROR] operator[SEP] identifier[errorResponse] operator[SEP] identifier[DBGPErrorCode] operator[SEP] identifier[INTERNAL_ERROR] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[try] { identifier[status] operator[=] identifier[DBGPStatus] operator[SEP] identifier[RUNNING] operator[SEP] identifier[statusReason] operator[=] identifier[DBGPReason] operator[SEP] identifier[OK] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[traceExpression] operator[SEP] { Keyword[long] identifier[before] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[expression] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[theAnswer] operator[=] identifier[interpreter] operator[SEP] identifier[execute] operator[SEP] identifier[expression] , Keyword[this] operator[SEP] operator[SEP] } identifier[stdout] operator[SEP] literal[String] operator[+] identifier[expression] operator[+] literal[String] operator[+] identifier[theAnswer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[long] identifier[after] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[stdout] operator[SEP] literal[String] operator[+] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[after] operator[-] identifier[before] operator[SEP] operator[/] Other[1000] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[expression] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[testNo] operator[=] Other[0] operator[SEP] Keyword[float] identifier[reduction] operator[=] literal[Float] operator[SEP] identifier[TraceReductionType] identifier[reductionType] operator[=] identifier[TraceReductionType] operator[SEP] identifier[NONE] operator[SEP] Keyword[long] identifier[seed] operator[=] Other[999] operator[SEP] Keyword[if] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[>=] Other[2] operator[&&] operator[!] identifier[parts] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] { identifier[testNo] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[parts] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { identifier[errorResponse] operator[SEP] identifier[DBGPErrorCode] operator[SEP] identifier[INTERNAL_ERROR] , identifier[parts] operator[SEP] Other[0] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[>=] Other[2] operator[&&] identifier[parts] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[7] operator[&&] identifier[parts] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] { identifier[String] identifier[settings] operator[=] identifier[parts] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[tmp] operator[=] identifier[settings] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[settings] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmp] operator[SEP] identifier[length] operator[==] Other[3] operator[SEP] { identifier[reduction] operator[=] identifier[Float] operator[SEP] identifier[parseFloat] operator[SEP] identifier[tmp] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[reductionType] operator[=] identifier[TraceReductionType] operator[SEP] identifier[valueOf] operator[SEP] identifier[tmp] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[seed] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[tmp] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { identifier[errorResponse] operator[SEP] identifier[DBGPErrorCode] operator[SEP] identifier[INTERNAL_ERROR] , identifier[parts] operator[SEP] Other[0] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } identifier[String] identifier[traceExpression1] operator[=] identifier[parts] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[interpreter] operator[SEP] identifier[runtrace] operator[SEP] identifier[traceExpression1] , identifier[testNo] , literal[boolean] , identifier[reduction] , identifier[reductionType] , identifier[seed] operator[SEP] operator[SEP] identifier[stdout] operator[SEP] literal[String] operator[+] identifier[expression] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[statusResponse] operator[SEP] identifier[DBGPStatus] operator[SEP] identifier[STOPPED] , identifier[DBGPReason] operator[SEP] identifier[OK] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ContextException] identifier[e] operator[SEP] { identifier[dyingThread] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[status] operator[=] identifier[DBGPStatus] operator[SEP] identifier[STOPPED] operator[SEP] identifier[statusReason] operator[=] identifier[DBGPReason] operator[SEP] identifier[ERROR] operator[SEP] identifier[errorResponse] operator[SEP] identifier[DBGPErrorCode] operator[SEP] identifier[EVALUATION_ERROR] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } }
public void setSessionTimeout(int timeout) { ((ZKBackend) getBackend()).setSessionTimeout(timeout); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Locator session timeout set to: " + timeout); } }
class class_name[name] begin[{] method[setSessionTimeout, return_type[void], modifier[public], parameter[timeout]] begin[{] Cast(expression=MethodInvocation(arguments=[], member=getBackend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ZKBackend, sub_type=None)) if[call[LOG.isLoggable, parameter[member[Level.FINE]]]] begin[{] call[LOG.fine, parameter[binary_operation[literal["Locator session timeout set to: "], +, member[.timeout]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setSessionTimeout] operator[SEP] Keyword[int] identifier[timeout] operator[SEP] { operator[SEP] operator[SEP] identifier[ZKBackend] operator[SEP] identifier[getBackend] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setSessionTimeout] operator[SEP] identifier[timeout] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[timeout] operator[SEP] operator[SEP] } }
public void processResources(List<Row> permanentRows, List<Row> consumableRows) { // // Process permanent resources // for (Row row : permanentRows) { Resource resource = m_project.addResource(); resource.setType(ResourceType.WORK); resource.setUniqueID(row.getInteger("PERMANENT_RESOURCEID")); resource.setEmailAddress(row.getString("EMAIL_ADDRESS")); // EFFORT_TIME_UNIT resource.setName(row.getString("NASE")); resource.setResourceCalendar(deriveResourceCalendar(row.getInteger("CALENDAV"))); resource.setMaxUnits(Double.valueOf(row.getDouble("AVAILABILITY").doubleValue() * 100)); resource.setGeneric(row.getBoolean("CREATED_AS_FOLDER")); resource.setInitials(getInitials(resource.getName())); } // // Process groups // /* for (Row row : permanentRows) { Resource resource = m_project.getResourceByUniqueID(row.getInteger("PERMANENT_RESOURCEID")); Resource group = m_project.getResourceByUniqueID(row.getInteger("ROLE")); if (resource != null && group != null) { resource.setGroup(group.getName()); } } */ // // Process consumable resources // for (Row row : consumableRows) { Resource resource = m_project.addResource(); resource.setType(ResourceType.MATERIAL); resource.setUniqueID(row.getInteger("CONSUMABLE_RESOURCEID")); resource.setCostPerUse(row.getDouble("COST_PER_USEDEFAULTSAMOUNT")); resource.setPeakUnits(Double.valueOf(row.getDouble("AVAILABILITY").doubleValue() * 100)); resource.setName(row.getString("NASE")); resource.setResourceCalendar(deriveResourceCalendar(row.getInteger("CALENDAV"))); resource.setAvailableFrom(row.getDate("AVAILABLE_FROM")); resource.setAvailableTo(row.getDate("AVAILABLE_TO")); resource.setGeneric(row.getBoolean("CREATED_AS_FOLDER")); resource.setMaterialLabel(row.getString("MEASUREMENT")); resource.setInitials(getInitials(resource.getName())); } }
class class_name[name] begin[{] method[processResources, return_type[void], modifier[public], parameter[permanentRows, consumableRows]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=addResource, postfix_operators=[], prefix_operators=[], qualifier=m_project, selectors=[], type_arguments=None), name=resource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Resource, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WORK, postfix_operators=[], prefix_operators=[], qualifier=ResourceType, selectors=[])], member=setType, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PERMANENT_RESOURCEID")], member=getInteger, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setUniqueID, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="EMAIL_ADDRESS")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setEmailAddress, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NASE")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CALENDAV")], member=getInteger, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=deriveResourceCalendar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setResourceCalendar, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AVAILABILITY")], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[MethodInvocation(arguments=[], member=doubleValue, 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=100), operator=*)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None)], member=setMaxUnits, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CREATED_AS_FOLDER")], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setGeneric, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=getInitials, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setInitials, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=permanentRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Row, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=addResource, postfix_operators=[], prefix_operators=[], qualifier=m_project, selectors=[], type_arguments=None), name=resource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Resource, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MATERIAL, postfix_operators=[], prefix_operators=[], qualifier=ResourceType, selectors=[])], member=setType, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CONSUMABLE_RESOURCEID")], member=getInteger, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setUniqueID, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="COST_PER_USEDEFAULTSAMOUNT")], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setCostPerUse, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AVAILABILITY")], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[MethodInvocation(arguments=[], member=doubleValue, 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=100), operator=*)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None)], member=setPeakUnits, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NASE")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CALENDAV")], member=getInteger, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=deriveResourceCalendar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setResourceCalendar, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AVAILABLE_FROM")], member=getDate, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setAvailableFrom, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AVAILABLE_TO")], member=getDate, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setAvailableTo, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CREATED_AS_FOLDER")], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setGeneric, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MEASUREMENT")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=setMaterialLabel, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=getInitials, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setInitials, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=consumableRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Row, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[processResources] operator[SEP] identifier[List] operator[<] identifier[Row] operator[>] identifier[permanentRows] , identifier[List] operator[<] identifier[Row] operator[>] identifier[consumableRows] operator[SEP] { Keyword[for] operator[SEP] identifier[Row] identifier[row] operator[:] identifier[permanentRows] operator[SEP] { identifier[Resource] identifier[resource] operator[=] identifier[m_project] operator[SEP] identifier[addResource] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setType] operator[SEP] identifier[ResourceType] operator[SEP] identifier[WORK] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setUniqueID] operator[SEP] identifier[row] operator[SEP] identifier[getInteger] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setEmailAddress] operator[SEP] identifier[row] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setName] operator[SEP] identifier[row] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setResourceCalendar] operator[SEP] identifier[deriveResourceCalendar] operator[SEP] identifier[row] operator[SEP] identifier[getInteger] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setMaxUnits] operator[SEP] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[row] operator[SEP] identifier[getDouble] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[*] Other[100] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setGeneric] operator[SEP] identifier[row] operator[SEP] identifier[getBoolean] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setInitials] operator[SEP] identifier[getInitials] operator[SEP] identifier[resource] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Row] identifier[row] operator[:] identifier[consumableRows] operator[SEP] { identifier[Resource] identifier[resource] operator[=] identifier[m_project] operator[SEP] identifier[addResource] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setType] operator[SEP] identifier[ResourceType] operator[SEP] identifier[MATERIAL] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setUniqueID] operator[SEP] identifier[row] operator[SEP] identifier[getInteger] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setCostPerUse] operator[SEP] identifier[row] operator[SEP] identifier[getDouble] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setPeakUnits] operator[SEP] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[row] operator[SEP] identifier[getDouble] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[*] Other[100] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setName] operator[SEP] identifier[row] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setResourceCalendar] operator[SEP] identifier[deriveResourceCalendar] operator[SEP] identifier[row] operator[SEP] identifier[getInteger] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setAvailableFrom] operator[SEP] identifier[row] operator[SEP] identifier[getDate] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setAvailableTo] operator[SEP] identifier[row] operator[SEP] identifier[getDate] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setGeneric] operator[SEP] identifier[row] operator[SEP] identifier[getBoolean] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setMaterialLabel] operator[SEP] identifier[row] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setInitials] operator[SEP] identifier[getInitials] operator[SEP] identifier[resource] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
boolean connectionFailed(IOException e) { // Any future attempt to connect using this strategy will be a fallback attempt. isFallback = true; if (!isFallbackPossible) { return false; } // If there was a protocol problem, don't recover. if (e instanceof ProtocolException) { return false; } // If there was an interruption or timeout (SocketTimeoutException), don't recover. // For the socket connect timeout case we do not try the same host with a different // ConnectionSpec: we assume it is unreachable. if (e instanceof InterruptedIOException) { return false; } // Look for known client-side or negotiation errors that are unlikely to be fixed by trying // again with a different connection spec. if (e instanceof SSLHandshakeException) { // If the problem was a CertificateException from the X509TrustManager, do not retry. if (e.getCause() instanceof CertificateException) { return false; } } if (e instanceof SSLPeerUnverifiedException) { // e.g. a certificate pinning error. return false; } // Retry for all other SSL failures. return e instanceof SSLException; }
class class_name[name] begin[{] method[connectionFailed, return_type[type[boolean]], modifier[default], parameter[e]] begin[{] assign[member[.isFallback], literal[true]] if[member[.isFallbackPossible]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.e], instanceof, type[ProtocolException]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.e], instanceof, type[InterruptedIOException]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.e], instanceof, type[SSLHandshakeException]]] begin[{] if[binary_operation[call[e.getCause, parameter[]], instanceof, type[CertificateException]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.e], instanceof, type[SSLPeerUnverifiedException]]] begin[{] return[literal[false]] else begin[{] None end[}] return[binary_operation[member[.e], instanceof, type[SSLException]]] end[}] END[}]
Keyword[boolean] identifier[connectionFailed] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[isFallback] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isFallbackPossible] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[ProtocolException] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[InterruptedIOException] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[SSLHandshakeException] operator[SEP] { Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] Keyword[instanceof] identifier[CertificateException] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[SSLPeerUnverifiedException] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] identifier[e] Keyword[instanceof] identifier[SSLException] operator[SEP] }
public void setId(int v) { if (Coref_Type.featOkTst && ((Coref_Type)jcasType).casFeat_id == null) jcasType.jcas.throwFeatMissing("id", "de.julielab.jules.types.muc7.Coref"); jcasType.ll_cas.ll_setIntValue(addr, ((Coref_Type)jcasType).casFeatCode_id, v);}
class class_name[name] begin[{] method[setId, return_type[void], modifier[public], parameter[v]] begin[{] if[binary_operation[member[Coref_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Coref_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["id"], literal["de.julielab.jules.types.muc7.Coref"]]] else begin[{] None end[}] call[jcasType.ll_cas.ll_setIntValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Coref_Type, sub_type=None)), member[.v]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setId] operator[SEP] Keyword[int] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[Coref_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[Coref_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_id] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setIntValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[Coref_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_id] , identifier[v] operator[SEP] operator[SEP] }
public static <T> Set<T> toSet(BaseStream<T, ? extends BaseStream> stream) { return StreamSupport.stream( Spliterators.spliteratorUnknownSize(stream.iterator(), Spliterator.ORDERED), false).collect(Collectors.<T>toSet()); }
class class_name[name] begin[{] method[toSet, return_type[type[Set]], modifier[public static], parameter[stream]] begin[{] return[call[StreamSupport.stream, parameter[call[Spliterators.spliteratorUnknownSize, parameter[call[stream.iterator, parameter[]], member[Spliterator.ORDERED]]], literal[false]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Set] operator[<] identifier[T] operator[>] identifier[toSet] operator[SEP] identifier[BaseStream] operator[<] identifier[T] , operator[?] Keyword[extends] identifier[BaseStream] operator[>] identifier[stream] operator[SEP] { Keyword[return] identifier[StreamSupport] operator[SEP] identifier[stream] operator[SEP] identifier[Spliterators] operator[SEP] identifier[spliteratorUnknownSize] operator[SEP] identifier[stream] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] , identifier[Spliterator] operator[SEP] identifier[ORDERED] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] operator[<] identifier[T] operator[>] identifier[toSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void setIpv6Addresses(java.util.Collection<String> ipv6Addresses) { if (ipv6Addresses == null) { this.ipv6Addresses = null; return; } this.ipv6Addresses = new java.util.ArrayList<String>(ipv6Addresses); }
class class_name[name] begin[{] method[setIpv6Addresses, return_type[void], modifier[public], parameter[ipv6Addresses]] begin[{] if[binary_operation[member[.ipv6Addresses], ==, literal[null]]] begin[{] assign[THIS[member[None.ipv6Addresses]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.ipv6Addresses]], ClassCreator(arguments=[MemberReference(member=ipv6Addresses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setIpv6Addresses] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[ipv6Addresses] operator[SEP] { Keyword[if] operator[SEP] identifier[ipv6Addresses] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[ipv6Addresses] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[ipv6Addresses] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[ipv6Addresses] operator[SEP] operator[SEP] }
private void encodeIcon(final FacesContext context, final SlideOut slideOut) throws IOException { if (slideOut.getIcon() == null) { return; } // fontawesome icons are OK but themeroller we need to add styles String icon = slideOut.getIcon().trim(); if (icon.startsWith("ui")) { icon = "ui-icon " + icon + " ui-slideouttab-icon"; } // <i class="ui-icon fa fa-television"></i> final ResponseWriter writer = context.getResponseWriter(); writer.startElement("span", null); writer.writeAttribute("class", icon, null); writer.endElement("span"); writer.write(" "); }
class class_name[name] begin[{] method[encodeIcon, return_type[void], modifier[private], parameter[context, slideOut]] begin[{] if[binary_operation[call[slideOut.getIcon, parameter[]], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[String], icon] if[call[icon.startsWith, parameter[literal["ui"]]]] begin[{] assign[member[.icon], binary_operation[binary_operation[literal["ui-icon "], +, member[.icon]], +, literal[" ui-slideouttab-icon"]]] else begin[{] None end[}] local_variable[type[ResponseWriter], writer] call[writer.startElement, parameter[literal["span"], literal[null]]] call[writer.writeAttribute, parameter[literal["class"], member[.icon], literal[null]]] call[writer.endElement, parameter[literal["span"]]] call[writer.write, parameter[literal[" "]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[encodeIcon] operator[SEP] Keyword[final] identifier[FacesContext] identifier[context] , Keyword[final] identifier[SlideOut] identifier[slideOut] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[slideOut] operator[SEP] identifier[getIcon] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[String] identifier[icon] operator[=] identifier[slideOut] operator[SEP] identifier[getIcon] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[icon] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[icon] operator[=] literal[String] operator[+] identifier[icon] operator[+] literal[String] operator[SEP] } Keyword[final] identifier[ResponseWriter] identifier[writer] operator[=] identifier[context] operator[SEP] identifier[getResponseWriter] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[startElement] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[icon] , Other[null] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[endElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] }
private void scheduleTasksCleanupForWorker(final String worker, final List<String> tasksToFail) { // This method is only called from the PathChildrenCache event handler, so this may look like a race, // but is actually not. cancelWorkerCleanup(worker); final ListenableScheduledFuture<?> cleanupTask = cleanupExec.schedule( new Runnable() { @Override public void run() { log.info("Running scheduled cleanup for Worker[%s]", worker); try { for (String assignedTask : tasksToFail) { String taskPath = JOINER.join(indexerZkConfig.getTasksPath(), worker, assignedTask); String statusPath = JOINER.join(indexerZkConfig.getStatusPath(), worker, assignedTask); if (cf.checkExists().forPath(taskPath) != null) { cf.delete().guaranteed().forPath(taskPath); } if (cf.checkExists().forPath(statusPath) != null) { cf.delete().guaranteed().forPath(statusPath); } log.info("Failing task[%s]", assignedTask); RemoteTaskRunnerWorkItem taskRunnerWorkItem = runningTasks.remove(assignedTask); if (taskRunnerWorkItem != null) { taskRunnerWorkItem.setResult(TaskStatus.failure(assignedTask)); TaskRunnerUtils.notifyStatusChanged(listeners, assignedTask, TaskStatus.failure(assignedTask)); } else { log.warn("RemoteTaskRunner has no knowledge of task[%s]", assignedTask); } } // worker is gone, remove worker task status announcements path. String workerStatusPath = JOINER.join(indexerZkConfig.getStatusPath(), worker); if (cf.checkExists().forPath(workerStatusPath) != null) { cf.delete().guaranteed().forPath(JOINER.join(indexerZkConfig.getStatusPath(), worker)); } } catch (Exception e) { log.makeAlert("Exception while cleaning up worker[%s]", worker).emit(); throw new RuntimeException(e); } } }, config.getTaskCleanupTimeout().toStandardDuration().getMillis(), TimeUnit.MILLISECONDS ); removedWorkerCleanups.put(worker, cleanupTask); // Remove this entry from removedWorkerCleanups when done, if it's actually the one in there. Futures.addCallback( cleanupTask, new FutureCallback<Object>() { @Override public void onSuccess(Object result) { removedWorkerCleanups.remove(worker, cleanupTask); } @Override public void onFailure(Throwable t) { removedWorkerCleanups.remove(worker, cleanupTask); } } ); }
class class_name[name] begin[{] method[scheduleTasksCleanupForWorker, return_type[void], modifier[private], parameter[worker, tasksToFail]] begin[{] call[.cancelWorkerCleanup, parameter[member[.worker]]] local_variable[type[ListenableScheduledFuture], cleanupTask] call[removedWorkerCleanups.put, parameter[member[.worker], member[.cleanupTask]]] call[Futures.addCallback, parameter[member[.cleanupTask], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=worker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cleanupTask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=removedWorkerCleanups, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=result, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=worker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cleanupTask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=removedWorkerCleanups, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=FutureCallback, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[scheduleTasksCleanupForWorker] operator[SEP] Keyword[final] identifier[String] identifier[worker] , Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[tasksToFail] operator[SEP] { identifier[cancelWorkerCleanup] operator[SEP] identifier[worker] operator[SEP] operator[SEP] Keyword[final] identifier[ListenableScheduledFuture] operator[<] operator[?] operator[>] identifier[cleanupTask] operator[=] identifier[cleanupExec] operator[SEP] identifier[schedule] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[worker] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[String] identifier[assignedTask] operator[:] identifier[tasksToFail] operator[SEP] { identifier[String] identifier[taskPath] operator[=] identifier[JOINER] operator[SEP] identifier[join] operator[SEP] identifier[indexerZkConfig] operator[SEP] identifier[getTasksPath] operator[SEP] operator[SEP] , identifier[worker] , identifier[assignedTask] operator[SEP] operator[SEP] identifier[String] identifier[statusPath] operator[=] identifier[JOINER] operator[SEP] identifier[join] operator[SEP] identifier[indexerZkConfig] operator[SEP] identifier[getStatusPath] operator[SEP] operator[SEP] , identifier[worker] , identifier[assignedTask] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cf] operator[SEP] identifier[checkExists] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] identifier[taskPath] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[cf] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] identifier[guaranteed] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] identifier[taskPath] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cf] operator[SEP] identifier[checkExists] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] identifier[statusPath] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[cf] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] identifier[guaranteed] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] identifier[statusPath] operator[SEP] operator[SEP] } identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[assignedTask] operator[SEP] operator[SEP] identifier[RemoteTaskRunnerWorkItem] identifier[taskRunnerWorkItem] operator[=] identifier[runningTasks] operator[SEP] identifier[remove] operator[SEP] identifier[assignedTask] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[taskRunnerWorkItem] operator[!=] Other[null] operator[SEP] { identifier[taskRunnerWorkItem] operator[SEP] identifier[setResult] operator[SEP] identifier[TaskStatus] operator[SEP] identifier[failure] operator[SEP] identifier[assignedTask] operator[SEP] operator[SEP] operator[SEP] identifier[TaskRunnerUtils] operator[SEP] identifier[notifyStatusChanged] operator[SEP] identifier[listeners] , identifier[assignedTask] , identifier[TaskStatus] operator[SEP] identifier[failure] operator[SEP] identifier[assignedTask] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[assignedTask] operator[SEP] operator[SEP] } } identifier[String] identifier[workerStatusPath] operator[=] identifier[JOINER] operator[SEP] identifier[join] operator[SEP] identifier[indexerZkConfig] operator[SEP] identifier[getStatusPath] operator[SEP] operator[SEP] , identifier[worker] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cf] operator[SEP] identifier[checkExists] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] identifier[workerStatusPath] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[cf] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] identifier[guaranteed] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] identifier[JOINER] operator[SEP] identifier[join] operator[SEP] identifier[indexerZkConfig] operator[SEP] identifier[getStatusPath] operator[SEP] operator[SEP] , identifier[worker] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[makeAlert] operator[SEP] literal[String] , identifier[worker] operator[SEP] operator[SEP] identifier[emit] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } } , identifier[config] operator[SEP] identifier[getTaskCleanupTimeout] operator[SEP] operator[SEP] operator[SEP] identifier[toStandardDuration] operator[SEP] operator[SEP] operator[SEP] identifier[getMillis] operator[SEP] operator[SEP] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] identifier[removedWorkerCleanups] operator[SEP] identifier[put] operator[SEP] identifier[worker] , identifier[cleanupTask] operator[SEP] operator[SEP] identifier[Futures] operator[SEP] identifier[addCallback] operator[SEP] identifier[cleanupTask] , Keyword[new] identifier[FutureCallback] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[result] operator[SEP] { identifier[removedWorkerCleanups] operator[SEP] identifier[remove] operator[SEP] identifier[worker] , identifier[cleanupTask] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[removedWorkerCleanups] operator[SEP] identifier[remove] operator[SEP] identifier[worker] , identifier[cleanupTask] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public static <T extends Enum<T>> Collector<T, ?, EnumSet<T>> toEnumSet(Class<T> enumClass) { int size = EnumSet.allOf(enumClass).size(); return new CancellableCollectorImpl<>(() -> EnumSet.noneOf(enumClass), EnumSet::add, (s1, s2) -> { s1.addAll(s2); return s1; }, Function.identity(), set -> set.size() == size, UNORDERED_ID_CHARACTERISTICS); }
class class_name[name] begin[{] method[toEnumSet, return_type[type[Collector]], modifier[public static], parameter[enumClass]] begin[{] local_variable[type[int], size] return[ClassCreator(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=enumClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=noneOf, postfix_operators=[], prefix_operators=[], qualifier=EnumSet, selectors=[], type_arguments=None), parameters=[]), MethodReference(expression=MemberReference(member=EnumSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=s1, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=s1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], parameters=[InferredFormalParameter(name=s1), InferredFormalParameter(name=s2)]), MethodInvocation(arguments=[], member=identity, postfix_operators=[], prefix_operators=[], qualifier=Function, selectors=[], type_arguments=None), LambdaExpression(body=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[], type_arguments=None), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), parameters=[MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), MemberReference(member=UNORDERED_ID_CHARACTERISTICS, 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=CancellableCollectorImpl, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Enum] operator[<] identifier[T] operator[>] operator[>] identifier[Collector] operator[<] identifier[T] , operator[?] , identifier[EnumSet] operator[<] identifier[T] operator[>] operator[>] identifier[toEnumSet] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[enumClass] operator[SEP] { Keyword[int] identifier[size] operator[=] identifier[EnumSet] operator[SEP] identifier[allOf] operator[SEP] identifier[enumClass] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CancellableCollectorImpl] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[EnumSet] operator[SEP] identifier[noneOf] operator[SEP] identifier[enumClass] operator[SEP] , identifier[EnumSet] operator[::] identifier[add] , operator[SEP] identifier[s1] , identifier[s2] operator[SEP] operator[->] { identifier[s1] operator[SEP] identifier[addAll] operator[SEP] identifier[s2] operator[SEP] operator[SEP] Keyword[return] identifier[s1] operator[SEP] } , identifier[Function] operator[SEP] identifier[identity] operator[SEP] operator[SEP] , identifier[set] operator[->] identifier[set] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[size] , identifier[UNORDERED_ID_CHARACTERISTICS] operator[SEP] operator[SEP] }
@BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Cluster, ClusterOperationMetadata> updateClusterAsync( UpdateClusterRequest request) { return updateClusterOperationCallable().futureCall(request); }
class class_name[name] begin[{] method[updateClusterAsync, return_type[type[OperationFuture]], modifier[final public], parameter[request]] begin[{] return[call[.updateClusterOperationCallable, parameter[]]] end[}] END[}]
annotation[@] identifier[BetaApi] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[final] identifier[OperationFuture] operator[<] identifier[Cluster] , identifier[ClusterOperationMetadata] operator[>] identifier[updateClusterAsync] operator[SEP] identifier[UpdateClusterRequest] identifier[request] operator[SEP] { Keyword[return] identifier[updateClusterOperationCallable] operator[SEP] operator[SEP] operator[SEP] identifier[futureCall] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
private boolean classImplementsOrExtends(final Class<?> is, final Class<?> should) { if (is.equals(should)) { return true; } for (final Class<?> clazz : is.getInterfaces()) { if (classImplementsOrExtends(clazz, should)) { return true; } } final Class<?> superClass = is.getSuperclass(); if (superClass != null && !superClass.equals(Object.class)) { return classImplementsOrExtends(superClass, should); } return false; }
class class_name[name] begin[{] method[classImplementsOrExtends, return_type[type[boolean]], modifier[private], parameter[is, should]] begin[{] if[call[is.equals, parameter[member[.should]]]] begin[{] return[literal[true]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=should, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=classImplementsOrExtends, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getInterfaces, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=clazz)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) local_variable[type[Class], superClass] if[binary_operation[binary_operation[member[.superClass], !=, literal[null]], &&, call[superClass.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]]] begin[{] return[call[.classImplementsOrExtends, parameter[member[.superClass], member[.should]]]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[classImplementsOrExtends] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[is] , Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[should] operator[SEP] { Keyword[if] operator[SEP] identifier[is] operator[SEP] identifier[equals] operator[SEP] identifier[should] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[:] identifier[is] operator[SEP] identifier[getInterfaces] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[classImplementsOrExtends] operator[SEP] identifier[clazz] , identifier[should] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[superClass] operator[=] identifier[is] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[superClass] operator[!=] Other[null] operator[&&] operator[!] identifier[superClass] operator[SEP] identifier[equals] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[return] identifier[classImplementsOrExtends] operator[SEP] identifier[superClass] , identifier[should] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
static String htmlEncodeRequestName(String requestId, String requestName) { if (requestId.startsWith(Counter.SQL_COUNTER_NAME)) { final String htmlEncoded = htmlEncodeButNotSpace(requestName); // highlight SQL keywords return SQL_KEYWORDS_PATTERN.matcher(htmlEncoded) .replaceAll("<span class='sqlKeyword'>$1</span>"); } return htmlEncodeButNotSpace(requestName); }
class class_name[name] begin[{] method[htmlEncodeRequestName, return_type[type[String]], modifier[static], parameter[requestId, requestName]] begin[{] if[call[requestId.startsWith, parameter[member[Counter.SQL_COUNTER_NAME]]]] begin[{] local_variable[type[String], htmlEncoded] return[call[SQL_KEYWORDS_PATTERN.matcher, parameter[member[.htmlEncoded]]]] else begin[{] None end[}] return[call[.htmlEncodeButNotSpace, parameter[member[.requestName]]]] end[}] END[}]
Keyword[static] identifier[String] identifier[htmlEncodeRequestName] operator[SEP] identifier[String] identifier[requestId] , identifier[String] identifier[requestName] operator[SEP] { Keyword[if] operator[SEP] identifier[requestId] operator[SEP] identifier[startsWith] operator[SEP] identifier[Counter] operator[SEP] identifier[SQL_COUNTER_NAME] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[htmlEncoded] operator[=] identifier[htmlEncodeButNotSpace] operator[SEP] identifier[requestName] operator[SEP] operator[SEP] Keyword[return] identifier[SQL_KEYWORDS_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[htmlEncoded] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[htmlEncodeButNotSpace] operator[SEP] identifier[requestName] operator[SEP] operator[SEP] }
public static GraphicInfo createGraphic(MarkInfo mark, int size) { GraphicInfo graphicInfo = new GraphicInfo(); ChoiceInfo choice = new ChoiceInfo(); choice.setMark(mark); graphicInfo.getChoiceList().add(choice); SizeInfo sizeInfo = new SizeInfo(); sizeInfo.setValue(Integer.toString(size)); graphicInfo.setSize(sizeInfo); return graphicInfo; }
class class_name[name] begin[{] method[createGraphic, return_type[type[GraphicInfo]], modifier[public static], parameter[mark, size]] begin[{] local_variable[type[GraphicInfo], graphicInfo] local_variable[type[ChoiceInfo], choice] call[choice.setMark, parameter[member[.mark]]] call[graphicInfo.getChoiceList, parameter[]] local_variable[type[SizeInfo], sizeInfo] call[sizeInfo.setValue, parameter[call[Integer.toString, parameter[member[.size]]]]] call[graphicInfo.setSize, parameter[member[.sizeInfo]]] return[member[.graphicInfo]] end[}] END[}]
Keyword[public] Keyword[static] identifier[GraphicInfo] identifier[createGraphic] operator[SEP] identifier[MarkInfo] identifier[mark] , Keyword[int] identifier[size] operator[SEP] { identifier[GraphicInfo] identifier[graphicInfo] operator[=] Keyword[new] identifier[GraphicInfo] operator[SEP] operator[SEP] operator[SEP] identifier[ChoiceInfo] identifier[choice] operator[=] Keyword[new] identifier[ChoiceInfo] operator[SEP] operator[SEP] operator[SEP] identifier[choice] operator[SEP] identifier[setMark] operator[SEP] identifier[mark] operator[SEP] operator[SEP] identifier[graphicInfo] operator[SEP] identifier[getChoiceList] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[choice] operator[SEP] operator[SEP] identifier[SizeInfo] identifier[sizeInfo] operator[=] Keyword[new] identifier[SizeInfo] operator[SEP] operator[SEP] operator[SEP] identifier[sizeInfo] operator[SEP] identifier[setValue] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[graphicInfo] operator[SEP] identifier[setSize] operator[SEP] identifier[sizeInfo] operator[SEP] operator[SEP] Keyword[return] identifier[graphicInfo] operator[SEP] }
public void deregisterAsynchConsumerCallback() throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException, SIErrorException, SIIncorrectCallException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "deregisterAsynchConsumerCallback"); _deregisterAsynchConsumerCallback(false); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "deregisterAsynchConsumerCallback"); }
class class_name[name] begin[{] method[deregisterAsynchConsumerCallback, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["deregisterAsynchConsumerCallback"]]] else begin[{] None end[}] call[._deregisterAsynchConsumerCallback, parameter[literal[false]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["deregisterAsynchConsumerCallback"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[deregisterAsynchConsumerCallback] operator[SEP] operator[SEP] Keyword[throws] identifier[SISessionUnavailableException] , identifier[SISessionDroppedException] , identifier[SIConnectionUnavailableException] , identifier[SIConnectionDroppedException] , identifier[SIErrorException] , identifier[SIIncorrectCallException] { 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] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[_deregisterAsynchConsumerCallback] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public PreparedStatement getPreparedStatement(Connection con, CmsProject project, String queryKey) throws SQLException { return getPreparedStatement(con, project.getUuid(), queryKey); }
class class_name[name] begin[{] method[getPreparedStatement, return_type[type[PreparedStatement]], modifier[public], parameter[con, project, queryKey]] begin[{] return[call[.getPreparedStatement, parameter[member[.con], call[project.getUuid, parameter[]], member[.queryKey]]]] end[}] END[}]
Keyword[public] identifier[PreparedStatement] identifier[getPreparedStatement] operator[SEP] identifier[Connection] identifier[con] , identifier[CmsProject] identifier[project] , identifier[String] identifier[queryKey] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[return] identifier[getPreparedStatement] operator[SEP] identifier[con] , identifier[project] operator[SEP] identifier[getUuid] operator[SEP] operator[SEP] , identifier[queryKey] operator[SEP] operator[SEP] }
public static ArrayList<MonitorJob> getJobs() { ArrayList<MonitorJob> monitors = new ArrayList<MonitorJob>(); int timeInt = 0; // for Hadoop Log parsing String [] fnames_r = getProperty("log.hadoop.filenames").split(",\\s*"); String tmp = getProperty("log.hadoop.enabled"); String [] fnames = expandDirs(fnames_r, ".*(.log).*"); timeInt = setValue("log.hadoop.interval", DEFAULT_LOG_INTERVAL); if ("true".equalsIgnoreCase(tmp) && fnames[0] != null) for (String fname : fnames) { File f = new File(fname); if (f.exists() && f.canRead()) { monitors.add(new MonitorJob(new HadoopLogParser(fname), "hadoopLog", timeInt)); logInfo("Created Monitor for Hadoop log file: " + f.getAbsolutePath()); } else if (!f.exists()) logInfo("Skipping Hadoop log file " + fname + " (file not found)"); else logInfo("Skipping Hadoop log file " + fname + " (permission denied)"); } // for System Log parsing fnames_r = getProperty("log.system.filenames").split(",\\s*"); tmp = getProperty("log.system.enabled"); fnames = expandDirs(fnames_r, ".*(messages).*"); timeInt = setValue("log.system.interval", DEFAULT_LOG_INTERVAL); if ("true".equalsIgnoreCase(tmp)) for (String fname : fnames) { File f = new File(fname); if (f.exists() && f.canRead()) { monitors.add(new MonitorJob(new SystemLogParser(fname), "systemLog", timeInt)); logInfo("Created Monitor for System log file: " + f.getAbsolutePath()); } else if (!f.exists()) logInfo("Skipping system log file " + fname + " (file not found)"); else logInfo("Skipping system log file " + fname + " (permission denied)"); } // for network interfaces tmp = getProperty("nic.enabled"); timeInt = setValue("nics.interval", DEFAULT_POLL_INTERVAL); if ("true".equalsIgnoreCase(tmp)) { monitors.add(new MonitorJob(new NICParser(), "nics", timeInt)); logInfo("Created Monitor for NICs"); } // for cpu tmp = getProperty("cpu.enabled"); timeInt = setValue("cpu.interval", DEFAULT_POLL_INTERVAL); if ("true".equalsIgnoreCase(tmp)) { monitors.add(new MonitorJob(new CPUParser(), "cpu", timeInt)); logInfo("Created Monitor for CPUs"); } // for disks tmp = getProperty("disks.enabled"); timeInt = setValue("disks.interval", DEFAULT_POLL_INTERVAL); if ("true".equalsIgnoreCase(tmp)) { // check privileges if a disk with no disks./dev/xxx/.source is found boolean smart_present = checkExistence("smartctl"); int disks_ok = 0; String devicesStr = getProperty("disks.list"); String[] devices = null; if (devicesStr != null) devices = devicesStr.split(",\\s*"); for (int i = 0; i< devices.length; i++) { boolean file_present = false; boolean disk_present = false; String fileloc = getProperty("disks." + devices[i] + ".source"); if (fileloc != null && fileloc.equalsIgnoreCase("true")) file_present = true; if (!file_present) if (superuser) { StringBuffer sb = runCommand("sudo smartctl -i " + devices[i]); String patternStr = "[(failed)(device not supported)]"; Pattern pattern = Pattern.compile(patternStr); Matcher matcher = pattern.matcher(sb.toString()); if (matcher.find(0)) disk_present = false; else disk_present = true; } if (file_present || (disk_present && smart_present)) { disks_ok++; } else devices[i] = null; } // now remove disks that dont exist StringBuffer resetSB = new StringBuffer(); for (int j = 0; j < devices.length; j++) { resetSB.append(devices[j] == null ? "" : devices[j] + ", "); if (devices[j] != null) logInfo("Found S.M.A.R.T. attributes for disk " + devices[j]); } // fix the property if (resetSB.length() >= 2) setProperty("disks.list", resetSB.substring(0, resetSB.length() - 2)); if (disks_ok > 0) { monitors.add(new MonitorJob(new SMARTParser(), "disks", timeInt)); logInfo("Created Monitor for S.M.A.R.T disk attributes"); } } // for lm-sensors tmp = getProperty("sensors.enabled"); timeInt = setValue("sensors.interval", DEFAULT_POLL_INTERVAL); if ("true".equalsIgnoreCase(tmp) && checkExistence("sensors")) { monitors.add(new MonitorJob(new SensorsParser(), "sensors", timeInt)); logInfo("Created Monitor for lm-sensors output"); } return monitors; }
class class_name[name] begin[{] method[getJobs, return_type[type[ArrayList]], modifier[public static], parameter[]] begin[{] local_variable[type[ArrayList], monitors] local_variable[type[int], timeInt] local_variable[type[String], fnames_r] local_variable[type[String], tmp] local_variable[type[String], fnames] assign[member[.timeInt], call[.setValue, parameter[literal["log.hadoop.interval"], member[.DEFAULT_LOG_INTERVAL]]]] if[binary_operation[literal["true"], &&, binary_operation[member[.fnames], !=, literal[null]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=fname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=canRead, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=['!'], qualifier=f, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Skipping Hadoop log file "), operandr=MemberReference(member=fname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (permission denied)"), operator=+)], member=logInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Skipping Hadoop log file "), operandr=MemberReference(member=fname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (file not found)"), operator=+)], member=logInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=fname, 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=HadoopLogParser, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="hadoopLog"), MemberReference(member=timeInt, 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=MonitorJob, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=monitors, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Created Monitor for Hadoop log file: "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operator=+)], member=logInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=fnames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] assign[member[.fnames_r], call[.getProperty, parameter[literal["log.system.filenames"]]]] assign[member[.tmp], call[.getProperty, parameter[literal["log.system.enabled"]]]] assign[member[.fnames], call[.expandDirs, parameter[member[.fnames_r], literal[".*(messages).*"]]]] assign[member[.timeInt], call[.setValue, parameter[literal["log.system.interval"], member[.DEFAULT_LOG_INTERVAL]]]] if[literal["true"]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=fname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=canRead, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=['!'], qualifier=f, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Skipping system log file "), operandr=MemberReference(member=fname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (permission denied)"), operator=+)], member=logInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Skipping system log file "), operandr=MemberReference(member=fname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (file not found)"), operator=+)], member=logInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=fname, 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=SystemLogParser, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="systemLog"), MemberReference(member=timeInt, 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=MonitorJob, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=monitors, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Created Monitor for System log file: "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operator=+)], member=logInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=fnames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] assign[member[.tmp], call[.getProperty, parameter[literal["nic.enabled"]]]] assign[member[.timeInt], call[.setValue, parameter[literal["nics.interval"], member[.DEFAULT_POLL_INTERVAL]]]] if[literal["true"]] begin[{] call[monitors.add, parameter[ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NICParser, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="nics"), MemberReference(member=timeInt, 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=MonitorJob, sub_type=None))]] call[.logInfo, parameter[literal["Created Monitor for NICs"]]] else begin[{] None end[}] assign[member[.tmp], call[.getProperty, parameter[literal["cpu.enabled"]]]] assign[member[.timeInt], call[.setValue, parameter[literal["cpu.interval"], member[.DEFAULT_POLL_INTERVAL]]]] if[literal["true"]] begin[{] call[monitors.add, parameter[ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CPUParser, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cpu"), MemberReference(member=timeInt, 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=MonitorJob, sub_type=None))]] call[.logInfo, parameter[literal["Created Monitor for CPUs"]]] else begin[{] None end[}] assign[member[.tmp], call[.getProperty, parameter[literal["disks.enabled"]]]] assign[member[.timeInt], call[.setValue, parameter[literal["disks.interval"], member[.DEFAULT_POLL_INTERVAL]]]] if[literal["true"]] begin[{] local_variable[type[boolean], smart_present] local_variable[type[int], disks_ok] local_variable[type[String], devicesStr] local_variable[type[String], devices] if[binary_operation[member[.devicesStr], !=, literal[null]]] begin[{] assign[member[.devices], call[devicesStr.split, parameter[literal[",\\s*"]]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=file_present)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=disk_present)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="disks."), operandr=MemberReference(member=devices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".source"), operator=+)], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=fileloc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=fileloc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="true")], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=fileloc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=file_present, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)), IfStatement(condition=MemberReference(member=file_present, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=IfStatement(condition=MemberReference(member=superuser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sudo smartctl -i "), operandr=MemberReference(member=devices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=runCommand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuffer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[(failed)(device not supported)]"), name=patternStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=patternStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compile, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None), name=pattern)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pattern, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), name=matcher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=find, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=disk_present, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=disk_present, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None))]))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=file_present, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=disk_present, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=smart_present, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), operator=||), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=devices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=disks_ok, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=devices, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[StringBuffer], resetSB] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=devices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=BinaryOperation(operandl=MemberReference(member=devices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", "), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))], member=append, postfix_operators=[], prefix_operators=[], qualifier=resetSB, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=devices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, 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=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Found S.M.A.R.T. attributes for disk "), operandr=MemberReference(member=devices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=logInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=devices, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[call[resetSB.length, parameter[]], >=, literal[2]]] begin[{] call[.setProperty, parameter[literal["disks.list"], call[resetSB.substring, parameter[literal[0], binary_operation[call[resetSB.length, parameter[]], -, literal[2]]]]]] else begin[{] None end[}] if[binary_operation[member[.disks_ok], >, literal[0]]] begin[{] call[monitors.add, parameter[ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SMARTParser, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="disks"), MemberReference(member=timeInt, 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=MonitorJob, sub_type=None))]] call[.logInfo, parameter[literal["Created Monitor for S.M.A.R.T disk attributes"]]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.tmp], call[.getProperty, parameter[literal["sensors.enabled"]]]] assign[member[.timeInt], call[.setValue, parameter[literal["sensors.interval"], member[.DEFAULT_POLL_INTERVAL]]]] if[binary_operation[literal["true"], &&, call[.checkExistence, parameter[literal["sensors"]]]]] begin[{] call[monitors.add, parameter[ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SensorsParser, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sensors"), MemberReference(member=timeInt, 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=MonitorJob, sub_type=None))]] call[.logInfo, parameter[literal["Created Monitor for lm-sensors output"]]] else begin[{] None end[}] return[member[.monitors]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ArrayList] operator[<] identifier[MonitorJob] operator[>] identifier[getJobs] operator[SEP] operator[SEP] { identifier[ArrayList] operator[<] identifier[MonitorJob] operator[>] identifier[monitors] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[MonitorJob] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[timeInt] operator[=] Other[0] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[fnames_r] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[tmp] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[fnames] operator[=] identifier[expandDirs] operator[SEP] identifier[fnames_r] , literal[String] operator[SEP] operator[SEP] identifier[timeInt] operator[=] identifier[setValue] operator[SEP] literal[String] , identifier[DEFAULT_LOG_INTERVAL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[tmp] operator[SEP] operator[&&] identifier[fnames] operator[SEP] Other[0] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[fname] operator[:] identifier[fnames] operator[SEP] { identifier[File] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[fname] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] identifier[f] operator[SEP] identifier[canRead] operator[SEP] operator[SEP] operator[SEP] { identifier[monitors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[MonitorJob] operator[SEP] Keyword[new] identifier[HadoopLogParser] operator[SEP] identifier[fname] operator[SEP] , literal[String] , identifier[timeInt] operator[SEP] operator[SEP] operator[SEP] identifier[logInfo] operator[SEP] literal[String] operator[+] identifier[f] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] identifier[logInfo] operator[SEP] literal[String] operator[+] identifier[fname] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[else] identifier[logInfo] operator[SEP] literal[String] operator[+] identifier[fname] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[fnames_r] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[tmp] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[fnames] operator[=] identifier[expandDirs] operator[SEP] identifier[fnames_r] , literal[String] operator[SEP] operator[SEP] identifier[timeInt] operator[=] identifier[setValue] operator[SEP] literal[String] , identifier[DEFAULT_LOG_INTERVAL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[fname] operator[:] identifier[fnames] operator[SEP] { identifier[File] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[fname] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] identifier[f] operator[SEP] identifier[canRead] operator[SEP] operator[SEP] operator[SEP] { identifier[monitors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[MonitorJob] operator[SEP] Keyword[new] identifier[SystemLogParser] operator[SEP] identifier[fname] operator[SEP] , literal[String] , identifier[timeInt] operator[SEP] operator[SEP] operator[SEP] identifier[logInfo] operator[SEP] literal[String] operator[+] identifier[f] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] identifier[logInfo] operator[SEP] literal[String] operator[+] identifier[fname] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[else] identifier[logInfo] operator[SEP] literal[String] operator[+] identifier[fname] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[tmp] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[timeInt] operator[=] identifier[setValue] operator[SEP] literal[String] , identifier[DEFAULT_POLL_INTERVAL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] { identifier[monitors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[MonitorJob] operator[SEP] Keyword[new] identifier[NICParser] operator[SEP] operator[SEP] , literal[String] , identifier[timeInt] operator[SEP] operator[SEP] operator[SEP] identifier[logInfo] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[tmp] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[timeInt] operator[=] identifier[setValue] operator[SEP] literal[String] , identifier[DEFAULT_POLL_INTERVAL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] { identifier[monitors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[MonitorJob] operator[SEP] Keyword[new] identifier[CPUParser] operator[SEP] operator[SEP] , literal[String] , identifier[timeInt] operator[SEP] operator[SEP] operator[SEP] identifier[logInfo] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[tmp] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[timeInt] operator[=] identifier[setValue] operator[SEP] literal[String] , identifier[DEFAULT_POLL_INTERVAL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] { Keyword[boolean] identifier[smart_present] operator[=] identifier[checkExistence] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[disks_ok] operator[=] Other[0] operator[SEP] identifier[String] identifier[devicesStr] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[devices] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[devicesStr] operator[!=] Other[null] operator[SEP] identifier[devices] operator[=] identifier[devicesStr] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[devices] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[boolean] identifier[file_present] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[disk_present] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[fileloc] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[+] identifier[devices] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileloc] operator[!=] Other[null] operator[&&] identifier[fileloc] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[file_present] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[file_present] operator[SEP] Keyword[if] operator[SEP] identifier[superuser] operator[SEP] { identifier[StringBuffer] identifier[sb] operator[=] identifier[runCommand] operator[SEP] literal[String] operator[+] identifier[devices] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[patternStr] operator[=] literal[String] operator[SEP] identifier[Pattern] identifier[pattern] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[patternStr] operator[SEP] operator[SEP] identifier[Matcher] identifier[matcher] operator[=] identifier[pattern] operator[SEP] identifier[matcher] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[disk_present] operator[=] literal[boolean] operator[SEP] Keyword[else] identifier[disk_present] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[file_present] operator[||] operator[SEP] identifier[disk_present] operator[&&] identifier[smart_present] operator[SEP] operator[SEP] { identifier[disks_ok] operator[++] operator[SEP] } Keyword[else] identifier[devices] operator[SEP] identifier[i] operator[SEP] operator[=] Other[null] operator[SEP] } identifier[StringBuffer] identifier[resetSB] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[devices] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[resetSB] operator[SEP] identifier[append] operator[SEP] identifier[devices] operator[SEP] identifier[j] operator[SEP] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[devices] operator[SEP] identifier[j] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[devices] operator[SEP] identifier[j] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[logInfo] operator[SEP] literal[String] operator[+] identifier[devices] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[resetSB] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>=] Other[2] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[resetSB] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[resetSB] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[disks_ok] operator[>] Other[0] operator[SEP] { identifier[monitors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[MonitorJob] operator[SEP] Keyword[new] identifier[SMARTParser] operator[SEP] operator[SEP] , literal[String] , identifier[timeInt] operator[SEP] operator[SEP] operator[SEP] identifier[logInfo] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[tmp] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[timeInt] operator[=] identifier[setValue] operator[SEP] literal[String] , identifier[DEFAULT_POLL_INTERVAL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[tmp] operator[SEP] operator[&&] identifier[checkExistence] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[monitors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[MonitorJob] operator[SEP] Keyword[new] identifier[SensorsParser] operator[SEP] operator[SEP] , literal[String] , identifier[timeInt] operator[SEP] operator[SEP] operator[SEP] identifier[logInfo] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[monitors] operator[SEP] }
private void yAxis(Graphics g) { // y-axis g.setColor(Color.BLACK); g.drawLine(X_OFFSET_LEFT, calcY(0), X_OFFSET_LEFT, Y_OFFSET_TOP); // center horizontal line g.setColor(new Color(220, 220, 220)); g.drawLine(X_OFFSET_LEFT, height / 2 + Y_OFFSET_TOP, getWidth(), height / 2 + Y_OFFSET_TOP); g.setColor(Color.BLACK); // y-achsis markers + labels DecimalFormat d = new DecimalFormat("0.00"); double numLabels = Math.min(Math.pow(2, y_resolution), 32); /* * technically, this is numLabels-1, but as we're iterating 0 <= i <= * numLabels, we need the extra label. Also don't draw more than 32 * labels. */ for (int i = 0; i <= numLabels; i++) { double fraction = i / numLabels; double value = fraction * upper_y_value; g.drawString(d.format(value), 1, (int) ((1 - fraction) * height) + Y_OFFSET_TOP + 5); g.drawLine(X_OFFSET_LEFT - 5, (int) ((1 - fraction) * height) + Y_OFFSET_TOP, X_OFFSET_LEFT, (int) ((1 - fraction) * height) + Y_OFFSET_TOP); } }
class class_name[name] begin[{] method[yAxis, return_type[void], modifier[private], parameter[g]] begin[{] call[g.setColor, parameter[member[Color.BLACK]]] call[g.drawLine, parameter[member[.X_OFFSET_LEFT], call[.calcY, parameter[literal[0]]], member[.X_OFFSET_LEFT], member[.Y_OFFSET_TOP]]] call[g.setColor, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=220), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=220), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=220)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Color, sub_type=None))]] call[g.drawLine, parameter[member[.X_OFFSET_LEFT], binary_operation[binary_operation[member[.height], /, literal[2]], +, member[.Y_OFFSET_TOP]], call[.getWidth, parameter[]], binary_operation[binary_operation[member[.height], /, literal[2]], +, member[.Y_OFFSET_TOP]]]] call[g.setColor, parameter[member[Color.BLACK]]] local_variable[type[DecimalFormat], d] local_variable[type[double], numLabels] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numLabels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), name=fraction)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=fraction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=upper_y_value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=fraction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), type=BasicType(dimensions=[], name=int)), operandr=MemberReference(member=Y_OFFSET_TOP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator=+)], member=drawString, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=X_OFFSET_LEFT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator=-), BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=fraction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), type=BasicType(dimensions=[], name=int)), operandr=MemberReference(member=Y_OFFSET_TOP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=X_OFFSET_LEFT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=fraction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), type=BasicType(dimensions=[], name=int)), operandr=MemberReference(member=Y_OFFSET_TOP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=drawLine, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numLabels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[yAxis] operator[SEP] identifier[Graphics] identifier[g] operator[SEP] { identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[Color] operator[SEP] identifier[BLACK] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] identifier[X_OFFSET_LEFT] , identifier[calcY] operator[SEP] Other[0] operator[SEP] , identifier[X_OFFSET_LEFT] , identifier[Y_OFFSET_TOP] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] Keyword[new] identifier[Color] operator[SEP] Other[220] , Other[220] , Other[220] operator[SEP] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] identifier[X_OFFSET_LEFT] , identifier[height] operator[/] Other[2] operator[+] identifier[Y_OFFSET_TOP] , identifier[getWidth] operator[SEP] operator[SEP] , identifier[height] operator[/] Other[2] operator[+] identifier[Y_OFFSET_TOP] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[Color] operator[SEP] identifier[BLACK] operator[SEP] operator[SEP] identifier[DecimalFormat] identifier[d] operator[=] Keyword[new] identifier[DecimalFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[double] identifier[numLabels] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] Other[2] , identifier[y_resolution] operator[SEP] , Other[32] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<=] identifier[numLabels] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[double] identifier[fraction] operator[=] identifier[i] operator[/] identifier[numLabels] operator[SEP] Keyword[double] identifier[value] operator[=] identifier[fraction] operator[*] identifier[upper_y_value] operator[SEP] identifier[g] operator[SEP] identifier[drawString] operator[SEP] identifier[d] operator[SEP] identifier[format] operator[SEP] identifier[value] operator[SEP] , Other[1] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] Other[1] operator[-] identifier[fraction] operator[SEP] operator[*] identifier[height] operator[SEP] operator[+] identifier[Y_OFFSET_TOP] operator[+] Other[5] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] identifier[X_OFFSET_LEFT] operator[-] Other[5] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] Other[1] operator[-] identifier[fraction] operator[SEP] operator[*] identifier[height] operator[SEP] operator[+] identifier[Y_OFFSET_TOP] , identifier[X_OFFSET_LEFT] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] Other[1] operator[-] identifier[fraction] operator[SEP] operator[*] identifier[height] operator[SEP] operator[+] identifier[Y_OFFSET_TOP] operator[SEP] operator[SEP] } }
public Observable<Page<AssetInner>> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<AssetInner>>, Page<AssetInner>>() { @Override public Page<AssetInner> call(ServiceResponse<Page<AssetInner>> response) { return response.body(); } }); }
class class_name[name] begin[{] method[listNextAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink]] begin[{] return[call[.listNextWithServiceResponseAsync, parameter[member[.nextPageLink]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[AssetInner] operator[>] operator[>] identifier[listNextAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[listNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[AssetInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[AssetInner] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[AssetInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[AssetInner] operator[>] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
@CheckReturnValue public static <ReqT, RespT> Builder<ReqT, RespT> newBuilder() { return newBuilder(null, null); }
class class_name[name] begin[{] method[newBuilder, return_type[type[Builder]], modifier[public static], parameter[]] begin[{] return[call[.newBuilder, parameter[literal[null], literal[null]]]] end[}] END[}]
annotation[@] identifier[CheckReturnValue] Keyword[public] Keyword[static] operator[<] identifier[ReqT] , identifier[RespT] operator[>] identifier[Builder] operator[<] identifier[ReqT] , identifier[RespT] operator[>] identifier[newBuilder] operator[SEP] operator[SEP] { Keyword[return] identifier[newBuilder] operator[SEP] Other[null] , Other[null] operator[SEP] operator[SEP] }
public java.util.List<VolumeStatusAction> getActions() { if (actions == null) { actions = new com.amazonaws.internal.SdkInternalList<VolumeStatusAction>(); } return actions; }
class class_name[name] begin[{] method[getActions, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.actions], ==, literal[null]]] begin[{] assign[member[.actions], 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=VolumeStatusAction, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.actions]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[VolumeStatusAction] operator[>] identifier[getActions] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[actions] operator[==] Other[null] operator[SEP] { identifier[actions] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[VolumeStatusAction] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[actions] operator[SEP] }
public ArrayList<Integer> trackerTiers() { int_vector v = p.get_tracker_tiers(); int size = (int) v.size(); ArrayList<Integer> l = new ArrayList<>(); for (int i = 0; i < size; i++) { l.add(v.get(i)); } return l; }
class class_name[name] begin[{] method[trackerTiers, return_type[type[ArrayList]], modifier[public], parameter[]] begin[{] local_variable[type[int_vector], v] local_variable[type[int], size] local_variable[type[ArrayList], l] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.l]] end[}] END[}]
Keyword[public] identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[trackerTiers] operator[SEP] operator[SEP] { identifier[int_vector] identifier[v] operator[=] identifier[p] operator[SEP] identifier[get_tracker_tiers] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[v] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[l] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[l] operator[SEP] identifier[add] operator[SEP] identifier[v] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[l] operator[SEP] }
public static void write2File(String filePath, byte[] byteData) { try { BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File(filePath))); bufferedOutputStream.write(byteData); bufferedOutputStream.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
class class_name[name] begin[{] method[write2File, return_type[void], modifier[public static], parameter[filePath, byteData]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=filePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedOutputStream, sub_type=None)), name=bufferedOutputStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedOutputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=byteData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=bufferedOutputStream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=bufferedOutputStream, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[write2File] operator[SEP] identifier[String] identifier[filePath] , Keyword[byte] operator[SEP] operator[SEP] identifier[byteData] operator[SEP] { Keyword[try] { identifier[BufferedOutputStream] identifier[bufferedOutputStream] operator[=] Keyword[new] identifier[BufferedOutputStream] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[filePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bufferedOutputStream] operator[SEP] identifier[write] operator[SEP] identifier[byteData] operator[SEP] operator[SEP] identifier[bufferedOutputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } }
public static InfoPopup infoBelow (String message, Widget target) { return info(message, Position.BELOW, target); }
class class_name[name] begin[{] method[infoBelow, return_type[type[InfoPopup]], modifier[public static], parameter[message, target]] begin[{] return[call[.info, parameter[member[.message], member[Position.BELOW], member[.target]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[InfoPopup] identifier[infoBelow] operator[SEP] identifier[String] identifier[message] , identifier[Widget] identifier[target] operator[SEP] { Keyword[return] identifier[info] operator[SEP] identifier[message] , identifier[Position] operator[SEP] identifier[BELOW] , identifier[target] operator[SEP] operator[SEP] }
public static <R> Stream<R> zip(final short[] a, final short[] b, final short valueForNoneA, final short valueForNoneB, final ShortBiFunction<R> zipFunction) { return zip(ShortIteratorEx.of(a), ShortIteratorEx.of(b), valueForNoneA, valueForNoneB, zipFunction); }
class class_name[name] begin[{] method[zip, return_type[type[Stream]], modifier[public static], parameter[a, b, valueForNoneA, valueForNoneB, zipFunction]] begin[{] return[call[.zip, parameter[call[ShortIteratorEx.of, parameter[member[.a]]], call[ShortIteratorEx.of, parameter[member[.b]]], member[.valueForNoneA], member[.valueForNoneB], member[.zipFunction]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[R] operator[>] identifier[Stream] operator[<] identifier[R] operator[>] identifier[zip] operator[SEP] Keyword[final] Keyword[short] operator[SEP] operator[SEP] identifier[a] , Keyword[final] Keyword[short] operator[SEP] operator[SEP] identifier[b] , Keyword[final] Keyword[short] identifier[valueForNoneA] , Keyword[final] Keyword[short] identifier[valueForNoneB] , Keyword[final] identifier[ShortBiFunction] operator[<] identifier[R] operator[>] identifier[zipFunction] operator[SEP] { Keyword[return] identifier[zip] operator[SEP] identifier[ShortIteratorEx] operator[SEP] identifier[of] operator[SEP] identifier[a] operator[SEP] , identifier[ShortIteratorEx] operator[SEP] identifier[of] operator[SEP] identifier[b] operator[SEP] , identifier[valueForNoneA] , identifier[valueForNoneB] , identifier[zipFunction] operator[SEP] operator[SEP] }
public static <T, X extends RuntimeException> T ifNonNullThrowOrElse(Supplier<X> exceptionSupplier, Supplier<T> provider) { if (Objects.nonNull(exceptionSupplier)) { throw exceptionSupplier.get(); } else { return provider.get(); } }
class class_name[name] begin[{] method[ifNonNullThrowOrElse, return_type[type[T]], modifier[public static], parameter[exceptionSupplier, provider]] begin[{] if[call[Objects.nonNull, parameter[member[.exceptionSupplier]]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=exceptionSupplier, selectors=[], type_arguments=None), label=None) else begin[{] return[call[provider.get, parameter[]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[X] Keyword[extends] identifier[RuntimeException] operator[>] identifier[T] identifier[ifNonNullThrowOrElse] operator[SEP] identifier[Supplier] operator[<] identifier[X] operator[>] identifier[exceptionSupplier] , identifier[Supplier] operator[<] identifier[T] operator[>] identifier[provider] operator[SEP] { Keyword[if] operator[SEP] identifier[Objects] operator[SEP] identifier[nonNull] operator[SEP] identifier[exceptionSupplier] operator[SEP] operator[SEP] { Keyword[throw] identifier[exceptionSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[provider] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } }
private void parseFile() { try { try ( BufferedReader fp = new BufferedReader(new InputStreamReader(new FileInputStream(iniFile), Charset.forName("UTF-8"))); ) { boolean done = false; while(!done) { String thisLine = fp.readLine(); if(thisLine != null && thisLine.trim().length() == 0) thisLine = null; if(thisLine != null) { if(Debug) System.out.println("Read: \"" + thisLine + "\""); if(thisLine.startsWith(";") || thisLine.equalsIgnoreCase("")) { // Do nothing, it's a comment if(Debug) System.out.println("Ignoring comment or blank line..."); } else { int cindx = thisLine.indexOf(";"); if(cindx > 0) thisLine = thisLine.substring(0, cindx).trim(); if(Debug) System.out.println("Comments removed: \"" + thisLine + "\""); if(thisLine.startsWith("[") && thisLine.endsWith("]")) { String sname = thisLine.substring(1, thisLine.length() - 1).trim(); if(Debug) System.out.println("Found Section Name: " + sname); if(sectionNames == null) sectionNames = new Vector(); sectionNames.add(sname); if(sectionProperties == null) sectionProperties = new Vector(); sectionProperties.add(new Vector()); } else if(sectionNames != null && sectionProperties != null) { int eqidx = thisLine.indexOf("="); if(eqidx != -1) { String pair[] = new String[2]; pair[0] = thisLine.substring(0, eqidx).trim(); pair[1] = thisLine.substring(eqidx + 1, thisLine.length()).trim(); if(Debug) System.out.println("pair[0]: \"" + pair[0] + "\" pair[1]: \"" + pair[1] + "\""); // Add the pair to the current property list, which is the // last element in the sectionProperties vector. ((Vector) sectionProperties.lastElement()).add(pair); } } } } else { done = true; } } } } catch (FileNotFoundException e) { System.err.println("Could Not Find ini File: \"" + iniFile + "\""); } catch (IOException e) { System.err.println("Could Not Read ini File: \"" + iniFile + "\""); } }
class class_name[name] begin[{] method[parseFile, return_type[void], modifier[private], parameter[]] begin[{] TryStatement(block=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=done)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=fp, selectors=[], type_arguments=None), name=thisLine)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=thisLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[MethodInvocation(arguments=[], member=length, 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=0), operator===), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=thisLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=thisLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=done, 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=[IfStatement(condition=MemberReference(member=Debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Read: \""), operandr=MemberReference(member=thisLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=";")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[], type_arguments=None), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=";")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[], type_arguments=None), name=cindx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cindx, 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=StatementExpression(expression=Assignment(expressionl=MemberReference(member=thisLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=cindx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)), IfStatement(condition=MemberReference(member=Debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Comments removed: \""), operandr=MemberReference(member=thisLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=sectionNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=sectionProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[], type_arguments=None), name=eqidx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=eqidx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=pair)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=eqidx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=eqidx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=Debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pair[0]: \""), operandr=MemberReference(member=pair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" pair[1]: \""), operator=+), operandr=MemberReference(member=pair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Cast(expression=MethodInvocation(arguments=[], member=lastElement, postfix_operators=[], prefix_operators=[], qualifier=sectionProperties, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Vector, sub_type=None)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=thisLine, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=sname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MemberReference(member=Debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Found Section Name: "), operandr=MemberReference(member=sname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sectionNames, 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=StatementExpression(expression=Assignment(expressionl=MemberReference(member=sectionNames, 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=Vector, sub_type=None))), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=sectionNames, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sectionProperties, 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=StatementExpression(expression=Assignment(expressionl=MemberReference(member=sectionProperties, 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=Vector, sub_type=None))), label=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Vector, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=sectionProperties, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=Debug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Ignoring comment or blank line...")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None))]))]))]), condition=MemberReference(member=done, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=fp, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=iniFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None)), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Charset, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could Not Find ini File: \""), operandr=MemberReference(member=iniFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could Not Read ini File: \""), operandr=MemberReference(member=iniFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\""), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[parseFile] operator[SEP] operator[SEP] { Keyword[try] { Keyword[try] operator[SEP] identifier[BufferedReader] identifier[fp] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[iniFile] operator[SEP] , identifier[Charset] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[done] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[done] operator[SEP] { identifier[String] identifier[thisLine] operator[=] identifier[fp] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[thisLine] operator[!=] Other[null] operator[&&] identifier[thisLine] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] identifier[thisLine] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[thisLine] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[Debug] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[thisLine] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[thisLine] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[thisLine] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[Debug] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] identifier[cindx] operator[=] identifier[thisLine] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cindx] operator[>] Other[0] operator[SEP] identifier[thisLine] operator[=] identifier[thisLine] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[cindx] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Debug] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[thisLine] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[thisLine] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[thisLine] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[sname] operator[=] identifier[thisLine] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[thisLine] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Debug] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[sname] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sectionNames] operator[==] Other[null] operator[SEP] identifier[sectionNames] operator[=] Keyword[new] identifier[Vector] operator[SEP] operator[SEP] operator[SEP] identifier[sectionNames] operator[SEP] identifier[add] operator[SEP] identifier[sname] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sectionProperties] operator[==] Other[null] operator[SEP] identifier[sectionProperties] operator[=] Keyword[new] identifier[Vector] operator[SEP] operator[SEP] operator[SEP] identifier[sectionProperties] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Vector] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[sectionNames] operator[!=] Other[null] operator[&&] identifier[sectionProperties] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[eqidx] operator[=] identifier[thisLine] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eqidx] operator[!=] operator[-] Other[1] operator[SEP] { identifier[String] identifier[pair] operator[SEP] operator[SEP] operator[=] Keyword[new] identifier[String] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[pair] operator[SEP] Other[0] operator[SEP] operator[=] identifier[thisLine] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[eqidx] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[pair] operator[SEP] Other[1] operator[SEP] operator[=] identifier[thisLine] operator[SEP] identifier[substring] operator[SEP] identifier[eqidx] operator[+] Other[1] , identifier[thisLine] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Debug] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[pair] operator[SEP] Other[0] operator[SEP] operator[+] literal[String] operator[+] identifier[pair] operator[SEP] Other[1] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Vector] operator[SEP] identifier[sectionProperties] operator[SEP] identifier[lastElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[pair] operator[SEP] operator[SEP] } } } } Keyword[else] { identifier[done] operator[=] literal[boolean] operator[SEP] } } } } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[iniFile] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[iniFile] operator[+] literal[String] operator[SEP] operator[SEP] } }
public static String streamToString(final InputStream stream, final String charset, final BuffersPool buffersPool) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream(); transfer(stream, output, buffersPool); return new String(output.toByteArray(), charset); }
class class_name[name] begin[{] method[streamToString, return_type[type[String]], modifier[public static], parameter[stream, charset, buffersPool]] begin[{] local_variable[type[ByteArrayOutputStream], output] call[.transfer, parameter[member[.stream], member[.output], member[.buffersPool]]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), MemberReference(member=charset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[streamToString] operator[SEP] Keyword[final] identifier[InputStream] identifier[stream] , Keyword[final] identifier[String] identifier[charset] , Keyword[final] identifier[BuffersPool] identifier[buffersPool] operator[SEP] Keyword[throws] identifier[IOException] { identifier[ByteArrayOutputStream] identifier[output] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[transfer] operator[SEP] identifier[stream] , identifier[output] , identifier[buffersPool] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[output] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] , identifier[charset] operator[SEP] operator[SEP] }
public ClassDoc[] allClasses(boolean filter) { List<ClassDocImpl> classes = getClasses(filter); return classes.toArray(new ClassDocImpl[classes.length()]); }
class class_name[name] begin[{] method[allClasses, return_type[type[ClassDoc]], modifier[public], parameter[filter]] begin[{] local_variable[type[List], classes] return[call[classes.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=classes, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassDocImpl, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[ClassDoc] operator[SEP] operator[SEP] identifier[allClasses] operator[SEP] Keyword[boolean] identifier[filter] operator[SEP] { identifier[List] operator[<] identifier[ClassDocImpl] operator[>] identifier[classes] operator[=] identifier[getClasses] operator[SEP] identifier[filter] operator[SEP] operator[SEP] Keyword[return] identifier[classes] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[ClassDocImpl] operator[SEP] identifier[classes] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private boolean validateWindows(Rule rule) { int sumOfExpressionWindows = 0; for (Expression expression : rule.getExpressions()) { long expressionWindow = expression.getWindow().toMillis(); for (Clause clause : expression.getClauses()) { for (DetectionPoint point : clause.getMonitorPoints()) { /* check whether the window of a MonitorPoint * is greater than its parent Expression */ if (expressionWindow < point.getThreshold().getInterval().toMillis()) { return false; } } } sumOfExpressionWindows += expressionWindow; } /* checks whether the sum of expression windows is greater than the rule window */ return rule.getWindow().toMillis() >= sumOfExpressionWindows; }
class class_name[name] begin[{] method[validateWindows, return_type[type[boolean]], modifier[private], parameter[rule]] begin[{] local_variable[type[int], sumOfExpressionWindows] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getWindow, postfix_operators=[], prefix_operators=[], qualifier=expression, selectors=[MethodInvocation(arguments=[], member=toMillis, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=expressionWindow)], modifiers=set(), type=BasicType(dimensions=[], name=long)), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=expressionWindow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getThreshold, postfix_operators=[], prefix_operators=[], qualifier=point, selectors=[MethodInvocation(arguments=[], member=getInterval, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toMillis, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMonitorPoints, postfix_operators=[], prefix_operators=[], qualifier=clause, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=point)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DetectionPoint, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getClauses, postfix_operators=[], prefix_operators=[], qualifier=expression, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=clause)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Clause, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sumOfExpressionWindows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=expressionWindow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getExpressions, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=expression)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Expression, sub_type=None))), label=None) return[binary_operation[call[rule.getWindow, parameter[]], >=, member[.sumOfExpressionWindows]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[validateWindows] operator[SEP] identifier[Rule] identifier[rule] operator[SEP] { Keyword[int] identifier[sumOfExpressionWindows] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Expression] identifier[expression] operator[:] identifier[rule] operator[SEP] identifier[getExpressions] operator[SEP] operator[SEP] operator[SEP] { Keyword[long] identifier[expressionWindow] operator[=] identifier[expression] operator[SEP] identifier[getWindow] operator[SEP] operator[SEP] operator[SEP] identifier[toMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Clause] identifier[clause] operator[:] identifier[expression] operator[SEP] identifier[getClauses] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[DetectionPoint] identifier[point] operator[:] identifier[clause] operator[SEP] identifier[getMonitorPoints] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[expressionWindow] operator[<] identifier[point] operator[SEP] identifier[getThreshold] operator[SEP] operator[SEP] operator[SEP] identifier[getInterval] operator[SEP] operator[SEP] operator[SEP] identifier[toMillis] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } identifier[sumOfExpressionWindows] operator[+=] identifier[expressionWindow] operator[SEP] } Keyword[return] identifier[rule] operator[SEP] identifier[getWindow] operator[SEP] operator[SEP] operator[SEP] identifier[toMillis] operator[SEP] operator[SEP] operator[>=] identifier[sumOfExpressionWindows] operator[SEP] }
public ServiceFuture<ServerCommunicationLinkInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String communicationLinkName, String partnerServer, final ServiceCallback<ServerCommunicationLinkInner> serviceCallback) { return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, communicationLinkName, partnerServer), serviceCallback); }
class class_name[name] begin[{] method[beginCreateOrUpdateAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, serverName, communicationLinkName, partnerServer, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.beginCreateOrUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName], member[.communicationLinkName], member[.partnerServer]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[ServerCommunicationLinkInner] operator[>] identifier[beginCreateOrUpdateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[String] identifier[communicationLinkName] , identifier[String] identifier[partnerServer] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[ServerCommunicationLinkInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[beginCreateOrUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[communicationLinkName] , identifier[partnerServer] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
Rule Font() { return Sequence( FirstOf( Sequence(Alpha(), ZeroOrMore(FirstOf('-', Alphanumeric())), Test(Delimiter())), String() ), push(new SimpleNode(match())) ); }
class class_name[name] begin[{] method[Font, return_type[type[Rule]], modifier[default], parameter[]] begin[{] return[call[.Sequence, parameter[call[.FirstOf, parameter[call[.Sequence, parameter[call[.Alpha, parameter[]], call[.ZeroOrMore, parameter[call[.FirstOf, parameter[literal['-'], call[.Alphanumeric, parameter[]]]]]], call[.Test, parameter[call[.Delimiter, parameter[]]]]]], call[.String, parameter[]]]], call[.push, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=match, 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=SimpleNode, sub_type=None))]]]]] end[}] END[}]
identifier[Rule] identifier[Font] operator[SEP] operator[SEP] { Keyword[return] identifier[Sequence] operator[SEP] identifier[FirstOf] operator[SEP] identifier[Sequence] operator[SEP] identifier[Alpha] operator[SEP] operator[SEP] , identifier[ZeroOrMore] operator[SEP] identifier[FirstOf] operator[SEP] literal[String] , identifier[Alphanumeric] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , identifier[Test] operator[SEP] identifier[Delimiter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , identifier[String] operator[SEP] operator[SEP] operator[SEP] , identifier[push] operator[SEP] Keyword[new] identifier[SimpleNode] operator[SEP] identifier[match] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Nullable private String[] getReplacementCmd(String cmd) { if (mCommandAlias == null || !mCommandAlias.containsKey(cmd)) { return null; } return mCommandAlias.get(cmd); }
class class_name[name] begin[{] method[getReplacementCmd, return_type[type[String]], modifier[private], parameter[cmd]] begin[{] if[binary_operation[binary_operation[member[.mCommandAlias], ==, literal[null]], ||, call[mCommandAlias.containsKey, parameter[member[.cmd]]]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[mCommandAlias.get, parameter[member[.cmd]]]] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[private] identifier[String] operator[SEP] operator[SEP] identifier[getReplacementCmd] operator[SEP] identifier[String] identifier[cmd] operator[SEP] { Keyword[if] operator[SEP] identifier[mCommandAlias] operator[==] Other[null] operator[||] operator[!] identifier[mCommandAlias] operator[SEP] identifier[containsKey] operator[SEP] identifier[cmd] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[mCommandAlias] operator[SEP] identifier[get] operator[SEP] identifier[cmd] operator[SEP] operator[SEP] }
public static MutableInodeDirectory fromJournalEntry(InodeDirectoryEntry entry) { // If journal entry has no mode set, set default mode for backwards-compatibility. MutableInodeDirectory ret = new MutableInodeDirectory(entry.getId()) .setCreationTimeMs(entry.getCreationTimeMs()) .setName(entry.getName()) .setParentId(entry.getParentId()) .setPersistenceState(PersistenceState.valueOf(entry.getPersistenceState())) .setPinned(entry.getPinned()) .setLastModificationTimeMs(entry.getLastModificationTimeMs(), true) .setMountPoint(entry.getMountPoint()) .setTtl(entry.getTtl()) .setTtlAction(ProtobufUtils.fromProtobuf(entry.getTtlAction())) .setDirectChildrenLoaded(entry.getDirectChildrenLoaded()); if (entry.hasAcl()) { ret.mAcl = ProtoUtils.fromProto(entry.getAcl()); } else { // Backward compatibility. AccessControlList acl = new AccessControlList(); acl.setOwningUser(entry.getOwner()); acl.setOwningGroup(entry.getGroup()); short mode = entry.hasMode() ? (short) entry.getMode() : Constants.DEFAULT_FILE_SYSTEM_MODE; acl.setMode(mode); ret.mAcl = acl; } if (entry.hasDefaultAcl()) { ret.mDefaultAcl = (DefaultAccessControlList) ProtoUtils.fromProto(entry.getDefaultAcl()); } else { ret.mDefaultAcl = new DefaultAccessControlList(); } return ret; }
class class_name[name] begin[{] method[fromJournalEntry, return_type[type[MutableInodeDirectory]], modifier[public static], parameter[entry]] begin[{] local_variable[type[MutableInodeDirectory], ret] if[call[entry.hasAcl, parameter[]]] begin[{] assign[member[ret.mAcl], call[ProtoUtils.fromProto, parameter[call[entry.getAcl, parameter[]]]]] else begin[{] local_variable[type[AccessControlList], acl] call[acl.setOwningUser, parameter[call[entry.getOwner, parameter[]]]] call[acl.setOwningGroup, parameter[call[entry.getGroup, parameter[]]]] local_variable[type[short], mode] call[acl.setMode, parameter[member[.mode]]] assign[member[ret.mAcl], member[.acl]] end[}] if[call[entry.hasDefaultAcl, parameter[]]] begin[{] assign[member[ret.mDefaultAcl], Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDefaultAcl, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=fromProto, postfix_operators=[], prefix_operators=[], qualifier=ProtoUtils, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DefaultAccessControlList, sub_type=None))] else begin[{] assign[member[ret.mDefaultAcl], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultAccessControlList, sub_type=None))] end[}] return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MutableInodeDirectory] identifier[fromJournalEntry] operator[SEP] identifier[InodeDirectoryEntry] identifier[entry] operator[SEP] { identifier[MutableInodeDirectory] identifier[ret] operator[=] Keyword[new] identifier[MutableInodeDirectory] operator[SEP] identifier[entry] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setCreationTimeMs] operator[SEP] identifier[entry] operator[SEP] identifier[getCreationTimeMs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setName] operator[SEP] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setParentId] operator[SEP] identifier[entry] operator[SEP] identifier[getParentId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setPersistenceState] operator[SEP] identifier[PersistenceState] operator[SEP] identifier[valueOf] operator[SEP] identifier[entry] operator[SEP] identifier[getPersistenceState] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setPinned] operator[SEP] identifier[entry] operator[SEP] identifier[getPinned] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setLastModificationTimeMs] operator[SEP] identifier[entry] operator[SEP] identifier[getLastModificationTimeMs] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[setMountPoint] operator[SEP] identifier[entry] operator[SEP] identifier[getMountPoint] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setTtl] operator[SEP] identifier[entry] operator[SEP] identifier[getTtl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setTtlAction] operator[SEP] identifier[ProtobufUtils] operator[SEP] identifier[fromProtobuf] operator[SEP] identifier[entry] operator[SEP] identifier[getTtlAction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setDirectChildrenLoaded] operator[SEP] identifier[entry] operator[SEP] identifier[getDirectChildrenLoaded] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[hasAcl] operator[SEP] operator[SEP] operator[SEP] { identifier[ret] operator[SEP] identifier[mAcl] operator[=] identifier[ProtoUtils] operator[SEP] identifier[fromProto] operator[SEP] identifier[entry] operator[SEP] identifier[getAcl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[AccessControlList] identifier[acl] operator[=] Keyword[new] identifier[AccessControlList] operator[SEP] operator[SEP] operator[SEP] identifier[acl] operator[SEP] identifier[setOwningUser] operator[SEP] identifier[entry] operator[SEP] identifier[getOwner] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[acl] operator[SEP] identifier[setOwningGroup] operator[SEP] identifier[entry] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[short] identifier[mode] operator[=] identifier[entry] operator[SEP] identifier[hasMode] operator[SEP] operator[SEP] operator[?] operator[SEP] Keyword[short] operator[SEP] identifier[entry] operator[SEP] identifier[getMode] operator[SEP] operator[SEP] operator[:] identifier[Constants] operator[SEP] identifier[DEFAULT_FILE_SYSTEM_MODE] operator[SEP] identifier[acl] operator[SEP] identifier[setMode] operator[SEP] identifier[mode] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[mAcl] operator[=] identifier[acl] operator[SEP] } Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[hasDefaultAcl] operator[SEP] operator[SEP] operator[SEP] { identifier[ret] operator[SEP] identifier[mDefaultAcl] operator[=] operator[SEP] identifier[DefaultAccessControlList] operator[SEP] identifier[ProtoUtils] operator[SEP] identifier[fromProto] operator[SEP] identifier[entry] operator[SEP] identifier[getDefaultAcl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[ret] operator[SEP] identifier[mDefaultAcl] operator[=] Keyword[new] identifier[DefaultAccessControlList] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
private static boolean tryConvertAllBlockScopedFollowing(Node start) { if (NodeUtil.isWithinLoop(start)) { // If in a loop, don't convert anything to a var. Return true only if there are no let/consts. return !hasBlockScopedVarsFollowing(start); } for (Node n = start.getNext(); n != null; n = n.getNext()) { if (n.isLet() || n.isConst()) { n.setToken(Token.VAR); } } return true; }
class class_name[name] begin[{] method[tryConvertAllBlockScopedFollowing, return_type[type[boolean]], modifier[private static], parameter[start]] begin[{] if[call[NodeUtil.isWithinLoop, parameter[member[.start]]]] begin[{] return[call[.hasBlockScopedVarsFollowing, parameter[member[.start]]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isLet, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isConst, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=VAR, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[])], member=setToken, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getNext, postfix_operators=[], prefix_operators=[], qualifier=start, selectors=[], type_arguments=None), name=n)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getNext, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None))]), label=None) return[literal[true]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[tryConvertAllBlockScopedFollowing] operator[SEP] identifier[Node] identifier[start] operator[SEP] { Keyword[if] operator[SEP] identifier[NodeUtil] operator[SEP] identifier[isWithinLoop] operator[SEP] identifier[start] operator[SEP] operator[SEP] { Keyword[return] operator[!] identifier[hasBlockScopedVarsFollowing] operator[SEP] identifier[start] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Node] identifier[n] operator[=] identifier[start] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] identifier[n] operator[!=] Other[null] operator[SEP] identifier[n] operator[=] identifier[n] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[n] operator[SEP] identifier[isLet] operator[SEP] operator[SEP] operator[||] identifier[n] operator[SEP] identifier[isConst] operator[SEP] operator[SEP] operator[SEP] { identifier[n] operator[SEP] identifier[setToken] operator[SEP] identifier[Token] operator[SEP] identifier[VAR] operator[SEP] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public static DataBuffer readUnknown(DataInputStream s, AllocationMode allocMode, long length, DataType type) { // if buffer is uncompressed, it'll be valid buffer, so we'll just return it if (type != DataType.COMPRESSED) { DataBuffer buffer = Nd4j.createBuffer(type, length, false); buffer.read(s, allocMode, length, type); return buffer; } else { try { // if buffer is compressed one, we''ll restore it here String compressionAlgorithm = s.readUTF(); long compressedLength = s.readLong(); long originalLength = s.readLong(); long numberOfElements = s.readLong(); DataType originalType = DataType.values()[s.readInt()]; byte[] temp = new byte[(int) compressedLength]; for (int i = 0; i < compressedLength; i++) { temp[i] = s.readByte(); } Pointer pointer = new BytePointer(temp); CompressionDescriptor descriptor = new CompressionDescriptor(); descriptor.setCompressedLength(compressedLength); descriptor.setCompressionAlgorithm(compressionAlgorithm); descriptor.setOriginalLength(originalLength); descriptor.setNumberOfElements(numberOfElements); descriptor.setOriginalDataType(originalType); return new CompressedDataBuffer(pointer, descriptor); } catch (Exception e) { throw new RuntimeException(e); } } }
class class_name[name] begin[{] method[readUnknown, return_type[type[DataBuffer]], modifier[public static], parameter[s, allocMode, length, type]] begin[{] if[binary_operation[member[.type], !=, member[DataType.COMPRESSED]]] begin[{] local_variable[type[DataBuffer], buffer] call[buffer.read, parameter[member[.s], member[.allocMode], member[.length], member[.type]]] return[member[.buffer]] else begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readUTF, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=compressionAlgorithm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLong, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=compressedLength)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLong, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=originalLength)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLong, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=numberOfElements)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=DataType, selectors=[ArraySelector(index=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None))], type_arguments=None), name=originalType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataType, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Cast(expression=MemberReference(member=compressedLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=temp)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=readByte, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=compressedLength, 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), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=temp, 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=BytePointer, sub_type=None)), name=pointer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pointer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompressionDescriptor, sub_type=None)), name=descriptor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CompressionDescriptor, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=compressedLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCompressedLength, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=compressionAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCompressionAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=originalLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOriginalLength, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=numberOfElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setNumberOfElements, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=originalType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOriginalDataType, postfix_operators=[], prefix_operators=[], qualifier=descriptor, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=pointer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=descriptor, 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=CompressedDataBuffer, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[DataBuffer] identifier[readUnknown] operator[SEP] identifier[DataInputStream] identifier[s] , identifier[AllocationMode] identifier[allocMode] , Keyword[long] identifier[length] , identifier[DataType] identifier[type] operator[SEP] { Keyword[if] operator[SEP] identifier[type] operator[!=] identifier[DataType] operator[SEP] identifier[COMPRESSED] operator[SEP] { identifier[DataBuffer] identifier[buffer] operator[=] identifier[Nd4j] operator[SEP] identifier[createBuffer] operator[SEP] identifier[type] , identifier[length] , literal[boolean] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[read] operator[SEP] identifier[s] , identifier[allocMode] , identifier[length] , identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] } Keyword[else] { Keyword[try] { identifier[String] identifier[compressionAlgorithm] operator[=] identifier[s] operator[SEP] identifier[readUTF] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[compressedLength] operator[=] identifier[s] operator[SEP] identifier[readLong] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[originalLength] operator[=] identifier[s] operator[SEP] identifier[readLong] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[numberOfElements] operator[=] identifier[s] operator[SEP] identifier[readLong] operator[SEP] operator[SEP] operator[SEP] identifier[DataType] identifier[originalType] operator[=] identifier[DataType] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[temp] operator[=] Keyword[new] Keyword[byte] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[compressedLength] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[compressedLength] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[temp] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[s] operator[SEP] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] } identifier[Pointer] identifier[pointer] operator[=] Keyword[new] identifier[BytePointer] operator[SEP] identifier[temp] operator[SEP] operator[SEP] identifier[CompressionDescriptor] identifier[descriptor] operator[=] Keyword[new] identifier[CompressionDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[descriptor] operator[SEP] identifier[setCompressedLength] operator[SEP] identifier[compressedLength] operator[SEP] operator[SEP] identifier[descriptor] operator[SEP] identifier[setCompressionAlgorithm] operator[SEP] identifier[compressionAlgorithm] operator[SEP] operator[SEP] identifier[descriptor] operator[SEP] identifier[setOriginalLength] operator[SEP] identifier[originalLength] operator[SEP] operator[SEP] identifier[descriptor] operator[SEP] identifier[setNumberOfElements] operator[SEP] identifier[numberOfElements] operator[SEP] operator[SEP] identifier[descriptor] operator[SEP] identifier[setOriginalDataType] operator[SEP] identifier[originalType] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CompressedDataBuffer] operator[SEP] identifier[pointer] , identifier[descriptor] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } }
public OvhItemDetail order_orderId_details_orderDetailId_extension_GET(Long orderId, Long orderDetailId) throws IOException { String qPath = "/me/order/{orderId}/details/{orderDetailId}/extension"; StringBuilder sb = path(qPath, orderId, orderDetailId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhItemDetail.class); }
class class_name[name] begin[{] method[order_orderId_details_orderDetailId_extension_GET, return_type[type[OvhItemDetail]], modifier[public], parameter[orderId, orderDetailId]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhItemDetail, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhItemDetail] identifier[order_orderId_details_orderDetailId_extension_GET] operator[SEP] identifier[Long] identifier[orderId] , identifier[Long] identifier[orderDetailId] 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[orderId] , identifier[orderDetailId] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhItemDetail] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public java.util.Map<String, Integer> getSummaryMap() { if (summaryMap == null) { summaryMap = new com.amazonaws.internal.SdkInternalMap<String, Integer>(); } return summaryMap; }
class class_name[name] begin[{] method[getSummaryMap, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.summaryMap], ==, literal[null]]] begin[{] assign[member[.summaryMap], 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)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=SdkInternalMap, sub_type=None)))))] else begin[{] None end[}] return[member[.summaryMap]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] identifier[getSummaryMap] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[summaryMap] operator[==] Other[null] operator[SEP] { identifier[summaryMap] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalMap] operator[<] identifier[String] , identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[summaryMap] operator[SEP] }
@Override protected MtasDataItemLongBasic getItem(int i) { if (i >= 0 && i < size) { return new MtasDataItemLongBasic(basicValueSumList[i], basicValueNList[i], hasSub() ? subCollectorListNextLevel[i] : null, getStatsItems(), sortType, sortDirection, errorNumber[i], errorList[i], sourceNumberList[i]); } else { return null; } }
class class_name[name] begin[{] method[getItem, return_type[type[MtasDataItemLongBasic]], modifier[protected], parameter[i]] begin[{] if[binary_operation[binary_operation[member[.i], >=, literal[0]], &&, binary_operation[member[.i], <, member[.size]]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=basicValueSumList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=basicValueNList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), TernaryExpression(condition=MethodInvocation(arguments=[], member=hasSub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=subCollectorListNextLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), MethodInvocation(arguments=[], member=getStatsItems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=sortType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sortDirection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=errorNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=errorList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=sourceNumberList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=MtasDataItemLongBasic, sub_type=None))] else begin[{] return[literal[null]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[MtasDataItemLongBasic] identifier[getItem] operator[SEP] Keyword[int] identifier[i] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[>=] Other[0] operator[&&] identifier[i] operator[<] identifier[size] operator[SEP] { Keyword[return] Keyword[new] identifier[MtasDataItemLongBasic] operator[SEP] identifier[basicValueSumList] operator[SEP] identifier[i] operator[SEP] , identifier[basicValueNList] operator[SEP] identifier[i] operator[SEP] , identifier[hasSub] operator[SEP] operator[SEP] operator[?] identifier[subCollectorListNextLevel] operator[SEP] identifier[i] operator[SEP] operator[:] Other[null] , identifier[getStatsItems] operator[SEP] operator[SEP] , identifier[sortType] , identifier[sortDirection] , identifier[errorNumber] operator[SEP] identifier[i] operator[SEP] , identifier[errorList] operator[SEP] identifier[i] operator[SEP] , identifier[sourceNumberList] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
public static boolean[] toArray(Collection<Boolean> collection) { if (collection instanceof BooleanArrayAsList) { return ((BooleanArrayAsList) collection).toBooleanArray(); } Object[] boxedArray = collection.toArray(); int len = boxedArray.length; boolean[] array = new boolean[len]; for (int i = 0; i < len; i++) { // checkNotNull for GWT (do not optimize) array[i] = (Boolean) checkNotNull(boxedArray[i]); } return array; }
class class_name[name] begin[{] method[toArray, return_type[type[boolean]], modifier[public static], parameter[collection]] begin[{] if[binary_operation[member[.collection], instanceof, type[BooleanArrayAsList]]] begin[{] return[Cast(expression=MemberReference(member=collection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BooleanArrayAsList, sub_type=None))] else begin[{] None end[}] local_variable[type[Object], boxedArray] local_variable[type[int], len] local_variable[type[boolean], array] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=boxedArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=checkNotNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.array]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] identifier[Collection] operator[<] identifier[Boolean] operator[>] identifier[collection] operator[SEP] { Keyword[if] operator[SEP] identifier[collection] Keyword[instanceof] identifier[BooleanArrayAsList] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[BooleanArrayAsList] operator[SEP] identifier[collection] operator[SEP] operator[SEP] identifier[toBooleanArray] operator[SEP] operator[SEP] operator[SEP] } identifier[Object] operator[SEP] operator[SEP] identifier[boxedArray] operator[=] identifier[collection] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[boxedArray] operator[SEP] identifier[length] operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] identifier[array] operator[=] Keyword[new] Keyword[boolean] operator[SEP] identifier[len] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[array] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[Boolean] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[boxedArray] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[array] operator[SEP] }
public static String toKml(Geometry geometry) throws SQLException { StringBuilder sb = new StringBuilder(); KMLGeometry.toKMLGeometry(geometry, sb); return sb.toString(); }
class class_name[name] begin[{] method[toKml, return_type[type[String]], modifier[public static], parameter[geometry]] begin[{] local_variable[type[StringBuilder], sb] call[KMLGeometry.toKMLGeometry, parameter[member[.geometry], member[.sb]]] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[toKml] operator[SEP] identifier[Geometry] identifier[geometry] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[KMLGeometry] operator[SEP] identifier[toKMLGeometry] operator[SEP] identifier[geometry] , identifier[sb] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public NettyServerBuilder maxConnectionIdle(long maxConnectionIdle, TimeUnit timeUnit) { checkArgument(maxConnectionIdle > 0L, "max connection idle must be positive"); maxConnectionIdleInNanos = timeUnit.toNanos(maxConnectionIdle); if (maxConnectionIdleInNanos >= AS_LARGE_AS_INFINITE) { maxConnectionIdleInNanos = MAX_CONNECTION_IDLE_NANOS_DISABLED; } if (maxConnectionIdleInNanos < MIN_MAX_CONNECTION_IDLE_NANO) { maxConnectionIdleInNanos = MIN_MAX_CONNECTION_IDLE_NANO; } return this; }
class class_name[name] begin[{] method[maxConnectionIdle, return_type[type[NettyServerBuilder]], modifier[public], parameter[maxConnectionIdle, timeUnit]] begin[{] call[.checkArgument, parameter[binary_operation[member[.maxConnectionIdle], >, literal[0L]], literal["max connection idle must be positive"]]] assign[member[.maxConnectionIdleInNanos], call[timeUnit.toNanos, parameter[member[.maxConnectionIdle]]]] if[binary_operation[member[.maxConnectionIdleInNanos], >=, member[.AS_LARGE_AS_INFINITE]]] begin[{] assign[member[.maxConnectionIdleInNanos], member[.MAX_CONNECTION_IDLE_NANOS_DISABLED]] else begin[{] None end[}] if[binary_operation[member[.maxConnectionIdleInNanos], <, member[.MIN_MAX_CONNECTION_IDLE_NANO]]] begin[{] assign[member[.maxConnectionIdleInNanos], member[.MIN_MAX_CONNECTION_IDLE_NANO]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[NettyServerBuilder] identifier[maxConnectionIdle] operator[SEP] Keyword[long] identifier[maxConnectionIdle] , identifier[TimeUnit] identifier[timeUnit] operator[SEP] { identifier[checkArgument] operator[SEP] identifier[maxConnectionIdle] operator[>] Other[0L] , literal[String] operator[SEP] operator[SEP] identifier[maxConnectionIdleInNanos] operator[=] identifier[timeUnit] operator[SEP] identifier[toNanos] operator[SEP] identifier[maxConnectionIdle] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[maxConnectionIdleInNanos] operator[>=] identifier[AS_LARGE_AS_INFINITE] operator[SEP] { identifier[maxConnectionIdleInNanos] operator[=] identifier[MAX_CONNECTION_IDLE_NANOS_DISABLED] operator[SEP] } Keyword[if] operator[SEP] identifier[maxConnectionIdleInNanos] operator[<] identifier[MIN_MAX_CONNECTION_IDLE_NANO] operator[SEP] { identifier[maxConnectionIdleInNanos] operator[=] identifier[MIN_MAX_CONNECTION_IDLE_NANO] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override public int doEndTag() throws JspException { Tag t = findAncestorWithClass(this, ParamParent.class); if (t == null) { throw new JspTagException( Resources.getMessage("PARAM_OUTSIDE_PARENT")); } // take no action for null or empty names if (name == null || name.equals("")) { return EVAL_PAGE; } // send the parameter to the appropriate ancestor ParamParent parent = (ParamParent) t; String value = this.value; if (value == null) { if (bodyContent == null || bodyContent.getString() == null) { value = ""; } else { value = bodyContent.getString().trim(); } } if (encode) { String enc = pageContext.getResponse().getCharacterEncoding(); try { parent.addParameter(URLEncoder.encode(name, enc), URLEncoder.encode(value, enc)); } catch (UnsupportedEncodingException e) { throw new JspTagException(e); } } else { parent.addParameter(name, value); } return EVAL_PAGE; }
class class_name[name] begin[{] method[doEndTag, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[Tag], t] if[binary_operation[member[.t], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PARAM_OUTSIDE_PARENT")], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=Resources, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JspTagException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[member[.name], ==, literal[null]], ||, call[name.equals, parameter[literal[""]]]]] begin[{] return[member[.EVAL_PAGE]] else begin[{] None end[}] local_variable[type[ParamParent], parent] local_variable[type[String], value] if[binary_operation[member[.value], ==, literal[null]]] begin[{] if[binary_operation[binary_operation[member[.bodyContent], ==, literal[null]], ||, binary_operation[call[bodyContent.getString, parameter[]], ==, literal[null]]]] begin[{] assign[member[.value], literal[""]] else begin[{] assign[member[.value], call[bodyContent.getString, parameter[]]] end[}] else begin[{] None end[}] if[member[.encode]] begin[{] local_variable[type[String], enc] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None)], member=addParameter, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JspTagException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) else begin[{] call[parent.addParameter, parameter[member[.name], member[.value]]] end[}] return[member[.EVAL_PAGE]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[doEndTag] operator[SEP] operator[SEP] Keyword[throws] identifier[JspException] { identifier[Tag] identifier[t] operator[=] identifier[findAncestorWithClass] operator[SEP] Keyword[this] , identifier[ParamParent] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[JspTagException] operator[SEP] identifier[Resources] operator[SEP] identifier[getMessage] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[||] identifier[name] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[EVAL_PAGE] operator[SEP] } identifier[ParamParent] identifier[parent] operator[=] operator[SEP] identifier[ParamParent] operator[SEP] identifier[t] operator[SEP] identifier[String] identifier[value] operator[=] Keyword[this] operator[SEP] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[bodyContent] operator[==] Other[null] operator[||] identifier[bodyContent] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[value] operator[=] literal[String] operator[SEP] } Keyword[else] { identifier[value] operator[=] identifier[bodyContent] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[encode] operator[SEP] { identifier[String] identifier[enc] operator[=] identifier[pageContext] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] operator[SEP] identifier[getCharacterEncoding] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[parent] operator[SEP] identifier[addParameter] operator[SEP] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[name] , identifier[enc] operator[SEP] , identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[value] , identifier[enc] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[JspTagException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[else] { identifier[parent] operator[SEP] identifier[addParameter] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[EVAL_PAGE] operator[SEP] }
public DialSeries addSeries(String seriesName, double value, String annotation) { // Sanity checks sanityCheck(seriesName, value); DialSeries series = new DialSeries(seriesName, value, annotation); seriesMap.put(seriesName, series); return series; }
class class_name[name] begin[{] method[addSeries, return_type[type[DialSeries]], modifier[public], parameter[seriesName, value, annotation]] begin[{] call[.sanityCheck, parameter[member[.seriesName], member[.value]]] local_variable[type[DialSeries], series] call[seriesMap.put, parameter[member[.seriesName], member[.series]]] return[member[.series]] end[}] END[}]
Keyword[public] identifier[DialSeries] identifier[addSeries] operator[SEP] identifier[String] identifier[seriesName] , Keyword[double] identifier[value] , identifier[String] identifier[annotation] operator[SEP] { identifier[sanityCheck] operator[SEP] identifier[seriesName] , identifier[value] operator[SEP] operator[SEP] identifier[DialSeries] identifier[series] operator[=] Keyword[new] identifier[DialSeries] operator[SEP] identifier[seriesName] , identifier[value] , identifier[annotation] operator[SEP] operator[SEP] identifier[seriesMap] operator[SEP] identifier[put] operator[SEP] identifier[seriesName] , identifier[series] operator[SEP] operator[SEP] Keyword[return] identifier[series] operator[SEP] }
public static Route OPTIONS(String uriPattern, RouteHandler routeHandler) { return new Route(HttpConstants.Method.OPTIONS, uriPattern, routeHandler); }
class class_name[name] begin[{] method[OPTIONS, return_type[type[Route]], modifier[public static], parameter[uriPattern, routeHandler]] begin[{] return[ClassCreator(arguments=[MemberReference(member=OPTIONS, postfix_operators=[], prefix_operators=[], qualifier=HttpConstants.Method, selectors=[]), MemberReference(member=uriPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=routeHandler, 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=Route, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Route] identifier[OPTIONS] operator[SEP] identifier[String] identifier[uriPattern] , identifier[RouteHandler] identifier[routeHandler] operator[SEP] { Keyword[return] Keyword[new] identifier[Route] operator[SEP] identifier[HttpConstants] operator[SEP] identifier[Method] operator[SEP] identifier[OPTIONS] , identifier[uriPattern] , identifier[routeHandler] operator[SEP] operator[SEP] }
protected void sequence_XThrowExpression(ISerializationContext context, XThrowExpression semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XTHROW_EXPRESSION__EXPRESSION) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XbasePackage.Literals.XTHROW_EXPRESSION__EXPRESSION)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getXThrowExpressionAccess().getExpressionXExpressionParserRuleCall_2_0(), semanticObject.getExpression()); feeder.finish(); }
class class_name[name] begin[{] method[sequence_XThrowExpression, return_type[void], modifier[protected], parameter[context, semanticObject]] begin[{] if[binary_operation[member[.errorAcceptor], !=, literal[null]]] begin[{] if[binary_operation[call[transientValues.isValueTransient, parameter[member[.semanticObject], member[XbasePackage.Literals.XTHROW_EXPRESSION__EXPRESSION]]], ==, member[ValueTransient.YES]]] begin[{] call[errorAcceptor.accept, parameter[call[diagnosticProvider.createFeatureValueMissing, parameter[member[.semanticObject], member[XbasePackage.Literals.XTHROW_EXPRESSION__EXPRESSION]]]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[SequenceFeeder], feeder] call[feeder.accept, parameter[call[grammarAccess.getXThrowExpressionAccess, parameter[]], call[semanticObject.getExpression, parameter[]]]] call[feeder.finish, parameter[]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[sequence_XThrowExpression] operator[SEP] identifier[ISerializationContext] identifier[context] , identifier[XThrowExpression] identifier[semanticObject] operator[SEP] { Keyword[if] operator[SEP] identifier[errorAcceptor] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[transientValues] operator[SEP] identifier[isValueTransient] operator[SEP] identifier[semanticObject] , identifier[XbasePackage] operator[SEP] identifier[Literals] operator[SEP] identifier[XTHROW_EXPRESSION__EXPRESSION] operator[SEP] operator[==] identifier[ValueTransient] operator[SEP] identifier[YES] operator[SEP] identifier[errorAcceptor] operator[SEP] identifier[accept] operator[SEP] identifier[diagnosticProvider] operator[SEP] identifier[createFeatureValueMissing] operator[SEP] identifier[semanticObject] , identifier[XbasePackage] operator[SEP] identifier[Literals] operator[SEP] identifier[XTHROW_EXPRESSION__EXPRESSION] operator[SEP] operator[SEP] operator[SEP] } identifier[SequenceFeeder] identifier[feeder] operator[=] identifier[createSequencerFeeder] operator[SEP] identifier[context] , identifier[semanticObject] operator[SEP] operator[SEP] identifier[feeder] operator[SEP] identifier[accept] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXThrowExpressionAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getExpressionXExpressionParserRuleCall_2_0] operator[SEP] operator[SEP] , identifier[semanticObject] operator[SEP] identifier[getExpression] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[feeder] operator[SEP] identifier[finish] operator[SEP] operator[SEP] operator[SEP] }
public Packer putLong(final long value) { ensureCapacity(bufPosition + 8); buf[bufPosition++] = (byte) (value >> 56); buf[bufPosition++] = (byte) (value >> 48); buf[bufPosition++] = (byte) (value >> 40); buf[bufPosition++] = (byte) (value >> 32); buf[bufPosition++] = (byte) (value >> 24); buf[bufPosition++] = (byte) (value >> 16); buf[bufPosition++] = (byte) (value >> 8); buf[bufPosition++] = (byte) (value); return this; }
class class_name[name] begin[{] method[putLong, return_type[type[Packer]], modifier[public], parameter[value]] begin[{] call[.ensureCapacity, parameter[binary_operation[member[.bufPosition], +, literal[8]]]] assign[member[.buf], Cast(expression=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=56), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.buf], Cast(expression=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=48), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.buf], Cast(expression=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=40), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.buf], Cast(expression=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.buf], Cast(expression=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.buf], Cast(expression=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.buf], Cast(expression=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.buf], Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Packer] identifier[putLong] operator[SEP] Keyword[final] Keyword[long] identifier[value] operator[SEP] { identifier[ensureCapacity] operator[SEP] identifier[bufPosition] operator[+] Other[8] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[bufPosition] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[>] operator[>] Other[56] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[bufPosition] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[>] operator[>] Other[48] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[bufPosition] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[>] operator[>] Other[40] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[bufPosition] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[>] operator[>] Other[32] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[bufPosition] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[>] operator[>] Other[24] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[bufPosition] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[>] operator[>] Other[16] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[bufPosition] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[>] operator[>] Other[8] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[bufPosition] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static boolean isMultipart(HttpServletRequest request) { if (false == isPostMethod(request)) { return false; } String contentType = request.getContentType(); if (StrUtil.isBlank(contentType)) { return false; } if (contentType.toLowerCase().startsWith("multipart/")) { return true; } return false; }
class class_name[name] begin[{] method[isMultipart, return_type[type[boolean]], modifier[public static], parameter[request]] begin[{] if[binary_operation[literal[false], ==, call[.isPostMethod, parameter[member[.request]]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[String], contentType] if[call[StrUtil.isBlank, parameter[member[.contentType]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[contentType.toLowerCase, parameter[]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isMultipart] operator[SEP] identifier[HttpServletRequest] identifier[request] operator[SEP] { Keyword[if] operator[SEP] literal[boolean] operator[==] identifier[isPostMethod] operator[SEP] identifier[request] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[String] identifier[contentType] operator[=] identifier[request] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StrUtil] operator[SEP] identifier[isBlank] operator[SEP] identifier[contentType] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[contentType] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@SuppressWarnings({"deprecation", "WeakerAccess"}) protected void removeShutdownHook(ClassLoaderLeakPreventor preventor, Thread shutdownHook) { final String displayString = "'" + shutdownHook + "' of type " + shutdownHook.getClass().getName(); preventor.error("Removing shutdown hook: " + displayString); Runtime.getRuntime().removeShutdownHook(shutdownHook); if(executeShutdownHooks) { // Shutdown hooks should be executed preventor.info("Executing shutdown hook now: " + displayString); // Make sure it's from protected ClassLoader shutdownHook.start(); // Run cleanup immediately if(shutdownHookWaitMs > 0) { // Wait for shutdown hook to finish try { shutdownHook.join(shutdownHookWaitMs); // Wait for thread to run } catch (InterruptedException e) { // Do nothing } if(shutdownHook.isAlive()) { preventor.warn(shutdownHook + "still running after " + shutdownHookWaitMs + " ms - Stopping!"); shutdownHook.stop(); } } } }
class class_name[name] begin[{] method[removeShutdownHook, return_type[void], modifier[protected], parameter[preventor, shutdownHook]] begin[{] local_variable[type[String], displayString] call[preventor.error, parameter[binary_operation[literal["Removing shutdown hook: "], +, member[.displayString]]]] call[Runtime.getRuntime, parameter[]] if[member[.executeShutdownHooks]] begin[{] call[preventor.info, parameter[binary_operation[literal["Executing shutdown hook now: "], +, member[.displayString]]]] call[shutdownHook.start, parameter[]] if[binary_operation[member[.shutdownHookWaitMs], >, literal[0]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=shutdownHookWaitMs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=shutdownHook, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) if[call[shutdownHook.isAlive, parameter[]]] begin[{] call[preventor.warn, parameter[binary_operation[binary_operation[binary_operation[member[.shutdownHook], +, literal["still running after "]], +, member[.shutdownHookWaitMs]], +, literal[" ms - Stopping!"]]]] call[shutdownHook.stop, parameter[]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] Keyword[protected] Keyword[void] identifier[removeShutdownHook] operator[SEP] identifier[ClassLoaderLeakPreventor] identifier[preventor] , identifier[Thread] identifier[shutdownHook] operator[SEP] { Keyword[final] identifier[String] identifier[displayString] operator[=] literal[String] operator[+] identifier[shutdownHook] operator[+] literal[String] operator[+] identifier[shutdownHook] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[preventor] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[displayString] operator[SEP] operator[SEP] identifier[Runtime] operator[SEP] identifier[getRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[removeShutdownHook] operator[SEP] identifier[shutdownHook] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[executeShutdownHooks] operator[SEP] { identifier[preventor] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[displayString] operator[SEP] operator[SEP] identifier[shutdownHook] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[shutdownHookWaitMs] operator[>] Other[0] operator[SEP] { Keyword[try] { identifier[shutdownHook] operator[SEP] identifier[join] operator[SEP] identifier[shutdownHookWaitMs] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { } Keyword[if] operator[SEP] identifier[shutdownHook] operator[SEP] identifier[isAlive] operator[SEP] operator[SEP] operator[SEP] { identifier[preventor] operator[SEP] identifier[warn] operator[SEP] identifier[shutdownHook] operator[+] literal[String] operator[+] identifier[shutdownHookWaitMs] operator[+] literal[String] operator[SEP] operator[SEP] identifier[shutdownHook] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] } } } }
public void selectWord(int position) { if (text.length() == 0) return; selectingText = true; selectionCursor.jumpTo(position); selectionCursor.jumpToNextSpace(true); if (Character.isWhitespace(text.charAt(selectionCursor.index))) selectionCursor.shiftRight(); cursor.jumpTo(position); cursor.jumpToNextSpace(false); }
class class_name[name] begin[{] method[selectWord, return_type[void], modifier[public], parameter[position]] begin[{] if[binary_operation[call[text.length, parameter[]], ==, literal[0]]] begin[{] return[None] else begin[{] None end[}] assign[member[.selectingText], literal[true]] call[selectionCursor.jumpTo, parameter[member[.position]]] call[selectionCursor.jumpToNextSpace, parameter[literal[true]]] if[call[Character.isWhitespace, parameter[call[text.charAt, parameter[member[selectionCursor.index]]]]]] begin[{] call[selectionCursor.shiftRight, parameter[]] else begin[{] None end[}] call[cursor.jumpTo, parameter[member[.position]]] call[cursor.jumpToNextSpace, parameter[literal[false]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[selectWord] operator[SEP] Keyword[int] identifier[position] operator[SEP] { Keyword[if] operator[SEP] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] operator[SEP] identifier[selectingText] operator[=] literal[boolean] operator[SEP] identifier[selectionCursor] operator[SEP] identifier[jumpTo] operator[SEP] identifier[position] operator[SEP] operator[SEP] identifier[selectionCursor] operator[SEP] identifier[jumpToNextSpace] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[selectionCursor] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] identifier[selectionCursor] operator[SEP] identifier[shiftRight] operator[SEP] operator[SEP] operator[SEP] identifier[cursor] operator[SEP] identifier[jumpTo] operator[SEP] identifier[position] operator[SEP] operator[SEP] identifier[cursor] operator[SEP] identifier[jumpToNextSpace] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
public static void swap(short[] shortArray1, short[] shortArray2) { int minLength = Math.min(shortArray1.length, shortArray2.length); for(int i = 0; i < minLength; i++) { XORSwap.swap(shortArray1, shortArray2, i); } }
class class_name[name] begin[{] method[swap, return_type[void], modifier[public static], parameter[shortArray1, shortArray2]] begin[{] local_variable[type[int], minLength] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=shortArray1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=shortArray2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=swap, postfix_operators=[], prefix_operators=[], qualifier=XORSwap, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=minLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[swap] operator[SEP] Keyword[short] operator[SEP] operator[SEP] identifier[shortArray1] , Keyword[short] operator[SEP] operator[SEP] identifier[shortArray2] operator[SEP] { Keyword[int] identifier[minLength] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[shortArray1] operator[SEP] identifier[length] , identifier[shortArray2] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[minLength] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[XORSwap] operator[SEP] identifier[swap] operator[SEP] identifier[shortArray1] , identifier[shortArray2] , identifier[i] operator[SEP] operator[SEP] } }
void increment(double amount) { spectatorCounter.add(amount); if (amount >= 0.0) { for (int i = 0; i < Pollers.NUM_POLLERS; ++i) { add(count.getCurrent(i), amount); } } }
class class_name[name] begin[{] method[increment, return_type[void], modifier[default], parameter[amount]] begin[{] call[spectatorCounter.add, parameter[member[.amount]]] if[binary_operation[member[.amount], >=, literal[0.0]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCurrent, postfix_operators=[], prefix_operators=[], qualifier=count, selectors=[], type_arguments=None), MemberReference(member=amount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NUM_POLLERS, postfix_operators=[], prefix_operators=[], qualifier=Pollers, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[increment] operator[SEP] Keyword[double] identifier[amount] operator[SEP] { identifier[spectatorCounter] operator[SEP] identifier[add] operator[SEP] identifier[amount] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[amount] operator[>=] literal[Float] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[Pollers] operator[SEP] identifier[NUM_POLLERS] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[add] operator[SEP] identifier[count] operator[SEP] identifier[getCurrent] operator[SEP] identifier[i] operator[SEP] , identifier[amount] operator[SEP] operator[SEP] } } }
private static int remapEdges(KamNode collapsing, KamNode collapseTo, Kam kam, PreparedStatement esps, PreparedStatement etps) throws SQLException { int updates = 0; Set<KamEdge> outgoing = kam.getAdjacentEdges(collapsing, FORWARD); int collapseToId = collapseTo.getId(); for (KamEdge edge : outgoing) { esps.setInt(1, collapseToId); esps.setInt(2, edge.getId()); updates += esps.executeUpdate(); } Set<KamEdge> incoming = kam.getAdjacentEdges(collapsing, REVERSE); for (KamEdge edge : incoming) { etps.setInt(1, collapseToId); etps.setInt(2, edge.getId()); updates += etps.executeUpdate(); } return updates; }
class class_name[name] begin[{] method[remapEdges, return_type[type[int]], modifier[private static], parameter[collapsing, collapseTo, kam, esps, etps]] begin[{] local_variable[type[int], updates] local_variable[type[Set], outgoing] local_variable[type[int], collapseToId] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=collapseToId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=esps, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None)], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=esps, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=updates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=executeUpdate, postfix_operators=[], prefix_operators=[], qualifier=esps, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=outgoing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=edge)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KamEdge, sub_type=None))), label=None) local_variable[type[Set], incoming] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=collapseToId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=etps, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None)], member=setInt, postfix_operators=[], prefix_operators=[], qualifier=etps, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=updates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=executeUpdate, postfix_operators=[], prefix_operators=[], qualifier=etps, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=incoming, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=edge)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KamEdge, sub_type=None))), label=None) return[member[.updates]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[int] identifier[remapEdges] operator[SEP] identifier[KamNode] identifier[collapsing] , identifier[KamNode] identifier[collapseTo] , identifier[Kam] identifier[kam] , identifier[PreparedStatement] identifier[esps] , identifier[PreparedStatement] identifier[etps] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[int] identifier[updates] operator[=] Other[0] operator[SEP] identifier[Set] operator[<] identifier[KamEdge] operator[>] identifier[outgoing] operator[=] identifier[kam] operator[SEP] identifier[getAdjacentEdges] operator[SEP] identifier[collapsing] , identifier[FORWARD] operator[SEP] operator[SEP] Keyword[int] identifier[collapseToId] operator[=] identifier[collapseTo] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[KamEdge] identifier[edge] operator[:] identifier[outgoing] operator[SEP] { identifier[esps] operator[SEP] identifier[setInt] operator[SEP] Other[1] , identifier[collapseToId] operator[SEP] operator[SEP] identifier[esps] operator[SEP] identifier[setInt] operator[SEP] Other[2] , identifier[edge] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[updates] operator[+=] identifier[esps] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP] } identifier[Set] operator[<] identifier[KamEdge] operator[>] identifier[incoming] operator[=] identifier[kam] operator[SEP] identifier[getAdjacentEdges] operator[SEP] identifier[collapsing] , identifier[REVERSE] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[KamEdge] identifier[edge] operator[:] identifier[incoming] operator[SEP] { identifier[etps] operator[SEP] identifier[setInt] operator[SEP] Other[1] , identifier[collapseToId] operator[SEP] operator[SEP] identifier[etps] operator[SEP] identifier[setInt] operator[SEP] Other[2] , identifier[edge] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[updates] operator[+=] identifier[etps] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[updates] operator[SEP] }
public final void synpred11_DRL6Expressions_fragment() throws RecognitionException { // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:421:5: ( DOUBLE_AMPER ( fullAnnotation[null] )? operator ) // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:421:6: DOUBLE_AMPER ( fullAnnotation[null] )? operator { match(input,DOUBLE_AMPER,FOLLOW_DOUBLE_AMPER_in_synpred11_DRL6Expressions1972); if (state.failed) return; // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:421:19: ( fullAnnotation[null] )? int alt100=2; int LA100_0 = input.LA(1); if ( (LA100_0==AT) ) { alt100=1; } switch (alt100) { case 1 : // src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:421:19: fullAnnotation[null] { pushFollow(FOLLOW_fullAnnotation_in_synpred11_DRL6Expressions1974); fullAnnotation(null); state._fsp--; if (state.failed) return; } break; } pushFollow(FOLLOW_operator_in_synpred11_DRL6Expressions1978); operator(); state._fsp--; if (state.failed) return; } }
class class_name[name] begin[{] method[synpred11_DRL6Expressions_fragment, return_type[void], modifier[final public], parameter[]] begin[{] call[.match, parameter[member[.input], member[.DOUBLE_AMPER], member[.FOLLOW_DOUBLE_AMPER_in_synpred11_DRL6Expressions1972]]] if[member[state.failed]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], alt100] local_variable[type[int], LA100_0] if[binary_operation[member[.LA100_0], ==, member[.AT]]] begin[{] assign[member[.alt100], literal[1]] else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_fullAnnotation_in_synpred11_DRL6Expressions1974, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=fullAnnotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt100, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) call[.pushFollow, parameter[member[.FOLLOW_operator_in_synpred11_DRL6Expressions1978]]] call[.operator, parameter[]] member[state._fsp] if[member[state.failed]] begin[{] return[None] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[synpred11_DRL6Expressions_fragment] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { { identifier[match] operator[SEP] identifier[input] , identifier[DOUBLE_AMPER] , identifier[FOLLOW_DOUBLE_AMPER_in_synpred11_DRL6Expressions1972] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] Keyword[int] identifier[alt100] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA100_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA100_0] operator[==] identifier[AT] operator[SEP] operator[SEP] { identifier[alt100] operator[=] Other[1] operator[SEP] } Keyword[switch] operator[SEP] identifier[alt100] operator[SEP] { Keyword[case] Other[1] operator[:] { identifier[pushFollow] operator[SEP] identifier[FOLLOW_fullAnnotation_in_synpred11_DRL6Expressions1974] operator[SEP] operator[SEP] identifier[fullAnnotation] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } Keyword[break] operator[SEP] } identifier[pushFollow] operator[SEP] identifier[FOLLOW_operator_in_synpred11_DRL6Expressions1978] operator[SEP] operator[SEP] identifier[operator] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } }
public String getHomeLocalImplClassName() { if (ivLocalHomeInterface == null) return null; if (ivVersion == EJB_1X) throw new IllegalStateException("Local interfaces are not supported " + "in EJB 1.x modules"); // ----------------------------------------------------------------------- // The component local home implementation name was new in EJB 2.x and // only modified slightly in EJB 3.0. The only 3 differences are : // // 1 - "C" indicating component interface added // 2 - beantype shortened for Stateless and Stateful (now SL/SF) // 3 - hash code uses modified algorithm, and includes business interfaces // // The last two differences are pre-calculated in the constructor, and // so the code here appears common. // ----------------------------------------------------------------------- StringBuffer result = new StringBuffer(); // Note: uses local interface package, not local home package (historical). String packageName = packageName(ivLocalInterface); if (packageName != null) { result.append(packageName); result.append('.'); } result.append(homeLocalPrefix); // EJSLocal if (ivVersion >= EJB_3X) result.append("C"); // Component interface result.append(ivBeanType); // SL/SF/BMP/CMP, etc. result.append(ivBeanName); // First 32 characters result.append("Home"); result.append('_'); result.append(ivHashSuffix); // 8 digit hashcode return result.toString(); }
class class_name[name] begin[{] method[getHomeLocalImplClassName, return_type[type[String]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ivLocalHomeInterface], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[member[.ivVersion], ==, member[.EJB_1X]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Local interfaces are not supported "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="in EJB 1.x modules"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[StringBuffer], result] local_variable[type[String], packageName] if[binary_operation[member[.packageName], !=, literal[null]]] begin[{] call[result.append, parameter[member[.packageName]]] call[result.append, parameter[literal['.']]] else begin[{] None end[}] call[result.append, parameter[member[.homeLocalPrefix]]] if[binary_operation[member[.ivVersion], >=, member[.EJB_3X]]] begin[{] call[result.append, parameter[literal["C"]]] else begin[{] None end[}] call[result.append, parameter[member[.ivBeanType]]] call[result.append, parameter[member[.ivBeanName]]] call[result.append, parameter[literal["Home"]]] call[result.append, parameter[literal['_']]] call[result.append, parameter[member[.ivHashSuffix]]] return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getHomeLocalImplClassName] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ivLocalHomeInterface] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ivVersion] operator[==] identifier[EJB_1X] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[result] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[packageName] operator[=] identifier[packageName] operator[SEP] identifier[ivLocalInterface] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[packageName] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[homeLocalPrefix] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ivVersion] operator[>=] identifier[EJB_3X] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[ivBeanType] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[ivBeanName] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[ivHashSuffix] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static void validateNotEmpty( Properties propertiesToCheck, String argumentName ) throws NullArgumentException { validateNotNull( propertiesToCheck, argumentName ); if( propertiesToCheck.isEmpty() ) { throw new NullArgumentException( argumentName + IS_EMPTY ); } }
class class_name[name] begin[{] method[validateNotEmpty, return_type[void], modifier[public static], parameter[propertiesToCheck, argumentName]] begin[{] call[.validateNotNull, parameter[member[.propertiesToCheck], member[.argumentName]]] if[call[propertiesToCheck.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=argumentName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=IS_EMPTY, 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=NullArgumentException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[validateNotEmpty] operator[SEP] identifier[Properties] identifier[propertiesToCheck] , identifier[String] identifier[argumentName] operator[SEP] Keyword[throws] identifier[NullArgumentException] { identifier[validateNotNull] operator[SEP] identifier[propertiesToCheck] , identifier[argumentName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[propertiesToCheck] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullArgumentException] operator[SEP] identifier[argumentName] operator[+] identifier[IS_EMPTY] operator[SEP] operator[SEP] } }
private Collection<I_CmsWorkplaceAppConfiguration> loadLegacyApps() { List<I_CmsWorkplaceAppConfiguration> configs = new ArrayList<I_CmsWorkplaceAppConfiguration>(); // avoid accessing the workplace manager during test case if (OpenCms.getRunLevel() >= OpenCms.RUNLEVEL_2_INITIALIZING) { List<CmsTool> tools = OpenCms.getWorkplaceManager().getToolManager().getToolHandlers(); for (CmsTool tool : tools) { I_CmsToolHandler handler = tool.getHandler(); String path = handler.getPath(); // only collecting first path level tools if ((path.length() > 1) && (path.indexOf(CmsToolManager.TOOLPATH_SEPARATOR, 1) < 0)) { if (!LEGACY_BLACKLIST.contains(path)) { configs.add(new CmsLegacyAppConfiguration(handler)); } } } } return configs; }
class class_name[name] begin[{] method[loadLegacyApps, return_type[type[Collection]], modifier[private], parameter[]] begin[{] local_variable[type[List], configs] if[binary_operation[call[OpenCms.getRunLevel, parameter[]], >=, member[OpenCms.RUNLEVEL_2_INITIALIZING]]] begin[{] local_variable[type[List], tools] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getHandler, postfix_operators=[], prefix_operators=[], qualifier=tool, selectors=[], type_arguments=None), name=handler)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsToolHandler, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=TOOLPATH_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=CmsToolManager, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=LEGACY_BLACKLIST, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=handler, 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=CmsLegacyAppConfiguration, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=configs, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=tools, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tool)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsTool, sub_type=None))), label=None) else begin[{] None end[}] return[member[.configs]] end[}] END[}]
Keyword[private] identifier[Collection] operator[<] identifier[I_CmsWorkplaceAppConfiguration] operator[>] identifier[loadLegacyApps] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[I_CmsWorkplaceAppConfiguration] operator[>] identifier[configs] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[I_CmsWorkplaceAppConfiguration] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getRunLevel] operator[SEP] operator[SEP] operator[>=] identifier[OpenCms] operator[SEP] identifier[RUNLEVEL_2_INITIALIZING] operator[SEP] { identifier[List] operator[<] identifier[CmsTool] operator[>] identifier[tools] operator[=] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getToolManager] operator[SEP] operator[SEP] operator[SEP] identifier[getToolHandlers] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsTool] identifier[tool] operator[:] identifier[tools] operator[SEP] { identifier[I_CmsToolHandler] identifier[handler] operator[=] identifier[tool] operator[SEP] identifier[getHandler] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[path] operator[=] identifier[handler] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] operator[&&] operator[SEP] identifier[path] operator[SEP] identifier[indexOf] operator[SEP] identifier[CmsToolManager] operator[SEP] identifier[TOOLPATH_SEPARATOR] , Other[1] operator[SEP] operator[<] Other[0] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[LEGACY_BLACKLIST] operator[SEP] identifier[contains] operator[SEP] identifier[path] operator[SEP] operator[SEP] { identifier[configs] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsLegacyAppConfiguration] operator[SEP] identifier[handler] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[return] identifier[configs] operator[SEP] }
private CompletableFuture<Void> bind(ServerBootstrap bootstrap) { CompletableFuture<Void> future = new CompletableFuture<>(); int port = config.getPort() != null ? config.getPort() : returnAddress.port(); if (config.getInterfaces().isEmpty()) { bind(bootstrap, Lists.newArrayList("0.0.0.0").iterator(), port, future); } else { bind(bootstrap, config.getInterfaces().iterator(), port, future); } return future; }
class class_name[name] begin[{] method[bind, return_type[type[CompletableFuture]], modifier[private], parameter[bootstrap]] begin[{] local_variable[type[CompletableFuture], future] local_variable[type[int], port] if[call[config.getInterfaces, parameter[]]] begin[{] call[.bind, parameter[member[.bootstrap], call[Lists.newArrayList, parameter[literal["0.0.0.0"]]], member[.port], member[.future]]] else begin[{] call[.bind, parameter[member[.bootstrap], call[config.getInterfaces, parameter[]], member[.port], member[.future]]] end[}] return[member[.future]] end[}] END[}]
Keyword[private] identifier[CompletableFuture] operator[<] identifier[Void] operator[>] identifier[bind] operator[SEP] identifier[ServerBootstrap] identifier[bootstrap] operator[SEP] { identifier[CompletableFuture] operator[<] identifier[Void] operator[>] identifier[future] operator[=] Keyword[new] identifier[CompletableFuture] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[port] operator[=] identifier[config] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[!=] Other[null] operator[?] identifier[config] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[:] identifier[returnAddress] operator[SEP] identifier[port] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[getInterfaces] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[bind] operator[SEP] identifier[bootstrap] , identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] , identifier[port] , identifier[future] operator[SEP] operator[SEP] } Keyword[else] { identifier[bind] operator[SEP] identifier[bootstrap] , identifier[config] operator[SEP] identifier[getInterfaces] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] , identifier[port] , identifier[future] operator[SEP] operator[SEP] } Keyword[return] identifier[future] operator[SEP] }
@Override public AbstractIoBufferEx position(int newPosition) { autoExpand(newPosition, 0); buf().position(newPosition); if (mark > newPosition) { mark = -1; } return this; }
class class_name[name] begin[{] method[position, return_type[type[AbstractIoBufferEx]], modifier[public], parameter[newPosition]] begin[{] call[.autoExpand, parameter[member[.newPosition], literal[0]]] call[.buf, parameter[]] if[binary_operation[member[.mark], >, member[.newPosition]]] begin[{] assign[member[.mark], literal[1]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[AbstractIoBufferEx] identifier[position] operator[SEP] Keyword[int] identifier[newPosition] operator[SEP] { identifier[autoExpand] operator[SEP] identifier[newPosition] , Other[0] operator[SEP] operator[SEP] identifier[buf] operator[SEP] operator[SEP] operator[SEP] identifier[position] operator[SEP] identifier[newPosition] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mark] operator[>] identifier[newPosition] operator[SEP] { identifier[mark] operator[=] operator[-] Other[1] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private BytesRef computeMaximumFilteredPayload(String value, BytesRef payload, String filter) { // do magic with filter if (value != null) { if (payload != null) { Float payloadFloat = PayloadHelper.decodeFloat(payload.bytes, payload.offset); Float valueFloat = Float.parseFloat(value); return new BytesRef( PayloadHelper.encodeFloat(Math.max(payloadFloat, valueFloat))); } else { return new BytesRef(PayloadHelper.encodeFloat(Float.parseFloat(value))); } } else { return payload; } }
class class_name[name] begin[{] method[computeMaximumFilteredPayload, return_type[type[BytesRef]], modifier[private], parameter[value, payload, filter]] begin[{] if[binary_operation[member[.value], !=, literal[null]]] begin[{] if[binary_operation[member[.payload], !=, literal[null]]] begin[{] local_variable[type[Float], payloadFloat] local_variable[type[Float], valueFloat] return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=payloadFloat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueFloat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)], member=encodeFloat, postfix_operators=[], prefix_operators=[], qualifier=PayloadHelper, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BytesRef, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None)], member=encodeFloat, postfix_operators=[], prefix_operators=[], qualifier=PayloadHelper, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BytesRef, sub_type=None))] end[}] else begin[{] return[member[.payload]] end[}] end[}] END[}]
Keyword[private] identifier[BytesRef] identifier[computeMaximumFilteredPayload] operator[SEP] identifier[String] identifier[value] , identifier[BytesRef] identifier[payload] , identifier[String] identifier[filter] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[payload] operator[!=] Other[null] operator[SEP] { identifier[Float] identifier[payloadFloat] operator[=] identifier[PayloadHelper] operator[SEP] identifier[decodeFloat] operator[SEP] identifier[payload] operator[SEP] identifier[bytes] , identifier[payload] operator[SEP] identifier[offset] operator[SEP] operator[SEP] identifier[Float] identifier[valueFloat] operator[=] identifier[Float] operator[SEP] identifier[parseFloat] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[BytesRef] operator[SEP] identifier[PayloadHelper] operator[SEP] identifier[encodeFloat] operator[SEP] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[payloadFloat] , identifier[valueFloat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[BytesRef] operator[SEP] identifier[PayloadHelper] operator[SEP] identifier[encodeFloat] operator[SEP] identifier[Float] operator[SEP] identifier[parseFloat] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[return] identifier[payload] operator[SEP] } }
@Override public CommerceNotificationAttachment findByUUID_G(String uuid, long groupId) throws NoSuchNotificationAttachmentException { CommerceNotificationAttachment commerceNotificationAttachment = fetchByUUID_G(uuid, groupId); if (commerceNotificationAttachment == null) { StringBundler msg = new StringBundler(6); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("uuid="); msg.append(uuid); msg.append(", groupId="); msg.append(groupId); msg.append("}"); if (_log.isDebugEnabled()) { _log.debug(msg.toString()); } throw new NoSuchNotificationAttachmentException(msg.toString()); } return commerceNotificationAttachment; }
class class_name[name] begin[{] method[findByUUID_G, return_type[type[CommerceNotificationAttachment]], modifier[public], parameter[uuid, groupId]] begin[{] local_variable[type[CommerceNotificationAttachment], commerceNotificationAttachment] if[binary_operation[member[.commerceNotificationAttachment], ==, literal[null]]] begin[{] local_variable[type[StringBundler], msg] call[msg.append, parameter[member[._NO_SUCH_ENTITY_WITH_KEY]]] call[msg.append, parameter[literal["uuid="]]] call[msg.append, parameter[member[.uuid]]] call[msg.append, parameter[literal[", groupId="]]] call[msg.append, parameter[member[.groupId]]] call[msg.append, parameter[literal["}"]]] if[call[_log.isDebugEnabled, parameter[]]] begin[{] call[_log.debug, parameter[call[msg.toString, parameter[]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchNotificationAttachmentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.commerceNotificationAttachment]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceNotificationAttachment] identifier[findByUUID_G] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[groupId] operator[SEP] Keyword[throws] identifier[NoSuchNotificationAttachmentException] { identifier[CommerceNotificationAttachment] identifier[commerceNotificationAttachment] operator[=] identifier[fetchByUUID_G] operator[SEP] identifier[uuid] , identifier[groupId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceNotificationAttachment] operator[==] Other[null] operator[SEP] { identifier[StringBundler] identifier[msg] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[6] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_KEY] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[groupId] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[_log] operator[SEP] identifier[debug] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[NoSuchNotificationAttachmentException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[commerceNotificationAttachment] operator[SEP] }
public boolean waitForActive(long timeout) { LifecycleState state = getState(); if (state.isActive()) { return true; } else if (state.isAfterActive()) { return false; } // server/1d2j long waitEnd = CurrentTime.getCurrentTimeActual() + timeout; synchronized (this) { while ((state = _state).isBeforeActive() && CurrentTime.getCurrentTimeActual() < waitEnd) { if (state.isActive()) { return true; } else if (state.isAfterActive()) { return false; } try { long delta = waitEnd - CurrentTime.getCurrentTimeActual(); if (delta > 0) { wait(delta); } } catch (InterruptedException e) { } } } return _state.isActive(); }
class class_name[name] begin[{] method[waitForActive, return_type[type[boolean]], modifier[public], parameter[timeout]] begin[{] local_variable[type[LifecycleState], state] if[call[state.isActive, parameter[]]] begin[{] return[literal[true]] else begin[{] if[call[state.isAfterActive, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] end[}] local_variable[type[long], waitEnd] SYNCHRONIZED[THIS[]] BEGIN[{] while[binary_operation[assign[member[.state], member[._state]], &&, binary_operation[call[CurrentTime.getCurrentTimeActual, parameter[]], <, member[.waitEnd]]]] begin[{] if[call[state.isActive, parameter[]]] begin[{] return[literal[true]] else begin[{] if[call[state.isAfterActive, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=waitEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getCurrentTimeActual, postfix_operators=[], prefix_operators=[], qualifier=CurrentTime, selectors=[], type_arguments=None), operator=-), name=delta)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wait, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) end[}] END[}] return[call[_state.isActive, parameter[]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[waitForActive] operator[SEP] Keyword[long] identifier[timeout] operator[SEP] { identifier[LifecycleState] identifier[state] operator[=] identifier[getState] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[isAfterActive] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[long] identifier[waitEnd] operator[=] identifier[CurrentTime] operator[SEP] identifier[getCurrentTimeActual] operator[SEP] operator[SEP] operator[+] identifier[timeout] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[while] operator[SEP] operator[SEP] identifier[state] operator[=] identifier[_state] operator[SEP] operator[SEP] identifier[isBeforeActive] operator[SEP] operator[SEP] operator[&&] identifier[CurrentTime] operator[SEP] identifier[getCurrentTimeActual] operator[SEP] operator[SEP] operator[<] identifier[waitEnd] operator[SEP] { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[isAfterActive] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[try] { Keyword[long] identifier[delta] operator[=] identifier[waitEnd] operator[-] identifier[CurrentTime] operator[SEP] identifier[getCurrentTimeActual] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[delta] operator[>] Other[0] operator[SEP] { identifier[wait] operator[SEP] identifier[delta] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { } } } Keyword[return] identifier[_state] operator[SEP] identifier[isActive] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isReferenceProperty(final Node node, final String propertyName) throws RepositoryException { final Optional<PropertyDefinition> propertyDefinition = getDefinitionForPropertyName(node, propertyName); return propertyDefinition.isPresent() && (propertyDefinition.get().getRequiredType() == REFERENCE || propertyDefinition.get().getRequiredType() == WEAKREFERENCE); }
class class_name[name] begin[{] method[isReferenceProperty, return_type[type[boolean]], modifier[public static], parameter[node, propertyName]] begin[{] local_variable[type[Optional], propertyDefinition] return[binary_operation[call[propertyDefinition.isPresent, parameter[]], &&, binary_operation[binary_operation[call[propertyDefinition.get, parameter[]], ==, member[.REFERENCE]], ||, binary_operation[call[propertyDefinition.get, parameter[]], ==, member[.WEAKREFERENCE]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isReferenceProperty] operator[SEP] Keyword[final] identifier[Node] identifier[node] , Keyword[final] identifier[String] identifier[propertyName] operator[SEP] Keyword[throws] identifier[RepositoryException] { Keyword[final] identifier[Optional] operator[<] identifier[PropertyDefinition] operator[>] identifier[propertyDefinition] operator[=] identifier[getDefinitionForPropertyName] operator[SEP] identifier[node] , identifier[propertyName] operator[SEP] operator[SEP] Keyword[return] identifier[propertyDefinition] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[propertyDefinition] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getRequiredType] operator[SEP] operator[SEP] operator[==] identifier[REFERENCE] operator[||] identifier[propertyDefinition] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getRequiredType] operator[SEP] operator[SEP] operator[==] identifier[WEAKREFERENCE] operator[SEP] operator[SEP] }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T, R> Observable<R> zip(Iterable<? extends ObservableSource<? extends T>> sources, Function<? super Object[], ? extends R> zipper) { ObjectHelper.requireNonNull(zipper, "zipper is null"); ObjectHelper.requireNonNull(sources, "sources is null"); return RxJavaPlugins.onAssembly(new ObservableZip<T, R>(null, sources, zipper, bufferSize(), false)); }
class class_name[name] begin[{] method[zip, return_type[type[Observable]], modifier[public static], parameter[sources, zipper]] begin[{] call[ObjectHelper.requireNonNull, parameter[member[.zipper], literal["zipper is null"]]] call[ObjectHelper.requireNonNull, parameter[member[.sources], literal["sources is null"]]] return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=sources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=zipper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=bufferSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=None, name=ObservableZip, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[CheckReturnValue] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[R] operator[>] identifier[Observable] operator[<] identifier[R] operator[>] identifier[zip] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[ObservableSource] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] identifier[sources] , identifier[Function] operator[<] operator[?] Keyword[super] identifier[Object] operator[SEP] operator[SEP] , operator[?] Keyword[extends] identifier[R] operator[>] identifier[zipper] operator[SEP] { identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[zipper] , literal[String] operator[SEP] operator[SEP] identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[sources] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[ObservableZip] operator[<] identifier[T] , identifier[R] operator[>] operator[SEP] Other[null] , identifier[sources] , identifier[zipper] , identifier[bufferSize] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] }
@Override public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { String result = ""; if (value instanceof Entry) { result = ((Entry) value).getName(); } return result; }
class class_name[name] begin[{] method[convertValueToText, return_type[type[String]], modifier[public], parameter[value, selected, expanded, leaf, row, hasFocus]] begin[{] local_variable[type[String], result] if[binary_operation[member[.value], instanceof, type[Entry]]] begin[{] assign[member[.result], Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None))] else begin[{] None end[}] return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[convertValueToText] operator[SEP] identifier[Object] identifier[value] , Keyword[boolean] identifier[selected] , Keyword[boolean] identifier[expanded] , Keyword[boolean] identifier[leaf] , Keyword[int] identifier[row] , Keyword[boolean] identifier[hasFocus] operator[SEP] { identifier[String] identifier[result] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Entry] operator[SEP] { identifier[result] operator[=] operator[SEP] operator[SEP] identifier[Entry] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public void next(Action action, float prob,String depClass) { probsOfBuild[leftFocus] = prob; actionsOfBuild[leftFocus] = action; depClassOfBuild[leftFocus] = depClass; leftFocus++; if (leftFocus >= trees.size() - 1) { if (!isUpdated) { int maxIndex = 0; float maxValue = Float.NEGATIVE_INFINITY; for (int i = 0; i < probsOfBuild.length; i++) if (probsOfBuild[i] > maxValue) { maxValue = probsOfBuild[i]; maxIndex = i; } leftFocus = maxIndex; next(actionsOfBuild[leftFocus],depClassOfBuild[leftFocus]); } back(); } }
class class_name[name] begin[{] method[next, return_type[void], modifier[public], parameter[action, prob, depClass]] begin[{] assign[member[.probsOfBuild], member[.prob]] assign[member[.actionsOfBuild], member[.action]] assign[member[.depClassOfBuild], member[.depClass]] member[.leftFocus] if[binary_operation[member[.leftFocus], >=, binary_operation[call[trees.size, parameter[]], -, literal[1]]]] begin[{] if[member[.isUpdated]] begin[{] local_variable[type[int], maxIndex] local_variable[type[float], maxValue] ForStatement(body=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=probsOfBuild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=maxValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=probsOfBuild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=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=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=probsOfBuild, 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) assign[member[.leftFocus], member[.maxIndex]] call[.next, parameter[member[.actionsOfBuild], member[.depClassOfBuild]]] else begin[{] None end[}] call[.back, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[next] operator[SEP] identifier[Action] identifier[action] , Keyword[float] identifier[prob] , identifier[String] identifier[depClass] operator[SEP] { identifier[probsOfBuild] operator[SEP] identifier[leftFocus] operator[SEP] operator[=] identifier[prob] operator[SEP] identifier[actionsOfBuild] operator[SEP] identifier[leftFocus] operator[SEP] operator[=] identifier[action] operator[SEP] identifier[depClassOfBuild] operator[SEP] identifier[leftFocus] operator[SEP] operator[=] identifier[depClass] operator[SEP] identifier[leftFocus] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[leftFocus] operator[>=] identifier[trees] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isUpdated] operator[SEP] { Keyword[int] identifier[maxIndex] operator[=] Other[0] operator[SEP] Keyword[float] identifier[maxValue] operator[=] identifier[Float] operator[SEP] identifier[NEGATIVE_INFINITY] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[probsOfBuild] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[probsOfBuild] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[maxValue] operator[SEP] { identifier[maxValue] operator[=] identifier[probsOfBuild] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[maxIndex] operator[=] identifier[i] operator[SEP] } identifier[leftFocus] operator[=] identifier[maxIndex] operator[SEP] identifier[next] operator[SEP] identifier[actionsOfBuild] operator[SEP] identifier[leftFocus] operator[SEP] , identifier[depClassOfBuild] operator[SEP] identifier[leftFocus] operator[SEP] operator[SEP] operator[SEP] } identifier[back] operator[SEP] operator[SEP] operator[SEP] } }
public void setLimit(int lim) { if(0<=lim && lim<=rep.length()) { limit=lim; } else { limit=rep.length(); } reachedLimit=false; }
class class_name[name] begin[{] method[setLimit, return_type[void], modifier[public], parameter[lim]] begin[{] if[binary_operation[binary_operation[literal[0], <=, member[.lim]], &&, binary_operation[member[.lim], <=, call[rep.length, parameter[]]]]] begin[{] assign[member[.limit], member[.lim]] else begin[{] assign[member[.limit], call[rep.length, parameter[]]] end[}] assign[member[.reachedLimit], literal[false]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setLimit] operator[SEP] Keyword[int] identifier[lim] operator[SEP] { Keyword[if] operator[SEP] Other[0] operator[<=] identifier[lim] operator[&&] identifier[lim] operator[<=] identifier[rep] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[limit] operator[=] identifier[lim] operator[SEP] } Keyword[else] { identifier[limit] operator[=] identifier[rep] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } identifier[reachedLimit] operator[=] literal[boolean] operator[SEP] }
public int[] listStatisticsBySet(String statisticSet) { //System.out.println("&&&&& calling listStatisticsBySet "+statisticSet); if (statisticSet.equals(StatConstants.STATISTIC_SET_NONE) || statisticSet.equals(StatConstants.STATISTIC_SET_CUSTOM)) return new int[0]; int k = 0; if (statisticSet.equals(StatConstants.STATISTIC_SET_BASIC)) k = 1; else if (statisticSet.equals(StatConstants.STATISTIC_SET_EXTENDED)) k = 2; else if (statisticSet.equals(StatConstants.STATISTIC_SET_ALL)) k = 3; //System.out.println("perfData.values() for = "+this.getShortName()); //System.out.println("perfData.values() = "+perfData.values()); ArrayList list = new ArrayList(3); Iterator allData = perfData.values().iterator(); //System.out.println("&&& alldata ="+allData); while (allData.hasNext()) { PmiDataInfo dataInfo = (PmiDataInfo) allData.next(); //System.out.println("&&& dataInfo ="+dataInfo.getName()); String s = dataInfo.getStatisticSet(); if (s.equals(StatConstants.STATISTIC_SET_BASIC)) { if (k > 0) list.add(new Integer(dataInfo.getId())); } else if (s.equals(StatConstants.STATISTIC_SET_EXTENDED)) { if (k > 1) list.add(new Integer(dataInfo.getId())); } else if (s.equals(StatConstants.STATISTIC_SET_ALL)) { if (k > 2) list.add(new Integer(dataInfo.getId())); } } int[] statSet = new int[list.size()]; for (int i = 0; i < list.size(); i++) { statSet[i] = ((Integer) list.get(i)).intValue(); } return statSet; }
class class_name[name] begin[{] method[listStatisticsBySet, return_type[type[int]], modifier[public], parameter[statisticSet]] begin[{] if[binary_operation[call[statisticSet.equals, parameter[member[StatConstants.STATISTIC_SET_NONE]]], ||, call[statisticSet.equals, parameter[member[StatConstants.STATISTIC_SET_CUSTOM]]]]] begin[{] return[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))] else begin[{] None end[}] local_variable[type[int], k] if[call[statisticSet.equals, parameter[member[StatConstants.STATISTIC_SET_BASIC]]]] begin[{] assign[member[.k], literal[1]] else begin[{] if[call[statisticSet.equals, parameter[member[StatConstants.STATISTIC_SET_EXTENDED]]]] begin[{] assign[member[.k], literal[2]] else begin[{] if[call[statisticSet.equals, parameter[member[StatConstants.STATISTIC_SET_ALL]]]] begin[{] assign[member[.k], literal[3]] else begin[{] None end[}] end[}] end[}] local_variable[type[ArrayList], list] local_variable[type[Iterator], allData] while[call[allData.hasNext, parameter[]]] begin[{] local_variable[type[PmiDataInfo], dataInfo] local_variable[type[String], s] if[call[s.equals, parameter[member[StatConstants.STATISTIC_SET_BASIC]]]] begin[{] if[binary_operation[member[.k], >, literal[0]]] begin[{] call[list.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=dataInfo, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]] else begin[{] None end[}] else begin[{] if[call[s.equals, parameter[member[StatConstants.STATISTIC_SET_EXTENDED]]]] begin[{] if[binary_operation[member[.k], >, literal[1]]] begin[{] call[list.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=dataInfo, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]] else begin[{] None end[}] else begin[{] if[call[s.equals, parameter[member[StatConstants.STATISTIC_SET_ALL]]]] begin[{] if[binary_operation[member[.k], >, literal[2]]] begin[{] call[list.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=dataInfo, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] end[}] local_variable[type[int], statSet] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=statSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=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=list, 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[.statSet]] end[}] END[}]
Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[listStatisticsBySet] operator[SEP] identifier[String] identifier[statisticSet] operator[SEP] { Keyword[if] operator[SEP] identifier[statisticSet] operator[SEP] identifier[equals] operator[SEP] identifier[StatConstants] operator[SEP] identifier[STATISTIC_SET_NONE] operator[SEP] operator[||] identifier[statisticSet] operator[SEP] identifier[equals] operator[SEP] identifier[StatConstants] operator[SEP] identifier[STATISTIC_SET_CUSTOM] operator[SEP] operator[SEP] Keyword[return] Keyword[new] Keyword[int] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[statisticSet] operator[SEP] identifier[equals] operator[SEP] identifier[StatConstants] operator[SEP] identifier[STATISTIC_SET_BASIC] operator[SEP] operator[SEP] identifier[k] operator[=] Other[1] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[statisticSet] operator[SEP] identifier[equals] operator[SEP] identifier[StatConstants] operator[SEP] identifier[STATISTIC_SET_EXTENDED] operator[SEP] operator[SEP] identifier[k] operator[=] Other[2] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[statisticSet] operator[SEP] identifier[equals] operator[SEP] identifier[StatConstants] operator[SEP] identifier[STATISTIC_SET_ALL] operator[SEP] operator[SEP] identifier[k] operator[=] Other[3] operator[SEP] identifier[ArrayList] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[Iterator] identifier[allData] operator[=] identifier[perfData] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[allData] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[PmiDataInfo] identifier[dataInfo] operator[=] operator[SEP] identifier[PmiDataInfo] operator[SEP] identifier[allData] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[s] operator[=] identifier[dataInfo] operator[SEP] identifier[getStatisticSet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[equals] operator[SEP] identifier[StatConstants] operator[SEP] identifier[STATISTIC_SET_BASIC] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[k] operator[>] Other[0] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Integer] operator[SEP] identifier[dataInfo] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[equals] operator[SEP] identifier[StatConstants] operator[SEP] identifier[STATISTIC_SET_EXTENDED] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[k] operator[>] Other[1] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Integer] operator[SEP] identifier[dataInfo] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[equals] operator[SEP] identifier[StatConstants] operator[SEP] identifier[STATISTIC_SET_ALL] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[k] operator[>] Other[2] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Integer] operator[SEP] identifier[dataInfo] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[int] operator[SEP] operator[SEP] identifier[statSet] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[list] 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[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[statSet] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[list] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[statSet] operator[SEP] }
@Override public void init(final FilterConfig filterConfig) throws ServletException { super.init(filterConfig); configUrl = filterConfig.getInitParameter("xslt"); if ((configUrl != null) && debug()) { debug("Filter " + filterConfig.getFilterName() + " using xslt " + configUrl); } String temp = filterConfig.getInitParameter("ignoreContentType"); ignoreContentType = "true".equals(temp); }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[filterConfig]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=filterConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) assign[member[.configUrl], call[filterConfig.getInitParameter, parameter[literal["xslt"]]]] if[binary_operation[binary_operation[member[.configUrl], !=, literal[null]], &&, call[.debug, parameter[]]]] begin[{] call[.debug, parameter[binary_operation[binary_operation[binary_operation[literal["Filter "], +, call[filterConfig.getFilterName, parameter[]]], +, literal[" using xslt "]], +, member[.configUrl]]]] else begin[{] None end[}] local_variable[type[String], temp] assign[member[.ignoreContentType], literal["true"]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[init] operator[SEP] Keyword[final] identifier[FilterConfig] identifier[filterConfig] operator[SEP] Keyword[throws] identifier[ServletException] { Keyword[super] operator[SEP] identifier[init] operator[SEP] identifier[filterConfig] operator[SEP] operator[SEP] identifier[configUrl] operator[=] identifier[filterConfig] operator[SEP] identifier[getInitParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[configUrl] operator[!=] Other[null] operator[SEP] operator[&&] identifier[debug] operator[SEP] operator[SEP] operator[SEP] { identifier[debug] operator[SEP] literal[String] operator[+] identifier[filterConfig] operator[SEP] identifier[getFilterName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[configUrl] operator[SEP] operator[SEP] } identifier[String] identifier[temp] operator[=] identifier[filterConfig] operator[SEP] identifier[getInitParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ignoreContentType] operator[=] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[temp] operator[SEP] operator[SEP] }
public void marshall(VideoCodecSettings videoCodecSettings, ProtocolMarshaller protocolMarshaller) { if (videoCodecSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(videoCodecSettings.getCodec(), CODEC_BINDING); protocolMarshaller.marshall(videoCodecSettings.getFrameCaptureSettings(), FRAMECAPTURESETTINGS_BINDING); protocolMarshaller.marshall(videoCodecSettings.getH264Settings(), H264SETTINGS_BINDING); protocolMarshaller.marshall(videoCodecSettings.getH265Settings(), H265SETTINGS_BINDING); protocolMarshaller.marshall(videoCodecSettings.getMpeg2Settings(), MPEG2SETTINGS_BINDING); protocolMarshaller.marshall(videoCodecSettings.getProresSettings(), PRORESSETTINGS_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[videoCodecSettings, protocolMarshaller]] begin[{] if[binary_operation[member[.videoCodecSettings], ==, 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=getCodec, postfix_operators=[], prefix_operators=[], qualifier=videoCodecSettings, selectors=[], type_arguments=None), MemberReference(member=CODEC_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFrameCaptureSettings, postfix_operators=[], prefix_operators=[], qualifier=videoCodecSettings, selectors=[], type_arguments=None), MemberReference(member=FRAMECAPTURESETTINGS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getH264Settings, postfix_operators=[], prefix_operators=[], qualifier=videoCodecSettings, selectors=[], type_arguments=None), MemberReference(member=H264SETTINGS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getH265Settings, postfix_operators=[], prefix_operators=[], qualifier=videoCodecSettings, selectors=[], type_arguments=None), MemberReference(member=H265SETTINGS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMpeg2Settings, postfix_operators=[], prefix_operators=[], qualifier=videoCodecSettings, selectors=[], type_arguments=None), MemberReference(member=MPEG2SETTINGS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProresSettings, postfix_operators=[], prefix_operators=[], qualifier=videoCodecSettings, selectors=[], type_arguments=None), MemberReference(member=PRORESSETTINGS_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[VideoCodecSettings] identifier[videoCodecSettings] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[videoCodecSettings] 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[videoCodecSettings] operator[SEP] identifier[getCodec] operator[SEP] operator[SEP] , identifier[CODEC_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[videoCodecSettings] operator[SEP] identifier[getFrameCaptureSettings] operator[SEP] operator[SEP] , identifier[FRAMECAPTURESETTINGS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[videoCodecSettings] operator[SEP] identifier[getH264Settings] operator[SEP] operator[SEP] , identifier[H264SETTINGS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[videoCodecSettings] operator[SEP] identifier[getH265Settings] operator[SEP] operator[SEP] , identifier[H265SETTINGS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[videoCodecSettings] operator[SEP] identifier[getMpeg2Settings] operator[SEP] operator[SEP] , identifier[MPEG2SETTINGS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[videoCodecSettings] operator[SEP] identifier[getProresSettings] operator[SEP] operator[SEP] , identifier[PRORESSETTINGS_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] } }
String gini_GetEntityID(int ent_id) { String name; switch (ent_id) { case 2: name = "Miscellaneous"; break; case 3: name = "JERS"; break; case 4: name ="ERS/QuikSCAT/Scatterometer"; break; case 5: name = "POES/NPOESS"; break; case 6: name = "Composite"; break; case 7: name = "DMSP satellite Image"; break; case 8: name = "GMS satellite Image"; break; case 9: name = "METEOSAT satellite Image"; break; case 10: name = "GOES-7 satellite Image"; break; case 11: name = "GOES-8 satellite Image"; break; case 12: name = "GOES-9 satellite Image"; break; case 13: name = "GOES-10 satellite Image"; break; case 14: name = "GOES-11 satellite Image"; break; case 15: name = "GOES-12 satellite Image"; break; case 16: name = "GOES-13 satellite Image"; break; case 17: name = "GOES-14 satellite Image"; break; case 18: name = "GOES-15 satellite Image"; break; case 19: // GOES-R name = "GOES-16 satellite Image"; break; case 99: // special snowflake GEMPAK Composite Images generated by Unidata name = "RADAR-MOSIAC Composite Image"; break; default: name = "Unknown"; } return name; }
class class_name[name] begin[{] method[gini_GetEntityID, return_type[type[String]], modifier[default], parameter[ent_id]] begin[{] local_variable[type[String], name] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Miscellaneous")), 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=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="JERS")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ERS/QuikSCAT/Scatterometer")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="POES/NPOESS")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Composite")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DMSP satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GMS satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=9)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="METEOSAT satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GOES-7 satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=11)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GOES-8 satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GOES-9 satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=13)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GOES-10 satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=14)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GOES-11 satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=15)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GOES-12 satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GOES-13 satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=17)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GOES-14 satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=18)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GOES-15 satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=19)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GOES-16 satellite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=99)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="RADAR-MOSIAC Composite Image")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown")), label=None)])], expression=MemberReference(member=ent_id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[member[.name]] end[}] END[}]
identifier[String] identifier[gini_GetEntityID] operator[SEP] Keyword[int] identifier[ent_id] operator[SEP] { identifier[String] identifier[name] operator[SEP] Keyword[switch] operator[SEP] identifier[ent_id] operator[SEP] { Keyword[case] Other[2] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[4] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[5] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[6] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[7] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[8] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[9] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[10] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[11] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[12] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[13] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[14] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[15] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[16] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[17] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[18] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[19] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[99] operator[:] identifier[name] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[name] operator[=] literal[String] operator[SEP] } Keyword[return] identifier[name] operator[SEP] }
public static ObjectId readObjectId(byte[] bytes) { // Compute the values in big-endian ... int time = ((bytes[0] & 0xff) << 24) + ((bytes[1] & 0xff) << 16) + ((bytes[2] & 0xff) << 8) + ((bytes[3] & 0xff) << 0); int machine = ((bytes[4] & 0xff) << 16) + ((bytes[5] & 0xff) << 8) + ((bytes[6] & 0xff) << 0); int process = ((bytes[7] & 0xff) << 8) + ((bytes[8] & 0xff) << 0); int inc = ((bytes[9] & 0xff) << 16) + ((bytes[10] & 0xff) << 8) + ((bytes[11] & 0xff) << 0); // Create the value object ... return new ObjectId(time, machine, process, inc); }
class class_name[name] begin[{] method[readObjectId, return_type[type[ObjectId]], modifier[public static], parameter[bytes]] begin[{] local_variable[type[int], time] local_variable[type[int], machine] local_variable[type[int], process] local_variable[type[int], inc] return[ClassCreator(arguments=[MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=machine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inc, 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=ObjectId, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ObjectId] identifier[readObjectId] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] { Keyword[int] identifier[time] operator[=] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[0] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[24] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[2] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[3] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[machine] operator[=] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[4] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[5] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[6] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[process] operator[=] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[7] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[inc] operator[=] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[9] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[10] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Other[11] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[0] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ObjectId] operator[SEP] identifier[time] , identifier[machine] , identifier[process] , identifier[inc] operator[SEP] operator[SEP] }
public Token scanCharacterConstant() { int start = pos; pos++; char c = input.charAt(pos++); if (c == '\\') { // escape code switch (input.charAt(pos++)) { case 'b': c = '\b'; break; case 't': c = '\t'; break; case 'n': c = '\n'; break; case 'f': c = '\f'; break; case 'r': c = '\r'; break; case '"': c = '\"'; break; case '\'': c = '\''; break; case '\\': c = '\\'; break; default: syntaxError("unrecognised escape character", pos); } } if (input.charAt(pos) != '\'') { syntaxError("unexpected end-of-character", pos); } pos = pos + 1; return new Token(Token.Kind.CharValue, input.substring(start, pos), start); }
class class_name[name] begin[{] method[scanCharacterConstant, return_type[type[Token]], modifier[public], parameter[]] begin[{] local_variable[type[int], start] member[.pos] local_variable[type[char], c] if[binary_operation[member[.c], ==, literal['\\']]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='b')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\b')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='t')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='n')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\f')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='r')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='"')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\"')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unrecognised escape character"), MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=syntaxError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] if[binary_operation[call[input.charAt, parameter[member[.pos]]], !=, literal['\'']]] begin[{] call[.syntaxError, parameter[literal["unexpected end-of-character"], member[.pos]]] else begin[{] None end[}] assign[member[.pos], binary_operation[member[.pos], +, literal[1]]] return[ClassCreator(arguments=[MemberReference(member=CharValue, postfix_operators=[], prefix_operators=[], qualifier=Token.Kind, selectors=[]), MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=start, 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=Token, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Token] identifier[scanCharacterConstant] operator[SEP] operator[SEP] { Keyword[int] identifier[start] operator[=] identifier[pos] operator[SEP] identifier[pos] operator[++] operator[SEP] Keyword[char] identifier[c] operator[=] identifier[input] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[switch] operator[SEP] identifier[input] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[SEP] { Keyword[case] literal[String] operator[:] identifier[c] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[c] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[c] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[c] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[c] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[c] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[c] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[c] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[syntaxError] operator[SEP] literal[String] , identifier[pos] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[!=] literal[String] operator[SEP] { identifier[syntaxError] operator[SEP] literal[String] , identifier[pos] operator[SEP] operator[SEP] } identifier[pos] operator[=] identifier[pos] operator[+] Other[1] operator[SEP] Keyword[return] Keyword[new] identifier[Token] operator[SEP] identifier[Token] operator[SEP] identifier[Kind] operator[SEP] identifier[CharValue] , identifier[input] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[pos] operator[SEP] , identifier[start] operator[SEP] operator[SEP] }