code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
private String getInClause(String[] fields) { StringBuilder builder = new StringBuilder("( "); if (fields.length != 0) { for (int i = 0; i < fields.length; i++) { builder.append("'"); builder.append(fields[i]); builder.append("'"); if (i != fields.length - 1) { builder.append(" , "); } } } builder.append(" )"); return builder.toString(); }
class class_name[name] begin[{] method[getInClause, return_type[type[String]], modifier[private], parameter[fields]] begin[{] local_variable[type[StringBuilder], builder] if[binary_operation[member[fields.length], !=, literal[0]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'")], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'")], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" , ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, 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=fields, 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[}] call[builder.append, parameter[literal[" )"]]] return[call[builder.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[getInClause] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[fields] operator[SEP] { identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fields] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[fields] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[fields] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[!=] identifier[fields] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } } identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static TransactionException invalidLabelStart(Label label) { return create(String.format("Cannot create a label {%s} starting with character {%s} as it is a reserved starting character", label, Schema.ImplicitType.RESERVED.getValue())); }
class class_name[name] begin[{] method[invalidLabelStart, return_type[type[TransactionException]], modifier[public static], parameter[label]] begin[{] return[call[.create, parameter[call[String.format, parameter[literal["Cannot create a label {%s} starting with character {%s} as it is a reserved starting character"], member[.label], call[Schema.ImplicitType.RESERVED.getValue, parameter[]]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[TransactionException] identifier[invalidLabelStart] operator[SEP] identifier[Label] identifier[label] operator[SEP] { Keyword[return] identifier[create] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[label] , identifier[Schema] operator[SEP] identifier[ImplicitType] operator[SEP] identifier[RESERVED] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void publishLocalEvent(String cacheId, Object eventData, Extractors extractors) { Collection<EventRegistration> eventRegistrations = getRegistrations(cacheId); if (eventRegistrations.isEmpty()) { return; } for (EventRegistration eventRegistration : eventRegistrations) { Registration registration = (Registration) eventRegistration; Object listener = registration.getListener(); if (!(listener instanceof QueryCacheListenerAdapter)) { continue; } Object eventDataToPublish = eventData; int orderKey = -1; if (eventDataToPublish instanceof LocalCacheWideEventData) { orderKey = cacheId.hashCode(); } else if (eventDataToPublish instanceof LocalEntryEventData) { LocalEntryEventData localEntryEventData = (LocalEntryEventData) eventDataToPublish; if (localEntryEventData.getEventType() != EventLostEvent.EVENT_TYPE) { EventFilter filter = registration.getFilter(); if (!canPassFilter(localEntryEventData, filter, extractors)) { continue; } else { boolean includeValue = isIncludeValue(filter); eventDataToPublish = includeValue ? localEntryEventData : localEntryEventData.cloneWithoutValue(); Data keyData = localEntryEventData.getKeyData(); orderKey = keyData == null ? -1 : keyData.hashCode(); } } } publishEventInternal(registration, eventDataToPublish, orderKey); } }
class class_name[name] begin[{] method[publishLocalEvent, return_type[void], modifier[private], parameter[cacheId, eventData, extractors]] begin[{] local_variable[type[Collection], eventRegistrations] if[call[eventRegistrations.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=eventRegistration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Registration, sub_type=None)), name=registration)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Registration, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getListener, postfix_operators=[], prefix_operators=[], qualifier=registration, selectors=[], type_arguments=None), name=listener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=QueryCacheListenerAdapter, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=eventData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=eventDataToPublish)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=orderKey)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=eventDataToPublish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=LocalCacheWideEventData, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=eventDataToPublish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=LocalEntryEventData, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=eventDataToPublish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LocalEntryEventData, sub_type=None)), name=localEntryEventData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LocalEntryEventData, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEventType, postfix_operators=[], prefix_operators=[], qualifier=localEntryEventData, selectors=[], type_arguments=None), operandr=MemberReference(member=EVENT_TYPE, postfix_operators=[], prefix_operators=[], qualifier=EventLostEvent, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFilter, postfix_operators=[], prefix_operators=[], qualifier=registration, selectors=[], type_arguments=None), name=filter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EventFilter, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=localEntryEventData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=extractors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=canPassFilter, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isIncludeValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=includeValue)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=eventDataToPublish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MemberReference(member=includeValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=cloneWithoutValue, postfix_operators=[], prefix_operators=[], qualifier=localEntryEventData, selectors=[], type_arguments=None), if_true=MemberReference(member=localEntryEventData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKeyData, postfix_operators=[], prefix_operators=[], qualifier=localEntryEventData, selectors=[], type_arguments=None), name=keyData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Data, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=orderKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=keyData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=hashCode, postfix_operators=[], prefix_operators=[], qualifier=keyData, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)]))]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=orderKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=hashCode, postfix_operators=[], prefix_operators=[], qualifier=cacheId, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=registration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=eventDataToPublish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orderKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=publishEventInternal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=eventRegistrations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=eventRegistration)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EventRegistration, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[publishLocalEvent] operator[SEP] identifier[String] identifier[cacheId] , identifier[Object] identifier[eventData] , identifier[Extractors] identifier[extractors] operator[SEP] { identifier[Collection] operator[<] identifier[EventRegistration] operator[>] identifier[eventRegistrations] operator[=] identifier[getRegistrations] operator[SEP] identifier[cacheId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eventRegistrations] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[for] operator[SEP] identifier[EventRegistration] identifier[eventRegistration] operator[:] identifier[eventRegistrations] operator[SEP] { identifier[Registration] identifier[registration] operator[=] operator[SEP] identifier[Registration] operator[SEP] identifier[eventRegistration] operator[SEP] identifier[Object] identifier[listener] operator[=] identifier[registration] operator[SEP] identifier[getListener] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[listener] Keyword[instanceof] identifier[QueryCacheListenerAdapter] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[Object] identifier[eventDataToPublish] operator[=] identifier[eventData] operator[SEP] Keyword[int] identifier[orderKey] operator[=] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[eventDataToPublish] Keyword[instanceof] identifier[LocalCacheWideEventData] operator[SEP] { identifier[orderKey] operator[=] identifier[cacheId] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[eventDataToPublish] Keyword[instanceof] identifier[LocalEntryEventData] operator[SEP] { identifier[LocalEntryEventData] identifier[localEntryEventData] operator[=] operator[SEP] identifier[LocalEntryEventData] operator[SEP] identifier[eventDataToPublish] operator[SEP] Keyword[if] operator[SEP] identifier[localEntryEventData] operator[SEP] identifier[getEventType] operator[SEP] operator[SEP] operator[!=] identifier[EventLostEvent] operator[SEP] identifier[EVENT_TYPE] operator[SEP] { identifier[EventFilter] identifier[filter] operator[=] identifier[registration] operator[SEP] identifier[getFilter] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[canPassFilter] operator[SEP] identifier[localEntryEventData] , identifier[filter] , identifier[extractors] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[else] { Keyword[boolean] identifier[includeValue] operator[=] identifier[isIncludeValue] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[eventDataToPublish] operator[=] identifier[includeValue] operator[?] identifier[localEntryEventData] operator[:] identifier[localEntryEventData] operator[SEP] identifier[cloneWithoutValue] operator[SEP] operator[SEP] operator[SEP] identifier[Data] identifier[keyData] operator[=] identifier[localEntryEventData] operator[SEP] identifier[getKeyData] operator[SEP] operator[SEP] operator[SEP] identifier[orderKey] operator[=] identifier[keyData] operator[==] Other[null] operator[?] operator[-] Other[1] operator[:] identifier[keyData] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] } } } identifier[publishEventInternal] operator[SEP] identifier[registration] , identifier[eventDataToPublish] , identifier[orderKey] operator[SEP] operator[SEP] } }
private void updateEntityAndLang(final File inputFile) { //directory case if (inputFile.isDirectory()) { final File[] files = inputFile.listFiles(); if (files != null) { for (final File file : files) { updateEntityAndLang(file); } } } //html file case else if (FileUtils.isHTMLFile(inputFile.getName())) { //do converting work convertEntityAndCharset(inputFile, ATTRIBUTE_FORMAT_VALUE_HTML); } //hhp/hhc/hhk file case else if (FileUtils.isHHPFile(inputFile.getName()) || FileUtils.isHHCFile(inputFile.getName()) || FileUtils.isHHKFile(inputFile.getName())) { //do converting work convertEntityAndCharset(inputFile, ATTRIBUTE_FORMAT_VALUE_WINDOWS); //update language setting of hhp file final String fileName = inputFile.getAbsolutePath(); final File outputFile = new File(fileName + FILE_EXTENSION_TEMP); //get new charset final String charset = charsetMap.get(ATTRIBUTE_FORMAT_VALUE_WINDOWS); BufferedReader reader = null; BufferedWriter writer = null; try { //prepare for the input and output final FileInputStream inputStream = new FileInputStream(inputFile); final InputStreamReader streamReader = new InputStreamReader(inputStream, charset); //wrapped into reader reader = new BufferedReader(streamReader); final FileOutputStream outputStream = new FileOutputStream(outputFile); //convert charset final OutputStreamWriter streamWriter = new OutputStreamWriter(outputStream, charset); //wrapped into writer writer = new BufferedWriter(streamWriter); String value = reader.readLine(); while(value != null) { if (value.contains(tag1)) { value = replaceXmlTag(value, tag1); } else if (value.contains(tag2)) { value = replaceXmlTag(value, tag2); } else if (value.contains(tag3)) { value = replaceXmlTag(value, tag3); } //meta tag contains charset found if (value.contains("Language=")) { String newValue = langMap.get(langcode); if (newValue == null) { newValue = langMap.get(langcode.split("-")[0]); } if (newValue != null) { writer.write("Language=" + newValue); writer.write(LINE_SEPARATOR); } else { throw new IllegalArgumentException("Unsupported language code '" + langcode + "', unable to map to a Locale ID."); } } else { //other values writer.write(value); writer.write(LINE_SEPARATOR); } value = reader.readLine(); } } catch (final FileNotFoundException e) { logger.error(e.getMessage(), e) ; } catch (final UnsupportedEncodingException e) { throw new RuntimeException(e); } catch (final IOException e) { logger.error(e.getMessage(), e) ; } finally { if (reader != null) { try { reader.close(); } catch (final IOException e) { logger.error("Failed to close input stream: " + e.getMessage()); } } if (writer != null) { try { writer.close(); } catch (final IOException e) { logger.error("Failed to close output stream: " + e.getMessage()); } } } try { deleteQuietly(inputFile); moveFile(outputFile, inputFile); } catch (final Exception e) { logger.error("Failed to replace " + inputFile + ": " + e.getMessage()); } } }
class class_name[name] begin[{] method[updateEntityAndLang, return_type[void], modifier[private], parameter[inputFile]] begin[{] if[call[inputFile.isDirectory, parameter[]]] begin[{] local_variable[type[File], files] if[binary_operation[member[.files], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateEntityAndLang, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=file)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None) else begin[{] None end[}] else begin[{] if[call[FileUtils.isHTMLFile, parameter[call[inputFile.getName, parameter[]]]]] begin[{] call[.convertEntityAndCharset, parameter[member[.inputFile], member[.ATTRIBUTE_FORMAT_VALUE_HTML]]] else begin[{] if[binary_operation[binary_operation[call[FileUtils.isHHPFile, parameter[call[inputFile.getName, parameter[]]]], ||, call[FileUtils.isHHCFile, parameter[call[inputFile.getName, parameter[]]]]], ||, call[FileUtils.isHHKFile, parameter[call[inputFile.getName, parameter[]]]]]] begin[{] call[.convertEntityAndCharset, parameter[member[.inputFile], member[.ATTRIBUTE_FORMAT_VALUE_WINDOWS]]] local_variable[type[String], fileName] local_variable[type[File], outputFile] local_variable[type[String], charset] local_variable[type[BufferedReader], reader] local_variable[type[BufferedWriter], writer] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=inputFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None)), name=inputStream)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=charset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None)), name=streamReader)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=InputStreamReader, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=streamReader, 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=BufferedReader, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=outputFile, 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=FileOutputStream, sub_type=None)), name=outputStream)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=outputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=charset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OutputStreamWriter, sub_type=None)), name=streamWriter)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=OutputStreamWriter, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=streamWriter, 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=BufferedWriter, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tag1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tag2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tag3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tag3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=replaceXmlTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tag2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=replaceXmlTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tag1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=replaceXmlTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Language=")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LINE_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=langcode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=langMap, selectors=[], type_arguments=None), name=newValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=split, postfix_operators=[], prefix_operators=[], qualifier=langcode, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=langMap, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported language code '"), operandr=MemberReference(member=langcode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="', unable to map to a Locale ID."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Language="), operandr=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LINE_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException'])), 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=['UnsupportedEncodingException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to close input stream: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, 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)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to close output stream: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)]))], label=None, resources=None) TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=inputFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteQuietly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=outputFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inputFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=moveFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to replace "), operandr=MemberReference(member=inputFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, 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) else begin[{] None end[}] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[updateEntityAndLang] operator[SEP] Keyword[final] identifier[File] identifier[inputFile] operator[SEP] { Keyword[if] operator[SEP] identifier[inputFile] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[File] operator[SEP] operator[SEP] identifier[files] operator[=] identifier[inputFile] operator[SEP] identifier[listFiles] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[files] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[File] identifier[file] operator[:] identifier[files] operator[SEP] { identifier[updateEntityAndLang] operator[SEP] identifier[file] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[FileUtils] operator[SEP] identifier[isHTMLFile] operator[SEP] identifier[inputFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[convertEntityAndCharset] operator[SEP] identifier[inputFile] , identifier[ATTRIBUTE_FORMAT_VALUE_HTML] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[FileUtils] operator[SEP] identifier[isHHPFile] operator[SEP] identifier[inputFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[FileUtils] operator[SEP] identifier[isHHCFile] operator[SEP] identifier[inputFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[FileUtils] operator[SEP] identifier[isHHKFile] operator[SEP] identifier[inputFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[convertEntityAndCharset] operator[SEP] identifier[inputFile] , identifier[ATTRIBUTE_FORMAT_VALUE_WINDOWS] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[fileName] operator[=] identifier[inputFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[outputFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[fileName] operator[+] identifier[FILE_EXTENSION_TEMP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[charset] operator[=] identifier[charsetMap] operator[SEP] identifier[get] operator[SEP] identifier[ATTRIBUTE_FORMAT_VALUE_WINDOWS] operator[SEP] operator[SEP] identifier[BufferedReader] identifier[reader] operator[=] Other[null] operator[SEP] identifier[BufferedWriter] identifier[writer] operator[=] Other[null] operator[SEP] Keyword[try] { Keyword[final] identifier[FileInputStream] identifier[inputStream] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[inputFile] operator[SEP] operator[SEP] Keyword[final] identifier[InputStreamReader] identifier[streamReader] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[inputStream] , identifier[charset] operator[SEP] operator[SEP] identifier[reader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] identifier[streamReader] operator[SEP] operator[SEP] Keyword[final] identifier[FileOutputStream] identifier[outputStream] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[outputFile] operator[SEP] operator[SEP] Keyword[final] identifier[OutputStreamWriter] identifier[streamWriter] operator[=] Keyword[new] identifier[OutputStreamWriter] operator[SEP] identifier[outputStream] , identifier[charset] operator[SEP] operator[SEP] identifier[writer] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] identifier[streamWriter] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] identifier[reader] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[contains] operator[SEP] identifier[tag1] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[replaceXmlTag] operator[SEP] identifier[value] , identifier[tag1] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[contains] operator[SEP] identifier[tag2] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[replaceXmlTag] operator[SEP] identifier[value] , identifier[tag2] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[contains] operator[SEP] identifier[tag3] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[replaceXmlTag] operator[SEP] identifier[value] , identifier[tag3] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[newValue] operator[=] identifier[langMap] operator[SEP] identifier[get] operator[SEP] identifier[langcode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newValue] operator[==] Other[null] operator[SEP] { identifier[newValue] operator[=] identifier[langMap] operator[SEP] identifier[get] operator[SEP] identifier[langcode] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[newValue] operator[!=] Other[null] operator[SEP] { identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[+] identifier[newValue] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[LINE_SEPARATOR] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[langcode] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] { identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[LINE_SEPARATOR] operator[SEP] operator[SEP] } identifier[value] operator[=] identifier[reader] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[FileNotFoundException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[reader] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[reader] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[writer] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[writer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[try] { identifier[deleteQuietly] operator[SEP] identifier[inputFile] operator[SEP] operator[SEP] identifier[moveFile] operator[SEP] identifier[outputFile] , identifier[inputFile] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[inputFile] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
@Override public String getEntityDefinitionJson(String guid) throws AtlasException { guid = ParamChecker.notEmpty(guid, "entity id"); final ITypedReferenceableInstance instance = repository.getEntityDefinition(guid); return InstanceSerialization.toJson(instance, true); }
class class_name[name] begin[{] method[getEntityDefinitionJson, return_type[type[String]], modifier[public], parameter[guid]] begin[{] assign[member[.guid], call[ParamChecker.notEmpty, parameter[member[.guid], literal["entity id"]]]] local_variable[type[ITypedReferenceableInstance], instance] return[call[InstanceSerialization.toJson, parameter[member[.instance], literal[true]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getEntityDefinitionJson] operator[SEP] identifier[String] identifier[guid] operator[SEP] Keyword[throws] identifier[AtlasException] { identifier[guid] operator[=] identifier[ParamChecker] operator[SEP] identifier[notEmpty] operator[SEP] identifier[guid] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[ITypedReferenceableInstance] identifier[instance] operator[=] identifier[repository] operator[SEP] identifier[getEntityDefinition] operator[SEP] identifier[guid] operator[SEP] operator[SEP] Keyword[return] identifier[InstanceSerialization] operator[SEP] identifier[toJson] operator[SEP] identifier[instance] , literal[boolean] operator[SEP] operator[SEP] }
public static Map<String, String> readProperties(CmsObject cms, I_CmsXmlContentLocation baseLocation) { Map<String, String> result = new HashMap<String, String>(); String elementName = CmsXmlContentProperty.XmlNode.Properties.name(); String nameElementName = CmsXmlContentProperty.XmlNode.Name.name(); List<I_CmsXmlContentValueLocation> propertyLocations = baseLocation.getSubValues(elementName); for (I_CmsXmlContentValueLocation propertyLocation : propertyLocations) { I_CmsXmlContentValueLocation nameLocation = propertyLocation.getSubValue(nameElementName); String name = nameLocation.asString(cms).trim(); String value = null; I_CmsXmlContentValueLocation valueLocation = propertyLocation.getSubValue( CmsXmlContentProperty.XmlNode.Value.name()); I_CmsXmlContentValueLocation stringLocation = valueLocation.getSubValue( CmsXmlContentProperty.XmlNode.String.name()); I_CmsXmlContentValueLocation fileListLocation = valueLocation.getSubValue( CmsXmlContentProperty.XmlNode.FileList.name()); if (stringLocation != null) { value = stringLocation.asString(cms).trim(); } else if (fileListLocation != null) { List<CmsUUID> idList = new ArrayList<CmsUUID>(); List<I_CmsXmlContentValueLocation> fileLocations = fileListLocation.getSubValues( CmsXmlContentProperty.XmlNode.Uri.name()); for (I_CmsXmlContentValueLocation fileLocation : fileLocations) { CmsUUID structureId = fileLocation.asId(cms); idList.add(structureId); } value = CmsStringUtil.listAsString(idList, CmsXmlContentProperty.PROP_SEPARATOR); } if (value != null) { result.put(name, value); } } return result; }
class class_name[name] begin[{] method[readProperties, return_type[type[Map]], modifier[public static], parameter[cms, baseLocation]] begin[{] local_variable[type[Map], result] local_variable[type[String], elementName] local_variable[type[String], nameElementName] local_variable[type[List], propertyLocations] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nameElementName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSubValue, postfix_operators=[], prefix_operators=[], qualifier=propertyLocation, selectors=[], type_arguments=None), name=nameLocation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsXmlContentValueLocation, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asString, postfix_operators=[], prefix_operators=[], qualifier=nameLocation, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=CmsXmlContentProperty.XmlNode.Value, selectors=[], type_arguments=None)], member=getSubValue, postfix_operators=[], prefix_operators=[], qualifier=propertyLocation, selectors=[], type_arguments=None), name=valueLocation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsXmlContentValueLocation, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=CmsXmlContentProperty.XmlNode.String, selectors=[], type_arguments=None)], member=getSubValue, postfix_operators=[], prefix_operators=[], qualifier=valueLocation, selectors=[], type_arguments=None), name=stringLocation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsXmlContentValueLocation, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=CmsXmlContentProperty.XmlNode.FileList, selectors=[], type_arguments=None)], member=getSubValue, postfix_operators=[], prefix_operators=[], qualifier=valueLocation, selectors=[], type_arguments=None), name=fileListLocation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsXmlContentValueLocation, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=stringLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fileListLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsUUID, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=idList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsUUID, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=CmsXmlContentProperty.XmlNode.Uri, selectors=[], type_arguments=None)], member=getSubValues, postfix_operators=[], prefix_operators=[], qualifier=fileListLocation, selectors=[], type_arguments=None), name=fileLocations)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=I_CmsXmlContentValueLocation, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asId, postfix_operators=[], prefix_operators=[], qualifier=fileLocation, selectors=[], type_arguments=None), name=structureId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsUUID, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=structureId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=idList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=fileLocations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fileLocation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsXmlContentValueLocation, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=idList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PROP_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=CmsXmlContentProperty, selectors=[])], member=listAsString, postfix_operators=[], prefix_operators=[], qualifier=CmsStringUtil, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asString, postfix_operators=[], prefix_operators=[], qualifier=stringLocation, 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=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=propertyLocations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=propertyLocation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsXmlContentValueLocation, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[readProperties] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[I_CmsXmlContentLocation] identifier[baseLocation] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[elementName] operator[=] identifier[CmsXmlContentProperty] operator[SEP] identifier[XmlNode] operator[SEP] identifier[Properties] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[nameElementName] operator[=] identifier[CmsXmlContentProperty] operator[SEP] identifier[XmlNode] operator[SEP] identifier[Name] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[I_CmsXmlContentValueLocation] operator[>] identifier[propertyLocations] operator[=] identifier[baseLocation] operator[SEP] identifier[getSubValues] operator[SEP] identifier[elementName] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[I_CmsXmlContentValueLocation] identifier[propertyLocation] operator[:] identifier[propertyLocations] operator[SEP] { identifier[I_CmsXmlContentValueLocation] identifier[nameLocation] operator[=] identifier[propertyLocation] operator[SEP] identifier[getSubValue] operator[SEP] identifier[nameElementName] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[nameLocation] operator[SEP] identifier[asString] operator[SEP] identifier[cms] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] Other[null] operator[SEP] identifier[I_CmsXmlContentValueLocation] identifier[valueLocation] operator[=] identifier[propertyLocation] operator[SEP] identifier[getSubValue] operator[SEP] identifier[CmsXmlContentProperty] operator[SEP] identifier[XmlNode] operator[SEP] identifier[Value] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[I_CmsXmlContentValueLocation] identifier[stringLocation] operator[=] identifier[valueLocation] operator[SEP] identifier[getSubValue] operator[SEP] identifier[CmsXmlContentProperty] operator[SEP] identifier[XmlNode] operator[SEP] identifier[String] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[I_CmsXmlContentValueLocation] identifier[fileListLocation] operator[=] identifier[valueLocation] operator[SEP] identifier[getSubValue] operator[SEP] identifier[CmsXmlContentProperty] operator[SEP] identifier[XmlNode] operator[SEP] identifier[FileList] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stringLocation] operator[!=] Other[null] operator[SEP] { identifier[value] operator[=] identifier[stringLocation] operator[SEP] identifier[asString] operator[SEP] identifier[cms] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[fileListLocation] operator[!=] Other[null] operator[SEP] { identifier[List] operator[<] identifier[CmsUUID] operator[>] identifier[idList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsUUID] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[I_CmsXmlContentValueLocation] operator[>] identifier[fileLocations] operator[=] identifier[fileListLocation] operator[SEP] identifier[getSubValues] operator[SEP] identifier[CmsXmlContentProperty] operator[SEP] identifier[XmlNode] operator[SEP] identifier[Uri] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[I_CmsXmlContentValueLocation] identifier[fileLocation] operator[:] identifier[fileLocations] operator[SEP] { identifier[CmsUUID] identifier[structureId] operator[=] identifier[fileLocation] operator[SEP] identifier[asId] operator[SEP] identifier[cms] operator[SEP] operator[SEP] identifier[idList] operator[SEP] identifier[add] operator[SEP] identifier[structureId] operator[SEP] operator[SEP] } identifier[value] operator[=] identifier[CmsStringUtil] operator[SEP] identifier[listAsString] operator[SEP] identifier[idList] , identifier[CmsXmlContentProperty] operator[SEP] identifier[PROP_SEPARATOR] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public void close() { if (_socket!=null) { try { _socket.close(); _socket = null; } catch (IOException e) { System.err.println("Exception: " + e); // throw new SoccomException(SoccomException.RECV_ERROR); } _in = null; _out = null; } }
class class_name[name] begin[{] method[close, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[._socket], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=_socket, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_socket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception: "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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) assign[member[._in], literal[null]] assign[member[._out], literal[null]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[_socket] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[_socket] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[_socket] operator[=] Other[null] 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[e] operator[SEP] operator[SEP] } identifier[_in] operator[=] Other[null] operator[SEP] identifier[_out] operator[=] Other[null] operator[SEP] } }
public PrimitiveType getPrimitiveType(TypeMirror typeMirror) { if (getPrimitiveFor(typeMirror) != null) { return this.types.unboxedType(typeMirror); } return null; }
class class_name[name] begin[{] method[getPrimitiveType, return_type[type[PrimitiveType]], modifier[public], parameter[typeMirror]] begin[{] if[binary_operation[call[.getPrimitiveFor, parameter[member[.typeMirror]]], !=, literal[null]]] begin[{] return[THIS[member[None.types]call[None.unboxedType, parameter[member[.typeMirror]]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[PrimitiveType] identifier[getPrimitiveType] operator[SEP] identifier[TypeMirror] identifier[typeMirror] operator[SEP] { Keyword[if] operator[SEP] identifier[getPrimitiveFor] operator[SEP] identifier[typeMirror] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[types] operator[SEP] identifier[unboxedType] operator[SEP] identifier[typeMirror] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public WebhookMessageBuilder addFile(File file) { Checks.notNull(file, "File"); return addFile(file.getName(), file); }
class class_name[name] begin[{] method[addFile, return_type[type[WebhookMessageBuilder]], modifier[public], parameter[file]] begin[{] call[Checks.notNull, parameter[member[.file], literal["File"]]] return[call[.addFile, parameter[call[file.getName, parameter[]], member[.file]]]] end[}] END[}]
Keyword[public] identifier[WebhookMessageBuilder] identifier[addFile] operator[SEP] identifier[File] identifier[file] operator[SEP] { identifier[Checks] operator[SEP] identifier[notNull] operator[SEP] identifier[file] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[addFile] operator[SEP] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[file] operator[SEP] operator[SEP] }
public GroovyClassLoader createGroovyClassLoader(final ClassLoader classLoader, final ResourceLoader resourceLoader) { return AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>() { @Override public GroovyClassLoader run() { GroovyClassLoader gcl = new GroovyClassLoader(classLoader); gcl.setResourceLoader(createGroovyResourceLoader(resourceLoader)); return gcl; } }); }
class class_name[name] begin[{] method[createGroovyClassLoader, return_type[type[GroovyClassLoader]], modifier[public], parameter[classLoader, resourceLoader]] begin[{] return[call[AccessController.doPrivileged, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=classLoader, 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=GroovyClassLoader, sub_type=None)), name=gcl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GroovyClassLoader, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=resourceLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createGroovyResourceLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setResourceLoader, postfix_operators=[], prefix_operators=[], qualifier=gcl, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=gcl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=GroovyClassLoader, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=GroovyClassLoader, sub_type=None))], dimensions=None, name=PrivilegedAction, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[GroovyClassLoader] identifier[createGroovyClassLoader] operator[SEP] Keyword[final] identifier[ClassLoader] identifier[classLoader] , Keyword[final] identifier[ResourceLoader] identifier[resourceLoader] operator[SEP] { Keyword[return] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[<] identifier[GroovyClassLoader] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[GroovyClassLoader] identifier[run] operator[SEP] operator[SEP] { identifier[GroovyClassLoader] identifier[gcl] operator[=] Keyword[new] identifier[GroovyClassLoader] operator[SEP] identifier[classLoader] operator[SEP] operator[SEP] identifier[gcl] operator[SEP] identifier[setResourceLoader] operator[SEP] identifier[createGroovyResourceLoader] operator[SEP] identifier[resourceLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[gcl] operator[SEP] } } operator[SEP] operator[SEP] }
@Override public ThriftServer getThriftServer(int serverPort, Map<String, Service> serviceMap) { return getThriftServer(String.format("ThriftServer-%d", serverPort), serverPort, serviceMap); }
class class_name[name] begin[{] method[getThriftServer, return_type[type[ThriftServer]], modifier[public], parameter[serverPort, serviceMap]] begin[{] return[call[.getThriftServer, parameter[call[String.format, parameter[literal["ThriftServer-%d"], member[.serverPort]]], member[.serverPort], member[.serviceMap]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ThriftServer] identifier[getThriftServer] operator[SEP] Keyword[int] identifier[serverPort] , identifier[Map] operator[<] identifier[String] , identifier[Service] operator[>] identifier[serviceMap] operator[SEP] { Keyword[return] identifier[getThriftServer] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[serverPort] operator[SEP] , identifier[serverPort] , identifier[serviceMap] operator[SEP] operator[SEP] }
public List<URI> extractModelReferenceURIs(XAttributable target) { List<String> refStrings = extractModelReferences(target); List<URI> refURIs = new ArrayList<URI>(refStrings.size()); for (String refString : refStrings) { refURIs.add(URI.create(refString)); } return refURIs; }
class class_name[name] begin[{] method[extractModelReferenceURIs, return_type[type[List]], modifier[public], parameter[target]] begin[{] local_variable[type[List], refStrings] local_variable[type[List], refURIs] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=refString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=URI, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=refURIs, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=refStrings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=refString)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.refURIs]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[URI] operator[>] identifier[extractModelReferenceURIs] operator[SEP] identifier[XAttributable] identifier[target] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[refStrings] operator[=] identifier[extractModelReferences] operator[SEP] identifier[target] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[URI] operator[>] identifier[refURIs] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[URI] operator[>] operator[SEP] identifier[refStrings] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[refString] operator[:] identifier[refStrings] operator[SEP] { identifier[refURIs] operator[SEP] identifier[add] operator[SEP] identifier[URI] operator[SEP] identifier[create] operator[SEP] identifier[refString] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[refURIs] operator[SEP] }
public static X509CRLImpl toImpl(X509CRL crl) throws CRLException { if (crl instanceof X509CRLImpl) { return (X509CRLImpl)crl; } else { return X509Factory.intern(crl); } }
class class_name[name] begin[{] method[toImpl, return_type[type[X509CRLImpl]], modifier[public static], parameter[crl]] begin[{] if[binary_operation[member[.crl], instanceof, type[X509CRLImpl]]] begin[{] return[Cast(expression=MemberReference(member=crl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=X509CRLImpl, sub_type=None))] else begin[{] return[call[X509Factory.intern, parameter[member[.crl]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[X509CRLImpl] identifier[toImpl] operator[SEP] identifier[X509CRL] identifier[crl] operator[SEP] Keyword[throws] identifier[CRLException] { Keyword[if] operator[SEP] identifier[crl] Keyword[instanceof] identifier[X509CRLImpl] operator[SEP] { Keyword[return] operator[SEP] identifier[X509CRLImpl] operator[SEP] identifier[crl] operator[SEP] } Keyword[else] { Keyword[return] identifier[X509Factory] operator[SEP] identifier[intern] operator[SEP] identifier[crl] operator[SEP] operator[SEP] } }
public void marshall(BrokerEngineType brokerEngineType, ProtocolMarshaller protocolMarshaller) { if (brokerEngineType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(brokerEngineType.getEngineType(), ENGINETYPE_BINDING); protocolMarshaller.marshall(brokerEngineType.getEngineVersions(), ENGINEVERSIONS_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[brokerEngineType, protocolMarshaller]] begin[{] if[binary_operation[member[.brokerEngineType], ==, 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=getEngineType, postfix_operators=[], prefix_operators=[], qualifier=brokerEngineType, selectors=[], type_arguments=None), MemberReference(member=ENGINETYPE_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=getEngineVersions, postfix_operators=[], prefix_operators=[], qualifier=brokerEngineType, selectors=[], type_arguments=None), MemberReference(member=ENGINEVERSIONS_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[BrokerEngineType] identifier[brokerEngineType] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[brokerEngineType] 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[brokerEngineType] operator[SEP] identifier[getEngineType] operator[SEP] operator[SEP] , identifier[ENGINETYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[brokerEngineType] operator[SEP] identifier[getEngineVersions] operator[SEP] operator[SEP] , identifier[ENGINEVERSIONS_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] } }
void sendMessage(IMessage message) throws IOException, AvpDataException, NotInitializedException, ParseException { if (!isConnected()) { throw new IOException("Failed to send message over [" + socketDescription + "]"); } //switch to wait for SSL handshake to workout. if (!isExchangeAllowed()) { //TODO: do more? return; } doTLSPreSendProcessing(message); final ByteBuffer messageBuffer = this.parser.encodeMessage(message); if (logger.isDebugEnabled()) { logger.debug("About to send a byte buffer of size [{}] over the TLS socket [{}]", messageBuffer.array().length, socketDescription); } lock.lock(); try { this.outputStream.write(messageBuffer.array(), messageBuffer.position(), messageBuffer.limit()); doTLSPostSendProcessing(message); } catch (Exception e) { logger.debug("Unable to send message", e); throw new IOException("Error while sending message: " + e); } finally { lock.unlock(); } if (logger.isDebugEnabled()) { logger.debug("Sent a byte buffer of size [{}] over the TLS nio socket [{}]", messageBuffer.array().length, socketDescription); } }
class class_name[name] begin[{] method[sendMessage, return_type[void], modifier[default], parameter[message]] begin[{] if[call[.isConnected, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to send message over ["), operandr=MemberReference(member=socketDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] if[call[.isExchangeAllowed, parameter[]]] begin[{] return[None] else begin[{] None end[}] call[.doTLSPreSendProcessing, parameter[member[.message]]] local_variable[type[ByteBuffer], messageBuffer] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[literal["About to send a byte buffer of size [{}] over the TLS socket [{}]"], call[messageBuffer.array, parameter[]], member[.socketDescription]]] else begin[{] None end[}] call[lock.lock, parameter[]] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=outputStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=array, postfix_operators=[], prefix_operators=[], qualifier=messageBuffer, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=position, postfix_operators=[], prefix_operators=[], qualifier=messageBuffer, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=limit, postfix_operators=[], prefix_operators=[], qualifier=messageBuffer, selectors=[], type_arguments=None)], member=write, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doTLSPostSendProcessing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to send message"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while sending message: "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[literal["Sent a byte buffer of size [{}] over the TLS nio socket [{}]"], call[messageBuffer.array, parameter[]], member[.socketDescription]]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[sendMessage] operator[SEP] identifier[IMessage] identifier[message] operator[SEP] Keyword[throws] identifier[IOException] , identifier[AvpDataException] , identifier[NotInitializedException] , identifier[ParseException] { Keyword[if] operator[SEP] operator[!] identifier[isConnected] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[socketDescription] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isExchangeAllowed] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[doTLSPreSendProcessing] operator[SEP] identifier[message] operator[SEP] operator[SEP] Keyword[final] identifier[ByteBuffer] identifier[messageBuffer] operator[=] Keyword[this] operator[SEP] identifier[parser] operator[SEP] identifier[encodeMessage] operator[SEP] identifier[message] 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] , identifier[messageBuffer] operator[SEP] identifier[array] operator[SEP] operator[SEP] operator[SEP] identifier[length] , identifier[socketDescription] operator[SEP] operator[SEP] } identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[this] operator[SEP] identifier[outputStream] operator[SEP] identifier[write] operator[SEP] identifier[messageBuffer] operator[SEP] identifier[array] operator[SEP] operator[SEP] , identifier[messageBuffer] operator[SEP] identifier[position] operator[SEP] operator[SEP] , identifier[messageBuffer] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[doTLSPostSendProcessing] operator[SEP] identifier[message] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[lock] operator[SEP] identifier[unlock] 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] , identifier[messageBuffer] operator[SEP] identifier[array] operator[SEP] operator[SEP] operator[SEP] identifier[length] , identifier[socketDescription] operator[SEP] operator[SEP] } }
public OvhOrder dedicatedCloud_serviceName_upgradeRessource_duration_GET(String serviceName, String duration, OvhUpgradeTypeEnum upgradeType, Long upgradedRessourceId, OvhUpgradeRessourceTypeEnum upgradedRessourceType) throws IOException { String qPath = "/order/dedicatedCloud/{serviceName}/upgradeRessource/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); query(sb, "upgradeType", upgradeType); query(sb, "upgradedRessourceId", upgradedRessourceId); query(sb, "upgradedRessourceType", upgradedRessourceType); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhOrder.class); }
class class_name[name] begin[{] method[dedicatedCloud_serviceName_upgradeRessource_duration_GET, return_type[type[OvhOrder]], modifier[public], parameter[serviceName, duration, upgradeType, upgradedRessourceId, upgradedRessourceType]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] call[.query, parameter[member[.sb], literal["upgradeType"], member[.upgradeType]]] call[.query, parameter[member[.sb], literal["upgradedRessourceId"], member[.upgradedRessourceId]]] call[.query, parameter[member[.sb], literal["upgradedRessourceType"], member[.upgradedRessourceType]]] 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=OvhOrder, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhOrder] identifier[dedicatedCloud_serviceName_upgradeRessource_duration_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[duration] , identifier[OvhUpgradeTypeEnum] identifier[upgradeType] , identifier[Long] identifier[upgradedRessourceId] , identifier[OvhUpgradeRessourceTypeEnum] identifier[upgradedRessourceType] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[duration] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[upgradeType] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[upgradedRessourceId] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[upgradedRessourceType] 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[OvhOrder] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public static GetStatusContext mergeFrom(GetStatusPOptions.Builder optionsBuilder) { GetStatusPOptions masterOptions = FileSystemOptions.getStatusDefaults(ServerConfiguration.global()); GetStatusPOptions.Builder mergedOptionsBuilder = masterOptions.toBuilder().mergeFrom(optionsBuilder.build()); return create(mergedOptionsBuilder); }
class class_name[name] begin[{] method[mergeFrom, return_type[type[GetStatusContext]], modifier[public static], parameter[optionsBuilder]] begin[{] local_variable[type[GetStatusPOptions], masterOptions] local_variable[type[GetStatusPOptions], mergedOptionsBuilder] return[call[.create, parameter[member[.mergedOptionsBuilder]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[GetStatusContext] identifier[mergeFrom] operator[SEP] identifier[GetStatusPOptions] operator[SEP] identifier[Builder] identifier[optionsBuilder] operator[SEP] { identifier[GetStatusPOptions] identifier[masterOptions] operator[=] identifier[FileSystemOptions] operator[SEP] identifier[getStatusDefaults] operator[SEP] identifier[ServerConfiguration] operator[SEP] identifier[global] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[GetStatusPOptions] operator[SEP] identifier[Builder] identifier[mergedOptionsBuilder] operator[=] identifier[masterOptions] operator[SEP] identifier[toBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[mergeFrom] operator[SEP] identifier[optionsBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[create] operator[SEP] identifier[mergedOptionsBuilder] operator[SEP] operator[SEP] }
private static <T> int[] getFieldSizes(List<T> list, Field[] fields) { if (list.isEmpty()) throw new IllegalArgumentException("List of beans is empty!"); if(fields == null) fields = getFields(list.get(0).getClass()); int[] sizes = new int [fields.length]; for (T a:list) { int i = -1; for (Field f : fields) { i++; f.setAccessible(true); try { Object obj = f.get(a); int length; if (obj==null) { length = MMCIF_MISSING_VALUE.length(); } else { String val = (String) obj; length = addMmCifQuoting(val).length(); } if (length>sizes[i]) sizes[i] = length; } catch (IllegalAccessException e) { logger.warn("Field {} is inaccessible", f.getName()); continue; } catch (ClassCastException e) { logger.warn("Could not cast value to String for field {}",f.getName()); continue; } } } return sizes; }
class class_name[name] begin[{] method[getFieldSizes, return_type[type[int]], modifier[private static], parameter[list, fields]] begin[{] if[call[list.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="List of beans is empty!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.fields], ==, literal[null]]] begin[{] assign[member[.fields], call[.getFields, parameter[call[list.get, parameter[literal[0]]]]]] else begin[{] None end[}] local_variable[type[int], sizes] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=length)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addMmCifQuoting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=MMCIF_MISSING_VALUE, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=sizes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=sizes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Field {} is inaccessible"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not cast value to String for field {}"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassCastException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=a)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None) return[member[.sizes]] end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] Keyword[int] operator[SEP] operator[SEP] identifier[getFieldSizes] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[list] , identifier[Field] operator[SEP] operator[SEP] identifier[fields] operator[SEP] { Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fields] operator[==] Other[null] operator[SEP] identifier[fields] operator[=] identifier[getFields] operator[SEP] identifier[list] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[sizes] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[fields] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[T] identifier[a] operator[:] identifier[list] operator[SEP] { Keyword[int] identifier[i] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[f] operator[:] identifier[fields] operator[SEP] { identifier[i] operator[++] operator[SEP] identifier[f] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[try] { identifier[Object] identifier[obj] operator[=] identifier[f] operator[SEP] identifier[get] operator[SEP] identifier[a] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[obj] operator[==] Other[null] operator[SEP] { identifier[length] operator[=] identifier[MMCIF_MISSING_VALUE] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] identifier[val] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[obj] operator[SEP] identifier[length] operator[=] identifier[addMmCifQuoting] operator[SEP] identifier[val] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[length] operator[>] identifier[sizes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[sizes] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[length] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[f] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[f] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } } } Keyword[return] identifier[sizes] operator[SEP] }
protected void setSystemProperties(DriverMap driverRepository) { ArrayList<DriverContext> driverContextsForCurrentOperatingSystem = driverRepository.getDriverContextsForCurrentOperatingSystem(); if (driverContextsForCurrentOperatingSystem.size() == 0) { LOG.warn("No driver contexts detected for the current operating system, no maven properties set!"); } for (DriverContext driverContext : driverContextsForCurrentOperatingSystem) { DriverDetails driverDetails = driverRepository.getDetailsForLatestVersionOfDriverContext(driverContext); LOG.info("Setting maven property - ${" + driverContext.getBinaryTypeForContext().getDriverSystemProperty() + "} = " + driverDetails.extractedLocation); project.getProperties().setProperty(driverContext.getBinaryTypeForContext().getDriverSystemProperty(), driverDetails.extractedLocation); } }
class class_name[name] begin[{] method[setSystemProperties, return_type[void], modifier[protected], parameter[driverRepository]] begin[{] local_variable[type[ArrayList], driverContextsForCurrentOperatingSystem] if[binary_operation[call[driverContextsForCurrentOperatingSystem.size, parameter[]], ==, literal[0]]] begin[{] call[LOG.warn, parameter[literal["No driver contexts detected for the current operating system, no maven properties set!"]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=driverContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDetailsForLatestVersionOfDriverContext, postfix_operators=[], prefix_operators=[], qualifier=driverRepository, selectors=[], type_arguments=None), name=driverDetails)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DriverDetails, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Setting maven property - ${"), operandr=MethodInvocation(arguments=[], member=getBinaryTypeForContext, postfix_operators=[], prefix_operators=[], qualifier=driverContext, selectors=[MethodInvocation(arguments=[], member=getDriverSystemProperty, 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="} = "), operator=+), operandr=MemberReference(member=extractedLocation, postfix_operators=[], prefix_operators=[], qualifier=driverDetails, selectors=[]), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=project, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBinaryTypeForContext, postfix_operators=[], prefix_operators=[], qualifier=driverContext, selectors=[MethodInvocation(arguments=[], member=getDriverSystemProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=extractedLocation, postfix_operators=[], prefix_operators=[], qualifier=driverDetails, selectors=[])], member=setProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=driverContextsForCurrentOperatingSystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=driverContext)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DriverContext, sub_type=None))), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[setSystemProperties] operator[SEP] identifier[DriverMap] identifier[driverRepository] operator[SEP] { identifier[ArrayList] operator[<] identifier[DriverContext] operator[>] identifier[driverContextsForCurrentOperatingSystem] operator[=] identifier[driverRepository] operator[SEP] identifier[getDriverContextsForCurrentOperatingSystem] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[driverContextsForCurrentOperatingSystem] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[DriverContext] identifier[driverContext] operator[:] identifier[driverContextsForCurrentOperatingSystem] operator[SEP] { identifier[DriverDetails] identifier[driverDetails] operator[=] identifier[driverRepository] operator[SEP] identifier[getDetailsForLatestVersionOfDriverContext] operator[SEP] identifier[driverContext] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[driverContext] operator[SEP] identifier[getBinaryTypeForContext] operator[SEP] operator[SEP] operator[SEP] identifier[getDriverSystemProperty] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[driverDetails] operator[SEP] identifier[extractedLocation] operator[SEP] operator[SEP] identifier[project] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[setProperty] operator[SEP] identifier[driverContext] operator[SEP] identifier[getBinaryTypeForContext] operator[SEP] operator[SEP] operator[SEP] identifier[getDriverSystemProperty] operator[SEP] operator[SEP] , identifier[driverDetails] operator[SEP] identifier[extractedLocation] operator[SEP] operator[SEP] } }
private int[] getIndexes() { int[] res = new int[this.indexes.size()]; int i = 0; for (Integer idx : this.indexes) { res[i] = idx; i++; } return res; }
class class_name[name] begin[{] method[getIndexes, return_type[type[int]], modifier[private], parameter[]] begin[{] local_variable[type[int], res] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=indexes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=idx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None) return[member[.res]] end[}] END[}]
Keyword[private] Keyword[int] operator[SEP] operator[SEP] identifier[getIndexes] operator[SEP] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[res] operator[=] Keyword[new] Keyword[int] operator[SEP] Keyword[this] operator[SEP] identifier[indexes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[idx] operator[:] Keyword[this] operator[SEP] identifier[indexes] operator[SEP] { identifier[res] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[idx] operator[SEP] identifier[i] operator[++] operator[SEP] } Keyword[return] identifier[res] operator[SEP] }
@SuppressWarnings("unchecked") public <T extends HMSCacheSupport.HMSCacheInfo> T getIfPresent( HMSCacheType hmsCacheType, String qualifiedTableName ) throws StageException { if (!cacheMap.containsKey(hmsCacheType)) { throw new StageException(Errors.HIVE_16, hmsCacheType); } Optional<HMSCacheSupport.HMSCacheInfo> ret = cacheMap.get(hmsCacheType).getIfPresent(qualifiedTableName); return ret == null ? null : (T)ret.orNull(); }
class class_name[name] begin[{] method[getIfPresent, return_type[type[T]], modifier[public], parameter[hmsCacheType, qualifiedTableName]] begin[{] if[call[cacheMap.containsKey, parameter[member[.hmsCacheType]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=HIVE_16, postfix_operators=[], prefix_operators=[], qualifier=Errors, selectors=[]), MemberReference(member=hmsCacheType, 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=StageException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Optional], ret] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Cast(expression=MethodInvocation(arguments=[], member=orNull, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[HMSCacheSupport] operator[SEP] identifier[HMSCacheInfo] operator[>] identifier[T] identifier[getIfPresent] operator[SEP] identifier[HMSCacheType] identifier[hmsCacheType] , identifier[String] identifier[qualifiedTableName] operator[SEP] Keyword[throws] identifier[StageException] { Keyword[if] operator[SEP] operator[!] identifier[cacheMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[hmsCacheType] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[StageException] operator[SEP] identifier[Errors] operator[SEP] identifier[HIVE_16] , identifier[hmsCacheType] operator[SEP] operator[SEP] } identifier[Optional] operator[<] identifier[HMSCacheSupport] operator[SEP] identifier[HMSCacheInfo] operator[>] identifier[ret] operator[=] identifier[cacheMap] operator[SEP] identifier[get] operator[SEP] identifier[hmsCacheType] operator[SEP] operator[SEP] identifier[getIfPresent] operator[SEP] identifier[qualifiedTableName] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[==] Other[null] operator[?] Other[null] operator[:] operator[SEP] identifier[T] operator[SEP] identifier[ret] operator[SEP] identifier[orNull] operator[SEP] operator[SEP] operator[SEP] }
@Override public Double reduce(List<Double> values) { if(values == null || values.isEmpty()) { return null; } Stream<Double> stream = StreamSupport.stream(values.spliterator(), true); if(stream.allMatch(o -> o == null)) { stream.close(); return null; } stream.close(); double max = Double.NEGATIVE_INFINITY; for (Double value : values) { if (value == null) { continue; } double candidate = value; if (candidate > max) { max = candidate; } } return max; }
class class_name[name] begin[{] method[reduce, return_type[type[Double]], modifier[public], parameter[values]] begin[{] if[binary_operation[binary_operation[member[.values], ==, literal[null]], ||, call[values.isEmpty, parameter[]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Stream], stream] if[call[stream.allMatch, parameter[LambdaExpression(body=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), parameters=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]] begin[{] call[stream.close, parameter[]] return[literal[null]] else begin[{] None end[}] call[stream.close, parameter[]] local_variable[type[double], max] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=candidate)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))), label=None) return[member[.max]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Double] identifier[reduce] operator[SEP] identifier[List] operator[<] identifier[Double] operator[>] identifier[values] operator[SEP] { Keyword[if] operator[SEP] identifier[values] operator[==] Other[null] operator[||] identifier[values] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Stream] operator[<] identifier[Double] operator[>] identifier[stream] operator[=] identifier[StreamSupport] operator[SEP] identifier[stream] operator[SEP] identifier[values] operator[SEP] identifier[spliterator] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stream] operator[SEP] identifier[allMatch] operator[SEP] identifier[o] operator[->] identifier[o] operator[==] Other[null] operator[SEP] operator[SEP] { identifier[stream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[stream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[max] operator[=] identifier[Double] operator[SEP] identifier[NEGATIVE_INFINITY] operator[SEP] Keyword[for] operator[SEP] identifier[Double] identifier[value] operator[:] identifier[values] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[double] identifier[candidate] operator[=] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[candidate] operator[>] identifier[max] operator[SEP] { identifier[max] operator[=] identifier[candidate] operator[SEP] } } Keyword[return] identifier[max] operator[SEP] }
public void writeBit (final int aBit) throws IOException { if (m_aOS == null) throw new IllegalStateException ("BitOutputStream is already closed"); if (aBit != CGlobal.BIT_NOT_SET && aBit != CGlobal.BIT_SET) throw new IllegalArgumentException (aBit + " is not a bit"); if (aBit == CGlobal.BIT_SET) if (m_bHighOrderBitFirst) m_nBuffer |= (aBit << (7 - m_nBufferedBitCount)); else m_nBuffer |= (aBit << m_nBufferedBitCount); ++m_nBufferedBitCount; if (m_nBufferedBitCount == CGlobal.BITS_PER_BYTE) flush (); }
class class_name[name] begin[{] method[writeBit, return_type[void], modifier[public], parameter[aBit]] begin[{] if[binary_operation[member[.m_aOS], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="BitOutputStream is already closed")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[member[.aBit], !=, member[CGlobal.BIT_NOT_SET]], &&, binary_operation[member[.aBit], !=, member[CGlobal.BIT_SET]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=aBit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not a bit"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.aBit], ==, member[CGlobal.BIT_SET]]] begin[{] if[member[.m_bHighOrderBitFirst]] begin[{] assign[member[.m_nBuffer], binary_operation[member[.aBit], <<, binary_operation[literal[7], -, member[.m_nBufferedBitCount]]]] else begin[{] assign[member[.m_nBuffer], binary_operation[member[.aBit], <<, member[.m_nBufferedBitCount]]] end[}] else begin[{] None end[}] member[.m_nBufferedBitCount] if[binary_operation[member[.m_nBufferedBitCount], ==, member[CGlobal.BITS_PER_BYTE]]] begin[{] call[.flush, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[writeBit] operator[SEP] Keyword[final] Keyword[int] identifier[aBit] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[m_aOS] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aBit] operator[!=] identifier[CGlobal] operator[SEP] identifier[BIT_NOT_SET] operator[&&] identifier[aBit] operator[!=] identifier[CGlobal] operator[SEP] identifier[BIT_SET] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[aBit] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aBit] operator[==] identifier[CGlobal] operator[SEP] identifier[BIT_SET] operator[SEP] Keyword[if] operator[SEP] identifier[m_bHighOrderBitFirst] operator[SEP] identifier[m_nBuffer] operator[|=] operator[SEP] identifier[aBit] operator[<<] operator[SEP] Other[7] operator[-] identifier[m_nBufferedBitCount] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[m_nBuffer] operator[|=] operator[SEP] identifier[aBit] operator[<<] identifier[m_nBufferedBitCount] operator[SEP] operator[SEP] operator[++] identifier[m_nBufferedBitCount] operator[SEP] Keyword[if] operator[SEP] identifier[m_nBufferedBitCount] operator[==] identifier[CGlobal] operator[SEP] identifier[BITS_PER_BYTE] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] }
private List<String> filterSourcelist(List<String> sourceList) { List<String> filteredList = new ArrayList<String>(sourceList); filteredList.remove(CollectorConstants.TRACE_CONFIG_VAL); filteredList.remove(CollectorConstants.MESSAGES_CONFIG_VAL); return filteredList; }
class class_name[name] begin[{] method[filterSourcelist, return_type[type[List]], modifier[private], parameter[sourceList]] begin[{] local_variable[type[List], filteredList] call[filteredList.remove, parameter[member[CollectorConstants.TRACE_CONFIG_VAL]]] call[filteredList.remove, parameter[member[CollectorConstants.MESSAGES_CONFIG_VAL]]] return[member[.filteredList]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[String] operator[>] identifier[filterSourcelist] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[sourceList] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[filteredList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[sourceList] operator[SEP] operator[SEP] identifier[filteredList] operator[SEP] identifier[remove] operator[SEP] identifier[CollectorConstants] operator[SEP] identifier[TRACE_CONFIG_VAL] operator[SEP] operator[SEP] identifier[filteredList] operator[SEP] identifier[remove] operator[SEP] identifier[CollectorConstants] operator[SEP] identifier[MESSAGES_CONFIG_VAL] operator[SEP] operator[SEP] Keyword[return] identifier[filteredList] operator[SEP] }
public static double root(double eps, double a, double b, Function1D f) { return root(eps, 1000, a, b, f); }
class class_name[name] begin[{] method[root, return_type[type[double]], modifier[public static], parameter[eps, a, b, f]] begin[{] return[call[.root, parameter[member[.eps], literal[1000], member[.a], member[.b], member[.f]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[root] operator[SEP] Keyword[double] identifier[eps] , Keyword[double] identifier[a] , Keyword[double] identifier[b] , identifier[Function1D] identifier[f] operator[SEP] { Keyword[return] identifier[root] operator[SEP] identifier[eps] , Other[1000] , identifier[a] , identifier[b] , identifier[f] operator[SEP] operator[SEP] }
@Override public void endVisit(FunctionInvocation node) { if (Objects.equals(node.getFunctionElement(), NIL_CHK_ELEM)) { VariableElement var = TreeUtil.getVariableElement(node.getArgument(0)); if (var != null) { addSafeVar(var); } } }
class class_name[name] begin[{] method[endVisit, return_type[void], modifier[public], parameter[node]] begin[{] if[call[Objects.equals, parameter[call[node.getFunctionElement, parameter[]], member[.NIL_CHK_ELEM]]]] begin[{] local_variable[type[VariableElement], var] if[binary_operation[member[.var], !=, literal[null]]] begin[{] call[.addSafeVar, parameter[member[.var]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[endVisit] operator[SEP] identifier[FunctionInvocation] identifier[node] operator[SEP] { Keyword[if] operator[SEP] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[node] operator[SEP] identifier[getFunctionElement] operator[SEP] operator[SEP] , identifier[NIL_CHK_ELEM] operator[SEP] operator[SEP] { identifier[VariableElement] identifier[var] operator[=] identifier[TreeUtil] operator[SEP] identifier[getVariableElement] operator[SEP] identifier[node] operator[SEP] identifier[getArgument] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[var] operator[!=] Other[null] operator[SEP] { identifier[addSafeVar] operator[SEP] identifier[var] operator[SEP] operator[SEP] } } }
@CheckResult @NonNull public QueryObservable createQuery(@NonNull final String table, @NonNull String sql, @NonNull Object... args) { return createQuery(new DatabaseQuery(singletonList(table), new SimpleSQLiteQuery(sql, args))); }
class class_name[name] begin[{] method[createQuery, return_type[type[QueryObservable]], modifier[public], parameter[table, sql, args]] begin[{] return[call[.createQuery, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=singletonList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), ClassCreator(arguments=[MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, 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=SimpleSQLiteQuery, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseQuery, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[CheckResult] annotation[@] identifier[NonNull] Keyword[public] identifier[QueryObservable] identifier[createQuery] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[String] identifier[table] , annotation[@] identifier[NonNull] identifier[String] identifier[sql] , annotation[@] identifier[NonNull] identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[return] identifier[createQuery] operator[SEP] Keyword[new] identifier[DatabaseQuery] operator[SEP] identifier[singletonList] operator[SEP] identifier[table] operator[SEP] , Keyword[new] identifier[SimpleSQLiteQuery] operator[SEP] identifier[sql] , identifier[args] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static double KullbackLeiblerDivergence(SparseArray x, SparseArray y) { if (x.isEmpty()) { throw new IllegalArgumentException("List x is empty."); } if (y.isEmpty()) { throw new IllegalArgumentException("List y is empty."); } Iterator<SparseArray.Entry> iterX = x.iterator(); Iterator<SparseArray.Entry> iterY = y.iterator(); SparseArray.Entry a = iterX.hasNext() ? iterX.next() : null; SparseArray.Entry b = iterY.hasNext() ? iterY.next() : null; boolean intersection = false; double kl = 0.0; while (a != null && b != null) { if (a.i < b.i) { a = iterX.hasNext() ? iterX.next() : null; } else if (a.i > b.i) { b = iterY.hasNext() ? iterY.next() : null; } else { intersection = true; kl += a.x * Math.log(a.x / b.x); a = iterX.hasNext() ? iterX.next() : null; b = iterY.hasNext() ? iterY.next() : null; } } if (intersection) { return kl; } else { return Double.POSITIVE_INFINITY; } }
class class_name[name] begin[{] method[KullbackLeiblerDivergence, return_type[type[double]], modifier[public static], parameter[x, y]] begin[{] if[call[x.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="List x is empty.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[call[y.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="List y is empty.")], 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[Iterator], iterX] local_variable[type[Iterator], iterY] local_variable[type[SparseArray], a] local_variable[type[SparseArray], b] local_variable[type[boolean], intersection] local_variable[type[double], kl] while[binary_operation[binary_operation[member[.a], !=, literal[null]], &&, binary_operation[member[.b], !=, literal[null]]]] begin[{] if[binary_operation[member[a.i], <, member[b.i]]] begin[{] assign[member[.a], TernaryExpression(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterX, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterX, selectors=[], type_arguments=None))] else begin[{] if[binary_operation[member[a.i], >, member[b.i]]] begin[{] assign[member[.b], TernaryExpression(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterY, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterY, selectors=[], type_arguments=None))] else begin[{] assign[member[.intersection], literal[true]] assign[member[.kl], binary_operation[member[a.x], *, call[Math.log, parameter[binary_operation[member[a.x], /, member[b.x]]]]]] assign[member[.a], TernaryExpression(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterX, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterX, selectors=[], type_arguments=None))] assign[member[.b], TernaryExpression(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterY, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterY, selectors=[], type_arguments=None))] end[}] end[}] end[}] if[member[.intersection]] begin[{] return[member[.kl]] else begin[{] return[member[Double.POSITIVE_INFINITY]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[KullbackLeiblerDivergence] operator[SEP] identifier[SparseArray] identifier[x] , identifier[SparseArray] identifier[y] operator[SEP] { Keyword[if] operator[SEP] identifier[x] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[y] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Iterator] operator[<] identifier[SparseArray] operator[SEP] identifier[Entry] operator[>] identifier[iterX] operator[=] identifier[x] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[SparseArray] operator[SEP] identifier[Entry] operator[>] identifier[iterY] operator[=] identifier[y] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[SparseArray] operator[SEP] identifier[Entry] identifier[a] operator[=] identifier[iterX] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[?] identifier[iterX] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] identifier[SparseArray] operator[SEP] identifier[Entry] identifier[b] operator[=] identifier[iterY] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[?] identifier[iterY] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[boolean] identifier[intersection] operator[=] literal[boolean] operator[SEP] Keyword[double] identifier[kl] operator[=] literal[Float] operator[SEP] Keyword[while] operator[SEP] identifier[a] operator[!=] Other[null] operator[&&] identifier[b] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[i] operator[<] identifier[b] operator[SEP] identifier[i] operator[SEP] { identifier[a] operator[=] identifier[iterX] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[?] identifier[iterX] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[i] operator[>] identifier[b] operator[SEP] identifier[i] operator[SEP] { identifier[b] operator[=] identifier[iterY] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[?] identifier[iterY] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] } Keyword[else] { identifier[intersection] operator[=] literal[boolean] operator[SEP] identifier[kl] operator[+=] identifier[a] operator[SEP] identifier[x] operator[*] identifier[Math] operator[SEP] identifier[log] operator[SEP] identifier[a] operator[SEP] identifier[x] operator[/] identifier[b] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[a] operator[=] identifier[iterX] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[?] identifier[iterX] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] identifier[b] operator[=] identifier[iterY] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[?] identifier[iterY] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] } } Keyword[if] operator[SEP] identifier[intersection] operator[SEP] { Keyword[return] identifier[kl] operator[SEP] } Keyword[else] { Keyword[return] identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] operator[SEP] } }
public void unlink(Object obj, ObjectReferenceDescriptor ord, boolean insert) { linkOrUnlink(false, obj, ord, insert); }
class class_name[name] begin[{] method[unlink, return_type[void], modifier[public], parameter[obj, ord, insert]] begin[{] call[.linkOrUnlink, parameter[literal[false], member[.obj], member[.ord], member[.insert]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[unlink] operator[SEP] identifier[Object] identifier[obj] , identifier[ObjectReferenceDescriptor] identifier[ord] , Keyword[boolean] identifier[insert] operator[SEP] { identifier[linkOrUnlink] operator[SEP] literal[boolean] , identifier[obj] , identifier[ord] , identifier[insert] operator[SEP] operator[SEP] }
private void blacklistIfNeeded( String nodeName, List<FaultStatsForType> faultStats) { for (FaultStatsForType stat : faultStats) { if (isBlacklisted(nodeName, stat.type)) { continue; } if (tooManyFailuresOnNode(stat) || tooManyConnectionFailuresOnNode(stat)) { nm.blacklistNode(nodeName, stat.type); blacklist(nodeName, stat.type); } } }
class class_name[name] begin[{] method[blacklistIfNeeded, return_type[void], modifier[private], parameter[nodeName, faultStats]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=stat, selectors=[])], member=isBlacklisted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=tooManyFailuresOnNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=tooManyConnectionFailuresOnNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=stat, selectors=[])], member=blacklistNode, postfix_operators=[], prefix_operators=[], qualifier=nm, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=stat, selectors=[])], member=blacklist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=faultStats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=stat)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FaultStatsForType, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[blacklistIfNeeded] operator[SEP] identifier[String] identifier[nodeName] , identifier[List] operator[<] identifier[FaultStatsForType] operator[>] identifier[faultStats] operator[SEP] { Keyword[for] operator[SEP] identifier[FaultStatsForType] identifier[stat] operator[:] identifier[faultStats] operator[SEP] { Keyword[if] operator[SEP] identifier[isBlacklisted] operator[SEP] identifier[nodeName] , identifier[stat] operator[SEP] identifier[type] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[tooManyFailuresOnNode] operator[SEP] identifier[stat] operator[SEP] operator[||] identifier[tooManyConnectionFailuresOnNode] operator[SEP] identifier[stat] operator[SEP] operator[SEP] { identifier[nm] operator[SEP] identifier[blacklistNode] operator[SEP] identifier[nodeName] , identifier[stat] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[blacklist] operator[SEP] identifier[nodeName] , identifier[stat] operator[SEP] identifier[type] operator[SEP] operator[SEP] } } }
public static boolean showRateDialogIfNeeded(final Context context, int themeId) { if (shouldShowRateDialog()) { showRateDialog(context, themeId); return true; } else { return false; } }
class class_name[name] begin[{] method[showRateDialogIfNeeded, return_type[type[boolean]], modifier[public static], parameter[context, themeId]] begin[{] if[call[.shouldShowRateDialog, parameter[]]] begin[{] call[.showRateDialog, parameter[member[.context], member[.themeId]]] return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[showRateDialogIfNeeded] operator[SEP] Keyword[final] identifier[Context] identifier[context] , Keyword[int] identifier[themeId] operator[SEP] { Keyword[if] operator[SEP] identifier[shouldShowRateDialog] operator[SEP] operator[SEP] operator[SEP] { identifier[showRateDialog] operator[SEP] identifier[context] , identifier[themeId] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
public void setMode(final TabMode mode) { getOrCreateComponentModel().mode = TabMode.SERVER.equals(mode) ? TabMode.DYNAMIC : mode; }
class class_name[name] begin[{] method[setMode, return_type[void], modifier[public], parameter[mode]] begin[{] assign[call[.getOrCreateComponentModel, parameter[]], TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=mode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=TabMode.SERVER, selectors=[], type_arguments=None), if_false=MemberReference(member=mode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=DYNAMIC, postfix_operators=[], prefix_operators=[], qualifier=TabMode, selectors=[]))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setMode] operator[SEP] Keyword[final] identifier[TabMode] identifier[mode] operator[SEP] { identifier[getOrCreateComponentModel] operator[SEP] operator[SEP] operator[SEP] identifier[mode] operator[=] identifier[TabMode] operator[SEP] identifier[SERVER] operator[SEP] identifier[equals] operator[SEP] identifier[mode] operator[SEP] operator[?] identifier[TabMode] operator[SEP] identifier[DYNAMIC] operator[:] identifier[mode] operator[SEP] }
public static <T> T getAnnotationValue(AnnotatedElement annotationEle, Class<? extends Annotation> annotationType) throws UtilException { return getAnnotationValue(annotationEle, annotationType, "value"); }
class class_name[name] begin[{] method[getAnnotationValue, return_type[type[T]], modifier[public static], parameter[annotationEle, annotationType]] begin[{] return[call[.getAnnotationValue, parameter[member[.annotationEle], member[.annotationType], literal["value"]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[getAnnotationValue] operator[SEP] identifier[AnnotatedElement] identifier[annotationEle] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[annotationType] operator[SEP] Keyword[throws] identifier[UtilException] { Keyword[return] identifier[getAnnotationValue] operator[SEP] identifier[annotationEle] , identifier[annotationType] , literal[String] operator[SEP] operator[SEP] }
public static ProfilingTimer create(final Log log, final String processName, final Object... args) { return create(log, topLevelInfoOnly, null, processName, args); }
class class_name[name] begin[{] method[create, return_type[type[ProfilingTimer]], modifier[public static], parameter[log, processName, args]] begin[{] return[call[.create, parameter[member[.log], member[.topLevelInfoOnly], literal[null], member[.processName], member[.args]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ProfilingTimer] identifier[create] operator[SEP] Keyword[final] identifier[Log] identifier[log] , Keyword[final] identifier[String] identifier[processName] , Keyword[final] identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[return] identifier[create] operator[SEP] identifier[log] , identifier[topLevelInfoOnly] , Other[null] , identifier[processName] , identifier[args] operator[SEP] operator[SEP] }
@Override public BleIllegalOperationException handleMismatchData(BluetoothGattCharacteristic characteristic, int neededProperties) { RxBleLog.w(messageCreator.createMismatchMessage(characteristic, neededProperties)); return null; }
class class_name[name] begin[{] method[handleMismatchData, return_type[type[BleIllegalOperationException]], modifier[public], parameter[characteristic, neededProperties]] begin[{] call[RxBleLog.w, parameter[call[messageCreator.createMismatchMessage, parameter[member[.characteristic], member[.neededProperties]]]]] return[literal[null]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[BleIllegalOperationException] identifier[handleMismatchData] operator[SEP] identifier[BluetoothGattCharacteristic] identifier[characteristic] , Keyword[int] identifier[neededProperties] operator[SEP] { identifier[RxBleLog] operator[SEP] identifier[w] operator[SEP] identifier[messageCreator] operator[SEP] identifier[createMismatchMessage] operator[SEP] identifier[characteristic] , identifier[neededProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
public static void setSreSpecificData(SRESpecificDataContainer container, Object data) { assert container != null; container.$setSreSpecificData(data); }
class class_name[name] begin[{] method[setSreSpecificData, return_type[void], modifier[public static], parameter[container, data]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) call[container.$setSreSpecificData, parameter[member[.data]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setSreSpecificData] operator[SEP] identifier[SRESpecificDataContainer] identifier[container] , identifier[Object] identifier[data] operator[SEP] { Keyword[assert] identifier[container] operator[!=] Other[null] operator[SEP] identifier[container] operator[SEP] identifier[$setSreSpecificData] operator[SEP] identifier[data] operator[SEP] operator[SEP] }
private ChangeInfo applyUpdates(List<PageEntry> entries) { // Keep track of new keys to be added along with the offset (in the original page) where they would have belonged. val changes = new ArrayList<Map.Entry<Integer, PageEntry>>(); int removeCount = 0; // Process all the Entries, in order (by Key). int lastPos = 0; ByteArraySegment lastKey = null; for (val e : entries) { if (e.getKey().getLength() != this.config.keyLength || (e.hasValue() && e.getValue().getLength() != this.config.valueLength)) { throw new IllegalDataFormatException("Found an entry with unexpected Key or Value length."); } if (lastKey != null) { Preconditions.checkArgument(KEY_COMPARATOR.compare(lastKey, e.getKey()) < 0, "Entries must be sorted by key and no duplicates are allowed."); } // Figure out if this entry exists already. val searchResult = search(e.getKey(), lastPos); if (searchResult.isExactMatch()) { if (e.hasValue()) { // Key already exists: update in-place. setValueAtPosition(searchResult.getPosition(), e.getValue()); } else { // Key exists but this is a removal. Record it for later. changes.add(new AbstractMap.SimpleImmutableEntry<>(searchResult.getPosition(), null)); removeCount++; } } else if (e.hasValue()) { // This entry's key does not exist and we want to insert it (we don't care if we want to delete an inexistent // key). We need to remember it for later. Since this was not an exact match, binary search returned the // position where it should have been. changes.add(new AbstractMap.SimpleImmutableEntry<>(searchResult.getPosition(), e)); } // Remember the last position so we may resume the next search from there. lastPos = searchResult.getPosition(); lastKey = e.getKey(); } return new ChangeInfo(changes, changes.size() - removeCount, removeCount); }
class class_name[name] begin[{] method[applyUpdates, return_type[type[ChangeInfo]], modifier[private], parameter[entries]] begin[{] local_variable[type[val], changes] local_variable[type[int], removeCount] local_variable[type[int], lastPos] local_variable[type[ByteArraySegment], lastKey] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=getLength, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=config, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=keyLength, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=hasValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=getLength, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=config, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=valueLength, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=!=), operator=&&), 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="Found an entry with unexpected Key or Value length.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalDataFormatException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lastKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=lastKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=compare, postfix_operators=[], prefix_operators=[], qualifier=KEY_COMPARATOR, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Entries must be sorted by key and no duplicates are allowed.")], member=checkArgument, postfix_operators=[], prefix_operators=[], qualifier=Preconditions, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=lastPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=search, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=searchResult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isExactMatch, postfix_operators=[], prefix_operators=[], qualifier=searchResult, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=hasValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPosition, postfix_operators=[], prefix_operators=[], qualifier=searchResult, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractMap, sub_type=ReferenceType(arguments=[], dimensions=None, name=SimpleImmutableEntry, sub_type=None)))], member=add, postfix_operators=[], prefix_operators=[], qualifier=changes, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=hasValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPosition, postfix_operators=[], prefix_operators=[], qualifier=searchResult, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractMap, sub_type=ReferenceType(arguments=[], dimensions=None, name=SimpleImmutableEntry, sub_type=None)))], member=add, postfix_operators=[], prefix_operators=[], qualifier=changes, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=removeCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPosition, postfix_operators=[], prefix_operators=[], qualifier=searchResult, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=setValueAtPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getPosition, postfix_operators=[], prefix_operators=[], qualifier=searchResult, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=entries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None))), label=None) return[ClassCreator(arguments=[MemberReference(member=changes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=changes, selectors=[], type_arguments=None), operandr=MemberReference(member=removeCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), MemberReference(member=removeCount, 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=ChangeInfo, sub_type=None))] end[}] END[}]
Keyword[private] identifier[ChangeInfo] identifier[applyUpdates] operator[SEP] identifier[List] operator[<] identifier[PageEntry] operator[>] identifier[entries] operator[SEP] { identifier[val] identifier[changes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[PageEntry] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[removeCount] operator[=] Other[0] operator[SEP] Keyword[int] identifier[lastPos] operator[=] Other[0] operator[SEP] identifier[ByteArraySegment] identifier[lastKey] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[val] identifier[e] operator[:] identifier[entries] operator[SEP] { Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[!=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[keyLength] operator[||] operator[SEP] identifier[e] operator[SEP] identifier[hasValue] operator[SEP] operator[SEP] operator[&&] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[!=] Keyword[this] operator[SEP] identifier[config] operator[SEP] identifier[valueLength] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalDataFormatException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[lastKey] operator[!=] Other[null] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[KEY_COMPARATOR] operator[SEP] identifier[compare] operator[SEP] identifier[lastKey] , identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[<] Other[0] , literal[String] operator[SEP] operator[SEP] } identifier[val] identifier[searchResult] operator[=] identifier[search] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[lastPos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[searchResult] operator[SEP] identifier[isExactMatch] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[hasValue] operator[SEP] operator[SEP] operator[SEP] { identifier[setValueAtPosition] operator[SEP] identifier[searchResult] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[changes] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[AbstractMap] operator[SEP] identifier[SimpleImmutableEntry] operator[<] operator[>] operator[SEP] identifier[searchResult] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] operator[SEP] identifier[removeCount] operator[++] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[hasValue] operator[SEP] operator[SEP] operator[SEP] { identifier[changes] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[AbstractMap] operator[SEP] identifier[SimpleImmutableEntry] operator[<] operator[>] operator[SEP] identifier[searchResult] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] operator[SEP] } identifier[lastPos] operator[=] identifier[searchResult] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] operator[SEP] identifier[lastKey] operator[=] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[ChangeInfo] operator[SEP] identifier[changes] , identifier[changes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] identifier[removeCount] , identifier[removeCount] operator[SEP] operator[SEP] }
private void addProxyRemoteAlive(TypeSpec.Builder classBuilder) { MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("isRemoteAlive") .addModifiers(Modifier.PUBLIC) .returns(boolean.class) .addStatement("boolean alive = false") .beginControlFlow("try") .addStatement("alive = mRemote.isBinderAlive()") .endControlFlow() .beginControlFlow("catch ($T ignored)", Exception.class) .endControlFlow() .addStatement("return alive") .addJavadoc("Checks whether the remote process is alive\n"); classBuilder.addMethod(methodBuilder.build()); }
class class_name[name] begin[{] method[addProxyRemoteAlive, return_type[void], modifier[private], parameter[classBuilder]] begin[{] local_variable[type[MethodSpec], methodBuilder] call[classBuilder.addMethod, parameter[call[methodBuilder.build, parameter[]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addProxyRemoteAlive] operator[SEP] identifier[TypeSpec] operator[SEP] identifier[Builder] identifier[classBuilder] operator[SEP] { identifier[MethodSpec] operator[SEP] identifier[Builder] identifier[methodBuilder] operator[=] identifier[MethodSpec] operator[SEP] identifier[methodBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[addModifiers] operator[SEP] identifier[Modifier] operator[SEP] identifier[PUBLIC] operator[SEP] operator[SEP] identifier[returns] operator[SEP] Keyword[boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[addStatement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[beginControlFlow] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[addStatement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[endControlFlow] operator[SEP] operator[SEP] operator[SEP] identifier[beginControlFlow] operator[SEP] literal[String] , identifier[Exception] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[endControlFlow] operator[SEP] operator[SEP] operator[SEP] identifier[addStatement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[classBuilder] operator[SEP] identifier[addMethod] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static String replaceHtmlEntities(String content, Map<String, Character> map) { for (Entry<String, Character> entry : escapeStrings.entrySet()) { if (content.indexOf(entry.getKey()) != -1) { content = content.replace(entry.getKey(), String.valueOf(entry.getValue())); } } return content; }
class class_name[name] begin[{] method[replaceHtmlEntities, return_type[type[String]], modifier[public static], parameter[content, map]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=content, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=replace, postfix_operators=[], prefix_operators=[], qualifier=content, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=escapeStrings, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Character, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) return[member[.content]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[replaceHtmlEntities] operator[SEP] identifier[String] identifier[content] , identifier[Map] operator[<] identifier[String] , identifier[Character] operator[>] identifier[map] operator[SEP] { Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Character] operator[>] identifier[entry] operator[:] identifier[escapeStrings] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[content] operator[SEP] identifier[indexOf] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[content] operator[=] identifier[content] operator[SEP] identifier[replace] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[content] operator[SEP] }
public List<Entity> query(Transaction transaction, Query query) { return query(transaction, query, FetchOptions.Builder.withOffset(0)); }
class class_name[name] begin[{] method[query, return_type[type[List]], modifier[public], parameter[transaction, query]] begin[{] return[call[.query, parameter[member[.transaction], member[.query], call[FetchOptions.Builder.withOffset, parameter[literal[0]]]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Entity] operator[>] identifier[query] operator[SEP] identifier[Transaction] identifier[transaction] , identifier[Query] identifier[query] operator[SEP] { Keyword[return] identifier[query] operator[SEP] identifier[transaction] , identifier[query] , identifier[FetchOptions] operator[SEP] identifier[Builder] operator[SEP] identifier[withOffset] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] }
public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, String notificationHubName) { return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body(); }
class class_name[name] begin[{] method[getPnsCredentials, return_type[type[PnsCredentialsResourceInner]], modifier[public], parameter[resourceGroupName, namespaceName, notificationHubName]] begin[{] return[call[.getPnsCredentialsWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.namespaceName], member[.notificationHubName]]]] end[}] END[}]
Keyword[public] identifier[PnsCredentialsResourceInner] identifier[getPnsCredentials] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[namespaceName] , identifier[String] identifier[notificationHubName] operator[SEP] { Keyword[return] identifier[getPnsCredentialsWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[namespaceName] , identifier[notificationHubName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public static void readLine(final String format, final String line, final Map<String, Map<String, Double>> mapMetricUserValue, final Set<String> usersToAvoid) { String[] toks = line.split("\t"); // default (also trec_eval) format: metric \t user|all \t value if (format.equals("default")) { String metric = toks[0]; String user = toks[1]; Double score = Double.parseDouble(toks[2]); if (usersToAvoid.contains(user)) { return; } Map<String, Double> userValueMap = mapMetricUserValue.get(metric); if (userValueMap == null) { userValueMap = new HashMap<String, Double>(); mapMetricUserValue.put(metric, userValueMap); } userValueMap.put(user, score); } }
class class_name[name] begin[{] method[readLine, return_type[void], modifier[public static], parameter[format, line, mapMetricUserValue, usersToAvoid]] begin[{] local_variable[type[String], toks] if[call[format.equals, parameter[literal["default"]]]] begin[{] local_variable[type[String], metric] local_variable[type[String], user] local_variable[type[Double], score] if[call[usersToAvoid.contains, parameter[member[.user]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Map], userValueMap] if[binary_operation[member[.userValueMap], ==, literal[null]]] begin[{] assign[member[.userValueMap], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))] call[mapMetricUserValue.put, parameter[member[.metric], member[.userValueMap]]] else begin[{] None end[}] call[userValueMap.put, parameter[member[.user], member[.score]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[readLine] operator[SEP] Keyword[final] identifier[String] identifier[format] , Keyword[final] identifier[String] identifier[line] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[Double] operator[>] operator[>] identifier[mapMetricUserValue] , Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[usersToAvoid] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[toks] operator[=] identifier[line] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[format] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[metric] operator[=] identifier[toks] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[String] identifier[user] operator[=] identifier[toks] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[Double] identifier[score] operator[=] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[toks] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[usersToAvoid] operator[SEP] identifier[contains] operator[SEP] identifier[user] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[Double] operator[>] identifier[userValueMap] operator[=] identifier[mapMetricUserValue] operator[SEP] identifier[get] operator[SEP] identifier[metric] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[userValueMap] operator[==] Other[null] operator[SEP] { identifier[userValueMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Double] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[mapMetricUserValue] operator[SEP] identifier[put] operator[SEP] identifier[metric] , identifier[userValueMap] operator[SEP] operator[SEP] } identifier[userValueMap] operator[SEP] identifier[put] operator[SEP] identifier[user] , identifier[score] operator[SEP] operator[SEP] } }
public By getElementLocatorForElementReference(String elementReference, String apendix) { Map<String, By> objectReferenceMap = getObjectReferenceMap(By.class); By elementLocator = objectReferenceMap.get(elementReference); if (elementLocator instanceof ById) { String xpathExpression = elementLocator.toString().replaceAll("By.id: ", "//*[@id='") + "']" + apendix; elementLocator = By.xpath(xpathExpression); } else if (elementLocator instanceof ByXPath) { String xpathExpression = elementLocator.toString().replaceAll("By.xpath: ", "") + apendix; elementLocator = By.xpath(xpathExpression); } else { fail("ElementLocator conversion error"); } if (elementLocator == null) { fail("No elementLocator is found for element name: '" + elementReference + "'. Available element references are: " + objectReferenceMap.keySet().toString()); } return elementLocator; }
class class_name[name] begin[{] method[getElementLocatorForElementReference, return_type[type[By]], modifier[public], parameter[elementReference, apendix]] begin[{] local_variable[type[Map], objectReferenceMap] local_variable[type[By], elementLocator] if[binary_operation[member[.elementLocator], instanceof, type[ById]]] begin[{] local_variable[type[String], xpathExpression] assign[member[.elementLocator], call[By.xpath, parameter[member[.xpathExpression]]]] else begin[{] if[binary_operation[member[.elementLocator], instanceof, type[ByXPath]]] begin[{] local_variable[type[String], xpathExpression] assign[member[.elementLocator], call[By.xpath, parameter[member[.xpathExpression]]]] else begin[{] call[.fail, parameter[literal["ElementLocator conversion error"]]] end[}] end[}] if[binary_operation[member[.elementLocator], ==, literal[null]]] begin[{] call[.fail, parameter[binary_operation[binary_operation[binary_operation[literal["No elementLocator is found for element name: '"], +, member[.elementReference]], +, literal["'. Available element references are: "]], +, call[objectReferenceMap.keySet, parameter[]]]]] else begin[{] None end[}] return[member[.elementLocator]] end[}] END[}]
Keyword[public] identifier[By] identifier[getElementLocatorForElementReference] operator[SEP] identifier[String] identifier[elementReference] , identifier[String] identifier[apendix] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[By] operator[>] identifier[objectReferenceMap] operator[=] identifier[getObjectReferenceMap] operator[SEP] identifier[By] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[By] identifier[elementLocator] operator[=] identifier[objectReferenceMap] operator[SEP] identifier[get] operator[SEP] identifier[elementReference] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elementLocator] Keyword[instanceof] identifier[ById] operator[SEP] { identifier[String] identifier[xpathExpression] operator[=] identifier[elementLocator] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[apendix] operator[SEP] identifier[elementLocator] operator[=] identifier[By] operator[SEP] identifier[xpath] operator[SEP] identifier[xpathExpression] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[elementLocator] Keyword[instanceof] identifier[ByXPath] operator[SEP] { identifier[String] identifier[xpathExpression] operator[=] identifier[elementLocator] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[+] identifier[apendix] operator[SEP] identifier[elementLocator] operator[=] identifier[By] operator[SEP] identifier[xpath] operator[SEP] identifier[xpathExpression] operator[SEP] operator[SEP] } Keyword[else] { identifier[fail] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[elementLocator] operator[==] Other[null] operator[SEP] { identifier[fail] operator[SEP] literal[String] operator[+] identifier[elementReference] operator[+] literal[String] operator[+] identifier[objectReferenceMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[elementLocator] operator[SEP] }
public void addOrUpdateService(ServiceInfo serviceInfo) { addComponent( serviceFilters, p -> p.services, (p, a) -> p.services = a, new ServiceInfo(serviceInfo), true); }
class class_name[name] begin[{] method[addOrUpdateService, return_type[void], modifier[public], parameter[serviceInfo]] begin[{] call[.addComponent, parameter[member[.serviceFilters], LambdaExpression(body=MemberReference(member=services, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[]), parameters=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), LambdaExpression(body=Assignment(expressionl=MemberReference(member=services, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[]), type==, value=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), parameters=[InferredFormalParameter(name=p), InferredFormalParameter(name=a)]), ClassCreator(arguments=[MemberReference(member=serviceInfo, 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=ServiceInfo, sub_type=None)), literal[true]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addOrUpdateService] operator[SEP] identifier[ServiceInfo] identifier[serviceInfo] operator[SEP] { identifier[addComponent] operator[SEP] identifier[serviceFilters] , identifier[p] operator[->] identifier[p] operator[SEP] identifier[services] , operator[SEP] identifier[p] , identifier[a] operator[SEP] operator[->] identifier[p] operator[SEP] identifier[services] operator[=] identifier[a] , Keyword[new] identifier[ServiceInfo] operator[SEP] identifier[serviceInfo] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] }
public ServiceFuture<PolicyEventsQueryResultsInner> listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(String subscriptionId, String resourceGroupName, String policyAssignmentName, QueryOptions queryOptions, final ServiceCallback<PolicyEventsQueryResultsInner> serviceCallback) { return ServiceFuture.fromResponse(listQueryResultsForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync(subscriptionId, resourceGroupName, policyAssignmentName, queryOptions), serviceCallback); }
class class_name[name] begin[{] method[listQueryResultsForResourceGroupLevelPolicyAssignmentAsync, return_type[type[ServiceFuture]], modifier[public], parameter[subscriptionId, resourceGroupName, policyAssignmentName, queryOptions, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.listQueryResultsForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync, parameter[member[.subscriptionId], member[.resourceGroupName], member[.policyAssignmentName], member[.queryOptions]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[PolicyEventsQueryResultsInner] operator[>] identifier[listQueryResultsForResourceGroupLevelPolicyAssignmentAsync] operator[SEP] identifier[String] identifier[subscriptionId] , identifier[String] identifier[resourceGroupName] , identifier[String] identifier[policyAssignmentName] , identifier[QueryOptions] identifier[queryOptions] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[PolicyEventsQueryResultsInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[listQueryResultsForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync] operator[SEP] identifier[subscriptionId] , identifier[resourceGroupName] , identifier[policyAssignmentName] , identifier[queryOptions] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
@PUT @Consumes(MediaType.APPLICATION_JSON) public Response put(@PathParam("cacheName") String cacheName, Cache cache) { if (!cacheService.isPresent(cacheName)) { return Response.status(Response.Status.NOT_FOUND).build(); } cacheService.update(cacheName, cache); return Response.ok().build(); }
class class_name[name] begin[{] method[put, return_type[type[Response]], modifier[public], parameter[cacheName, cache]] begin[{] if[call[cacheService.isPresent, parameter[member[.cacheName]]]] begin[{] return[call[Response.status, parameter[member[Response.Status.NOT_FOUND]]]] else begin[{] None end[}] call[cacheService.update, parameter[member[.cacheName], member[.cache]]] return[call[Response.ok, parameter[]]] end[}] END[}]
annotation[@] identifier[PUT] annotation[@] identifier[Consumes] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] Keyword[public] identifier[Response] identifier[put] operator[SEP] annotation[@] identifier[PathParam] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[cacheName] , identifier[Cache] identifier[cache] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[cacheService] operator[SEP] identifier[isPresent] operator[SEP] identifier[cacheName] operator[SEP] operator[SEP] { Keyword[return] identifier[Response] operator[SEP] identifier[status] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[NOT_FOUND] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } identifier[cacheService] operator[SEP] identifier[update] operator[SEP] identifier[cacheName] , identifier[cache] operator[SEP] operator[SEP] Keyword[return] identifier[Response] operator[SEP] identifier[ok] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
@Override public ListInvitationsResult listInvitations(ListInvitationsRequest request) { request = beforeClientExecution(request); return executeListInvitations(request); }
class class_name[name] begin[{] method[listInvitations, return_type[type[ListInvitationsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeListInvitations, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ListInvitationsResult] identifier[listInvitations] operator[SEP] identifier[ListInvitationsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeListInvitations] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public ClassFilterBuilder isDefault() { add(new NegationClassFilter(new ModifierClassFilter(Modifier.PUBLIC & Modifier.PROTECTED & Modifier.PRIVATE))); return this; }
class class_name[name] begin[{] method[isDefault, return_type[type[ClassFilterBuilder]], modifier[public], parameter[]] begin[{] call[.add, parameter[ClassCreator(arguments=[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PUBLIC, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[]), operandr=MemberReference(member=PROTECTED, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[]), operator=&), operandr=MemberReference(member=PRIVATE, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[]), operator=&)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModifierClassFilter, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NegationClassFilter, sub_type=None))]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ClassFilterBuilder] identifier[isDefault] operator[SEP] operator[SEP] { identifier[add] operator[SEP] Keyword[new] identifier[NegationClassFilter] operator[SEP] Keyword[new] identifier[ModifierClassFilter] operator[SEP] identifier[Modifier] operator[SEP] identifier[PUBLIC] operator[&] identifier[Modifier] operator[SEP] identifier[PROTECTED] operator[&] identifier[Modifier] operator[SEP] identifier[PRIVATE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public List<String> put(String key, List<String> value) { return getMap().put(key, value); }
class class_name[name] begin[{] method[put, return_type[type[List]], modifier[public], parameter[key, value]] begin[{] return[call[.getMap, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[put] operator[SEP] identifier[String] identifier[key] , identifier[List] operator[<] identifier[String] operator[>] identifier[value] operator[SEP] { Keyword[return] identifier[getMap] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] }
@NonNull public static Drawable getTintDrawable(@NonNull Drawable drawable, @ColorInt int color) { drawable = DrawableCompat.wrap(drawable.mutate()); DrawableCompat.setTint(drawable, color); return drawable; }
class class_name[name] begin[{] method[getTintDrawable, return_type[type[Drawable]], modifier[public static], parameter[drawable, color]] begin[{] assign[member[.drawable], call[DrawableCompat.wrap, parameter[call[drawable.mutate, parameter[]]]]] call[DrawableCompat.setTint, parameter[member[.drawable], member[.color]]] return[member[.drawable]] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[public] Keyword[static] identifier[Drawable] identifier[getTintDrawable] operator[SEP] annotation[@] identifier[NonNull] identifier[Drawable] identifier[drawable] , annotation[@] identifier[ColorInt] Keyword[int] identifier[color] operator[SEP] { identifier[drawable] operator[=] identifier[DrawableCompat] operator[SEP] identifier[wrap] operator[SEP] identifier[drawable] operator[SEP] identifier[mutate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DrawableCompat] operator[SEP] identifier[setTint] operator[SEP] identifier[drawable] , identifier[color] operator[SEP] operator[SEP] Keyword[return] identifier[drawable] operator[SEP] }
public JSONObject updateApiKey(String key, List<String> acls) throws AlgoliaException { return updateApiKey(key, acls, 0, 0, 0); }
class class_name[name] begin[{] method[updateApiKey, return_type[type[JSONObject]], modifier[public], parameter[key, acls]] begin[{] return[call[.updateApiKey, parameter[member[.key], member[.acls], literal[0], literal[0], literal[0]]]] end[}] END[}]
Keyword[public] identifier[JSONObject] identifier[updateApiKey] operator[SEP] identifier[String] identifier[key] , identifier[List] operator[<] identifier[String] operator[>] identifier[acls] operator[SEP] Keyword[throws] identifier[AlgoliaException] { Keyword[return] identifier[updateApiKey] operator[SEP] identifier[key] , identifier[acls] , Other[0] , Other[0] , Other[0] operator[SEP] operator[SEP] }
@Override public void validate(ValidationHelper helper, Context context, String key, PathItem t) { if (t != null) { String ref = t.getRef(); if (ref != null && ref.startsWith("#")) { final String message = Tr.formatMessage(tc, "pathItemInvalidRef", ref, key); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation(), message)); } if (key.contains("{$")) { //Path within a Callback can contain variables (e.g. {$request.query.callbackUrl}/data ) which shouldn't be validated since they are not path params if (OpenAPIUtils.isDebugEnabled(tc)) { Tr.debug(tc, "Path contains variables. Skip validation: " + key); } return; } validateParameters(helper, context, key, t); } }
class class_name[name] begin[{] method[validate, return_type[void], modifier[public], parameter[helper, context, key, t]] begin[{] if[binary_operation[member[.t], !=, literal[null]]] begin[{] local_variable[type[String], ref] if[binary_operation[binary_operation[member[.ref], !=, literal[null]], &&, call[ref.startsWith, parameter[literal["#"]]]]] begin[{] local_variable[type[String], message] call[helper.addValidationEvent, parameter[ClassCreator(arguments=[MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=ValidationEvent.Severity, selectors=[]), MethodInvocation(arguments=[], member=getLocation, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), MemberReference(member=message, 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=ValidationEvent, sub_type=None))]] else begin[{] None end[}] if[call[key.contains, parameter[literal["{$"]]]] begin[{] if[call[OpenAPIUtils.isDebugEnabled, parameter[member[.tc]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[literal["Path contains variables. Skip validation: "], +, member[.key]]]] else begin[{] None end[}] return[None] else begin[{] None end[}] call[.validateParameters, parameter[member[.helper], member[.context], member[.key], member[.t]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[validate] operator[SEP] identifier[ValidationHelper] identifier[helper] , identifier[Context] identifier[context] , identifier[String] identifier[key] , identifier[PathItem] identifier[t] operator[SEP] { Keyword[if] operator[SEP] identifier[t] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[ref] operator[=] identifier[t] operator[SEP] identifier[getRef] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ref] operator[!=] Other[null] operator[&&] identifier[ref] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[message] operator[=] identifier[Tr] operator[SEP] identifier[formatMessage] operator[SEP] identifier[tc] , literal[String] , identifier[ref] , identifier[key] operator[SEP] operator[SEP] identifier[helper] operator[SEP] identifier[addValidationEvent] operator[SEP] Keyword[new] identifier[ValidationEvent] operator[SEP] identifier[ValidationEvent] operator[SEP] identifier[Severity] operator[SEP] identifier[ERROR] , identifier[context] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] , identifier[message] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[OpenAPIUtils] operator[SEP] identifier[isDebugEnabled] operator[SEP] identifier[tc] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[key] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } identifier[validateParameters] operator[SEP] identifier[helper] , identifier[context] , identifier[key] , identifier[t] operator[SEP] operator[SEP] } }
private void synchronizeHosts(final AsyncCallback<Boolean> callback) { ModelNode op = new ModelNode(); op.get(ADDRESS).setEmptyList(); op.get(OP).set(READ_CHILDREN_RESOURCES_OPERATION); op.get(CHILD_TYPE).set("host"); Footer.PROGRESS_ELEMENT.reset(); dispatcher.execute(new DMRAction(op), new AsyncCallback<DMRResponse>() { @Override public void onFailure(Throwable caught) { Footer.PROGRESS_ELEMENT.finish(); callback.onFailure(caught); } @Override public void onSuccess(DMRResponse result) { ModelNode response = result.get(); if (response.isFailure()) { Footer.PROGRESS_ELEMENT.finish(); callback.onFailure(new RuntimeException("Failed to synchronize host model: " + response.getFailureDescription())); } else { List<Property> properties = response.get(RESULT).asPropertyList(); List<String> hostNames = new ArrayList<String>(properties.size()); for (Property property : properties) { hostNames.add(property.getName()); if (property.getValue().hasDefined("master") && property.getValue().get("master").asBoolean()) { domainController = property.getName(); } } Footer.PROGRESS_ELEMENT.finish(); // synchronize servers synchronizeServerModel(hostNames, callback); } } }); }
class class_name[name] begin[{] method[synchronizeHosts, return_type[void], modifier[private], parameter[callback]] begin[{] local_variable[type[ModelNode], op] call[op.get, parameter[member[.ADDRESS]]] call[op.get, parameter[member[.OP]]] call[op.get, parameter[member[.CHILD_TYPE]]] call[Footer.PROGRESS_ELEMENT.reset, parameter[]] call[dispatcher.execute, parameter[ClassCreator(arguments=[MemberReference(member=op, 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=DMRAction, sub_type=None)), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=finish, postfix_operators=[], prefix_operators=[], qualifier=Footer.PROGRESS_ELEMENT, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=caught, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onFailure, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=caught, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), name=response)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModelNode, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isFailure, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=RESULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[MethodInvocation(arguments=[], member=asPropertyList, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=properties)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Property, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=hostNames)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=hostNames, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="master")], member=hasDefined, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="master")], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=asBoolean, 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=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=domainController, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=property)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Property, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=finish, postfix_operators=[], prefix_operators=[], qualifier=Footer.PROGRESS_ELEMENT, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=hostNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=synchronizeServerModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=finish, postfix_operators=[], prefix_operators=[], qualifier=Footer.PROGRESS_ELEMENT, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to synchronize host model: "), operandr=MethodInvocation(arguments=[], member=getFailureDescription, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None))], member=onFailure, postfix_operators=[], prefix_operators=[], qualifier=callback, 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=DMRResponse, 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=DMRResponse, sub_type=None))], dimensions=None, name=AsyncCallback, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[synchronizeHosts] operator[SEP] Keyword[final] identifier[AsyncCallback] operator[<] identifier[Boolean] operator[>] identifier[callback] operator[SEP] { identifier[ModelNode] identifier[op] operator[=] Keyword[new] identifier[ModelNode] operator[SEP] operator[SEP] operator[SEP] identifier[op] operator[SEP] identifier[get] operator[SEP] identifier[ADDRESS] operator[SEP] operator[SEP] identifier[setEmptyList] operator[SEP] operator[SEP] operator[SEP] identifier[op] operator[SEP] identifier[get] operator[SEP] identifier[OP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[READ_CHILDREN_RESOURCES_OPERATION] operator[SEP] operator[SEP] identifier[op] operator[SEP] identifier[get] operator[SEP] identifier[CHILD_TYPE] operator[SEP] operator[SEP] identifier[set] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Footer] operator[SEP] identifier[PROGRESS_ELEMENT] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[dispatcher] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[DMRAction] operator[SEP] identifier[op] operator[SEP] , Keyword[new] identifier[AsyncCallback] operator[<] identifier[DMRResponse] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[caught] operator[SEP] { identifier[Footer] operator[SEP] identifier[PROGRESS_ELEMENT] operator[SEP] identifier[finish] operator[SEP] operator[SEP] operator[SEP] identifier[callback] operator[SEP] identifier[onFailure] operator[SEP] identifier[caught] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[DMRResponse] identifier[result] operator[SEP] { identifier[ModelNode] identifier[response] operator[=] identifier[result] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[isFailure] operator[SEP] operator[SEP] operator[SEP] { identifier[Footer] operator[SEP] identifier[PROGRESS_ELEMENT] operator[SEP] identifier[finish] operator[SEP] operator[SEP] operator[SEP] identifier[callback] operator[SEP] identifier[onFailure] operator[SEP] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[response] operator[SEP] identifier[getFailureDescription] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[List] operator[<] identifier[Property] operator[>] identifier[properties] operator[=] identifier[response] operator[SEP] identifier[get] operator[SEP] identifier[RESULT] operator[SEP] operator[SEP] identifier[asPropertyList] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[hostNames] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[properties] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Property] identifier[property] operator[:] identifier[properties] operator[SEP] { identifier[hostNames] operator[SEP] identifier[add] operator[SEP] identifier[property] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[property] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[hasDefined] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[property] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[asBoolean] operator[SEP] operator[SEP] operator[SEP] { identifier[domainController] operator[=] identifier[property] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] } } identifier[Footer] operator[SEP] identifier[PROGRESS_ELEMENT] operator[SEP] identifier[finish] operator[SEP] operator[SEP] operator[SEP] identifier[synchronizeServerModel] operator[SEP] identifier[hostNames] , identifier[callback] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public MonetaryRounding getRounding(RoundingQuery query) { Collection<MonetaryRounding> roundings = getRoundings(query); if (roundings.isEmpty()) { return null; } return roundings.iterator().next(); }
class class_name[name] begin[{] method[getRounding, return_type[type[MonetaryRounding]], modifier[public], parameter[query]] begin[{] local_variable[type[Collection], roundings] if[call[roundings.isEmpty, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[roundings.iterator, parameter[]]] end[}] END[}]
Keyword[public] identifier[MonetaryRounding] identifier[getRounding] operator[SEP] identifier[RoundingQuery] identifier[query] operator[SEP] { identifier[Collection] operator[<] identifier[MonetaryRounding] operator[>] identifier[roundings] operator[=] identifier[getRoundings] operator[SEP] identifier[query] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[roundings] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[roundings] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] }
@AfterThrowing(pointcut = "execution(* org.apache.cassandra.thrift.CassandraServer.doInsert(..))", throwing = "throwable") public void logErrorFromThrownException(final JoinPoint joinPoint, final Throwable throwable) { final String className = joinPoint.getTarget().getClass().getName(); final String methodName = joinPoint.getSignature().getName(); logger.error("Could not write to cassandra! Method: " + className + "."+ methodName + "()", throwable); }
class class_name[name] begin[{] method[logErrorFromThrownException, return_type[void], modifier[public], parameter[joinPoint, throwable]] begin[{] local_variable[type[String], className] local_variable[type[String], methodName] call[logger.error, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Could not write to cassandra! Method: "], +, member[.className]], +, literal["."]], +, member[.methodName]], +, literal["()"]], member[.throwable]]] end[}] END[}]
annotation[@] identifier[AfterThrowing] operator[SEP] identifier[pointcut] operator[=] literal[String] , identifier[throwing] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[logErrorFromThrownException] operator[SEP] Keyword[final] identifier[JoinPoint] identifier[joinPoint] , Keyword[final] identifier[Throwable] identifier[throwable] operator[SEP] { Keyword[final] identifier[String] identifier[className] operator[=] identifier[joinPoint] operator[SEP] identifier[getTarget] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[methodName] operator[=] identifier[joinPoint] operator[SEP] identifier[getSignature] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[className] operator[+] literal[String] operator[+] identifier[methodName] operator[+] literal[String] , identifier[throwable] operator[SEP] operator[SEP] }
public boolean debugIsPageIdInFreeList(int pageId) { return (toAdd.contains(pageId) || idx.findValue(pageId) != null) && !toDelete.contains(pageId); }
class class_name[name] begin[{] method[debugIsPageIdInFreeList, return_type[type[boolean]], modifier[public], parameter[pageId]] begin[{] return[binary_operation[binary_operation[call[toAdd.contains, parameter[member[.pageId]]], ||, binary_operation[call[idx.findValue, parameter[member[.pageId]]], !=, literal[null]]], &&, call[toDelete.contains, parameter[member[.pageId]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[debugIsPageIdInFreeList] operator[SEP] Keyword[int] identifier[pageId] operator[SEP] { Keyword[return] operator[SEP] identifier[toAdd] operator[SEP] identifier[contains] operator[SEP] identifier[pageId] operator[SEP] operator[||] identifier[idx] operator[SEP] identifier[findValue] operator[SEP] identifier[pageId] operator[SEP] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[toDelete] operator[SEP] identifier[contains] operator[SEP] identifier[pageId] operator[SEP] operator[SEP] }
public static String jsonifyClusterTrackers(Pair<Long, Long> lastConsumerUniqueIds, Map<Integer, Map<Integer, DRSiteDrIdTracker>> allProducerTrackers) throws JSONException { JSONStringer stringer = new JSONStringer(); stringer.object(); stringer.keySymbolValuePair("lastConsumerSpUniqueId", lastConsumerUniqueIds.getFirst()); stringer.keySymbolValuePair("lastConsumerMpUniqueId", lastConsumerUniqueIds.getSecond()); stringer.key("trackers").object(); if (allProducerTrackers != null) { for (Map.Entry<Integer, Map<Integer, DRSiteDrIdTracker>> clusterTrackers : allProducerTrackers.entrySet()) { stringer.key(Integer.toString(clusterTrackers.getKey())).object(); for (Map.Entry<Integer, DRSiteDrIdTracker> e : clusterTrackers.getValue().entrySet()) { stringer.key(e.getKey().toString()); stringer.value(e.getValue().toJSON()); } stringer.endObject(); } } stringer.endObject(); stringer.endObject(); return stringer.toString(); }
class class_name[name] begin[{] method[jsonifyClusterTrackers, return_type[type[String]], modifier[public static], parameter[lastConsumerUniqueIds, allProducerTrackers]] begin[{] local_variable[type[JSONStringer], stringer] call[stringer.object, parameter[]] call[stringer.keySymbolValuePair, parameter[literal["lastConsumerSpUniqueId"], call[lastConsumerUniqueIds.getFirst, parameter[]]]] call[stringer.keySymbolValuePair, parameter[literal["lastConsumerMpUniqueId"], call[lastConsumerUniqueIds.getSecond, parameter[]]]] call[stringer.key, parameter[literal["trackers"]]] if[binary_operation[member[.allProducerTrackers], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=clusterTrackers, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=key, postfix_operators=[], prefix_operators=[], qualifier=stringer, selectors=[MethodInvocation(arguments=[], member=object, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=key, postfix_operators=[], prefix_operators=[], qualifier=stringer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=toJSON, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=value, postfix_operators=[], prefix_operators=[], qualifier=stringer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=clusterTrackers, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DRSiteDrIdTracker, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=endObject, postfix_operators=[], prefix_operators=[], qualifier=stringer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=allProducerTrackers, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=clusterTrackers)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DRSiteDrIdTracker, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) else begin[{] None end[}] call[stringer.endObject, parameter[]] call[stringer.endObject, parameter[]] return[call[stringer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[jsonifyClusterTrackers] operator[SEP] identifier[Pair] operator[<] identifier[Long] , identifier[Long] operator[>] identifier[lastConsumerUniqueIds] , identifier[Map] operator[<] identifier[Integer] , identifier[Map] operator[<] identifier[Integer] , identifier[DRSiteDrIdTracker] operator[>] operator[>] identifier[allProducerTrackers] operator[SEP] Keyword[throws] identifier[JSONException] { identifier[JSONStringer] identifier[stringer] operator[=] Keyword[new] identifier[JSONStringer] operator[SEP] operator[SEP] operator[SEP] identifier[stringer] operator[SEP] identifier[object] operator[SEP] operator[SEP] operator[SEP] identifier[stringer] operator[SEP] identifier[keySymbolValuePair] operator[SEP] literal[String] , identifier[lastConsumerUniqueIds] operator[SEP] identifier[getFirst] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stringer] operator[SEP] identifier[keySymbolValuePair] operator[SEP] literal[String] , identifier[lastConsumerUniqueIds] operator[SEP] identifier[getSecond] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stringer] operator[SEP] identifier[key] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[object] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[allProducerTrackers] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[Map] operator[<] identifier[Integer] , identifier[DRSiteDrIdTracker] operator[>] operator[>] identifier[clusterTrackers] operator[:] identifier[allProducerTrackers] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[stringer] operator[SEP] identifier[key] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[clusterTrackers] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[object] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[DRSiteDrIdTracker] operator[>] identifier[e] operator[:] identifier[clusterTrackers] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[stringer] operator[SEP] identifier[key] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stringer] operator[SEP] identifier[value] operator[SEP] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[toJSON] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[stringer] operator[SEP] identifier[endObject] operator[SEP] operator[SEP] operator[SEP] } } identifier[stringer] operator[SEP] identifier[endObject] operator[SEP] operator[SEP] operator[SEP] identifier[stringer] operator[SEP] identifier[endObject] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[stringer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private String getNextLine(BufferedReader reader) throws Exception { String line = reader.readLine(); if (line != null) { return line; } else { throw new Exception("Error parsing server status file (unexpectedly ended): " + _file.getPath()); } }
class class_name[name] begin[{] method[getNextLine, return_type[type[String]], modifier[private], parameter[reader]] begin[{] local_variable[type[String], line] if[binary_operation[member[.line], !=, literal[null]]] begin[{] return[member[.line]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error parsing server status file (unexpectedly ended): "), operandr=MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=_file, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[private] identifier[String] identifier[getNextLine] operator[SEP] identifier[BufferedReader] identifier[reader] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[line] operator[=] identifier[reader] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[line] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[+] identifier[_file] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public ListConfigurationsResult withConfigurations(java.util.Map<String, String>... configurations) { if (this.configurations == null) { setConfigurations(new java.util.ArrayList<java.util.Map<String, String>>(configurations.length)); } for (java.util.Map<String, String> ele : configurations) { this.configurations.add(ele); } return this; }
class class_name[name] begin[{] method[withConfigurations, return_type[type[ListConfigurationsResult]], modifier[public], parameter[configurations]] begin[{] if[binary_operation[THIS[member[None.configurations]], ==, literal[null]]] begin[{] call[.setConfigurations, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=configurations, 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=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)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Map, sub_type=None))))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=configurations, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=configurations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=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)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Map, sub_type=None))))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ListConfigurationsResult] identifier[withConfigurations] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[...] identifier[configurations] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[configurations] operator[==] Other[null] operator[SEP] { identifier[setConfigurations] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] operator[SEP] identifier[configurations] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[ele] operator[:] identifier[configurations] operator[SEP] { Keyword[this] operator[SEP] identifier[configurations] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override protected IMAPSSLStore getStore(final Session session) { SimpleAuthenticator simpleAuthenticator = (SimpleAuthenticator) authenticator; final URLName url; if (simpleAuthenticator == null) { url = new URLName( PROTOCOL_IMAP, host, port, StringPool.EMPTY, null, null); } else { final PasswordAuthentication pa = simpleAuthenticator.getPasswordAuthentication(); url = new URLName( PROTOCOL_IMAP, host, port, StringPool.EMPTY, pa.getUserName(), pa.getPassword()); } return new IMAPSSLStore(session, url); }
class class_name[name] begin[{] method[getStore, return_type[type[IMAPSSLStore]], modifier[protected], parameter[session]] begin[{] local_variable[type[SimpleAuthenticator], simpleAuthenticator] local_variable[type[URLName], url] if[binary_operation[member[.simpleAuthenticator], ==, literal[null]]] begin[{] assign[member[.url], ClassCreator(arguments=[MemberReference(member=PROTOCOL_IMAP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EMPTY, postfix_operators=[], prefix_operators=[], qualifier=StringPool, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URLName, sub_type=None))] else begin[{] local_variable[type[PasswordAuthentication], pa] assign[member[.url], ClassCreator(arguments=[MemberReference(member=PROTOCOL_IMAP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EMPTY, postfix_operators=[], prefix_operators=[], qualifier=StringPool, selectors=[]), MethodInvocation(arguments=[], member=getUserName, postfix_operators=[], prefix_operators=[], qualifier=pa, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPassword, postfix_operators=[], prefix_operators=[], qualifier=pa, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URLName, sub_type=None))] end[}] return[ClassCreator(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=url, 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=IMAPSSLStore, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[IMAPSSLStore] identifier[getStore] operator[SEP] Keyword[final] identifier[Session] identifier[session] operator[SEP] { identifier[SimpleAuthenticator] identifier[simpleAuthenticator] operator[=] operator[SEP] identifier[SimpleAuthenticator] operator[SEP] identifier[authenticator] operator[SEP] Keyword[final] identifier[URLName] identifier[url] operator[SEP] Keyword[if] operator[SEP] identifier[simpleAuthenticator] operator[==] Other[null] operator[SEP] { identifier[url] operator[=] Keyword[new] identifier[URLName] operator[SEP] identifier[PROTOCOL_IMAP] , identifier[host] , identifier[port] , identifier[StringPool] operator[SEP] identifier[EMPTY] , Other[null] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] identifier[PasswordAuthentication] identifier[pa] operator[=] identifier[simpleAuthenticator] operator[SEP] identifier[getPasswordAuthentication] operator[SEP] operator[SEP] operator[SEP] identifier[url] operator[=] Keyword[new] identifier[URLName] operator[SEP] identifier[PROTOCOL_IMAP] , identifier[host] , identifier[port] , identifier[StringPool] operator[SEP] identifier[EMPTY] , identifier[pa] operator[SEP] identifier[getUserName] operator[SEP] operator[SEP] , identifier[pa] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[IMAPSSLStore] operator[SEP] identifier[session] , identifier[url] operator[SEP] operator[SEP] }
public static CompositeOverlay getCompositeOverlay(TileDao tileDao, BoundedOverlay overlay) { List<TileDao> tileDaos = new ArrayList<>(); tileDaos.add(tileDao); return getCompositeOverlay(tileDaos, overlay); }
class class_name[name] begin[{] method[getCompositeOverlay, return_type[type[CompositeOverlay]], modifier[public static], parameter[tileDao, overlay]] begin[{] local_variable[type[List], tileDaos] call[tileDaos.add, parameter[member[.tileDao]]] return[call[.getCompositeOverlay, parameter[member[.tileDaos], member[.overlay]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CompositeOverlay] identifier[getCompositeOverlay] operator[SEP] identifier[TileDao] identifier[tileDao] , identifier[BoundedOverlay] identifier[overlay] operator[SEP] { identifier[List] operator[<] identifier[TileDao] operator[>] identifier[tileDaos] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[tileDaos] operator[SEP] identifier[add] operator[SEP] identifier[tileDao] operator[SEP] operator[SEP] Keyword[return] identifier[getCompositeOverlay] operator[SEP] identifier[tileDaos] , identifier[overlay] operator[SEP] operator[SEP] }
public boolean status(int responseCode) { if (urlConnection instanceof HttpURLConnection) { HttpURLConnection http = (HttpURLConnection) urlConnection; try { return http.getResponseCode() == responseCode; } catch (IOException e) { e.printStackTrace(); return false; } } else return false; }
class class_name[name] begin[{] method[status, return_type[type[boolean]], modifier[public], parameter[responseCode]] begin[{] if[binary_operation[member[.urlConnection], instanceof, type[HttpURLConnection]]] begin[{] local_variable[type[HttpURLConnection], http] TryStatement(block=[ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getResponseCode, postfix_operators=[], prefix_operators=[], qualifier=http, selectors=[], type_arguments=None), operandr=MemberReference(member=responseCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[status] operator[SEP] Keyword[int] identifier[responseCode] operator[SEP] { Keyword[if] operator[SEP] identifier[urlConnection] Keyword[instanceof] identifier[HttpURLConnection] operator[SEP] { identifier[HttpURLConnection] identifier[http] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[urlConnection] operator[SEP] Keyword[try] { Keyword[return] identifier[http] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[==] identifier[responseCode] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } Keyword[else] Keyword[return] literal[boolean] operator[SEP] }
@Override protected void onBoolean(Boolean bool, String fieldName, JsonParser jp) { if (resultStarted) { found = true; ClassUtil.setSilent(entity, fieldName, bool); } }
class class_name[name] begin[{] method[onBoolean, return_type[void], modifier[protected], parameter[bool, fieldName, jp]] begin[{] if[member[.resultStarted]] begin[{] assign[member[.found], literal[true]] call[ClassUtil.setSilent, parameter[member[.entity], member[.fieldName], member[.bool]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[onBoolean] operator[SEP] identifier[Boolean] identifier[bool] , identifier[String] identifier[fieldName] , identifier[JsonParser] identifier[jp] operator[SEP] { Keyword[if] operator[SEP] identifier[resultStarted] operator[SEP] { identifier[found] operator[=] literal[boolean] operator[SEP] identifier[ClassUtil] operator[SEP] identifier[setSilent] operator[SEP] identifier[entity] , identifier[fieldName] , identifier[bool] operator[SEP] operator[SEP] } }
@Override public void interceptCleanupMethod(IMethodInvocation invocation) throws Throwable { log.fine("after " + invocation.getFeature().getFeatureMethod().getReflection().getName()); getTestRunner().after(invocation.getTarget(), invocation.getFeature().getFeatureMethod().getReflection(), new InvocationExecutor(invocation)); }
class class_name[name] begin[{] method[interceptCleanupMethod, return_type[void], modifier[public], parameter[invocation]] begin[{] call[log.fine, parameter[binary_operation[literal["after "], +, call[invocation.getFeature, parameter[]]]]] call[.getTestRunner, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[interceptCleanupMethod] operator[SEP] identifier[IMethodInvocation] identifier[invocation] operator[SEP] Keyword[throws] identifier[Throwable] { identifier[log] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[invocation] operator[SEP] identifier[getFeature] operator[SEP] operator[SEP] operator[SEP] identifier[getFeatureMethod] operator[SEP] operator[SEP] operator[SEP] identifier[getReflection] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getTestRunner] operator[SEP] operator[SEP] operator[SEP] identifier[after] operator[SEP] identifier[invocation] operator[SEP] identifier[getTarget] operator[SEP] operator[SEP] , identifier[invocation] operator[SEP] identifier[getFeature] operator[SEP] operator[SEP] operator[SEP] identifier[getFeatureMethod] operator[SEP] operator[SEP] operator[SEP] identifier[getReflection] operator[SEP] operator[SEP] , Keyword[new] identifier[InvocationExecutor] operator[SEP] identifier[invocation] operator[SEP] operator[SEP] operator[SEP] }
protected <T extends DomainEvent> T registerEvent(T event) { Assert.notNull(event, "Domain event must not be null!"); this.domainEvents.add(event); return event; }
class class_name[name] begin[{] method[registerEvent, return_type[type[T]], modifier[protected], parameter[event]] begin[{] call[Assert.notNull, parameter[member[.event], literal["Domain event must not be null!"]]] THIS[member[None.domainEvents]call[None.add, parameter[member[.event]]]] return[member[.event]] end[}] END[}]
Keyword[protected] operator[<] identifier[T] Keyword[extends] identifier[DomainEvent] operator[>] identifier[T] identifier[registerEvent] operator[SEP] identifier[T] identifier[event] operator[SEP] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[event] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[domainEvents] operator[SEP] identifier[add] operator[SEP] identifier[event] operator[SEP] operator[SEP] Keyword[return] identifier[event] operator[SEP] }
public final Iterable<EWAHPointer32> getLiterals() { return new Iterable<EWAHPointer32>() { @Override public Iterator<EWAHPointer32> iterator() { return new Iterator<EWAHPointer32>() { int k = UpdateableBitmapFunction32.this.litwlist .nextSetBit(0); @Override public boolean hasNext() { return this.k >= 0; } @Override public EWAHPointer32 next() { EWAHPointer32 answer = UpdateableBitmapFunction32.this.rw[this.k]; this.k = UpdateableBitmapFunction32.this.litwlist .nextSetBit(this.k + 1); return answer; } @Override public void remove() { throw new RuntimeException( "N/A"); } }; } }; }
class class_name[name] begin[{] method[getLiterals, return_type[type[Iterable]], modifier[final public], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=UpdateableBitmapFunction32, selectors=[MemberReference(member=litwlist, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=nextSetBit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=k)], documentation=None, modifiers=set(), type=BasicType(dimensions=[], name=int)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=k, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=UpdateableBitmapFunction32, selectors=[MemberReference(member=rw, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=k, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]), name=answer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EWAHPointer32, sub_type=None)), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=k, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=UpdateableBitmapFunction32, selectors=[MemberReference(member=litwlist, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=k, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=nextSetBit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), ReturnStatement(expression=MemberReference(member=answer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=next, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=EWAHPointer32, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="N/A")], 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)], documentation=None, modifiers={'public'}, name=remove, parameters=[], 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=EWAHPointer32, sub_type=None))], dimensions=None, name=Iterator, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=iterator, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=EWAHPointer32, sub_type=None))], dimensions=[], name=Iterator, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=EWAHPointer32, sub_type=None))], dimensions=None, name=Iterable, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[final] identifier[Iterable] operator[<] identifier[EWAHPointer32] operator[>] identifier[getLiterals] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Iterable] operator[<] identifier[EWAHPointer32] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[EWAHPointer32] operator[>] identifier[iterator] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Iterator] operator[<] identifier[EWAHPointer32] operator[>] operator[SEP] operator[SEP] { Keyword[int] identifier[k] operator[=] identifier[UpdateableBitmapFunction32] operator[SEP] Keyword[this] operator[SEP] identifier[litwlist] operator[SEP] identifier[nextSetBit] operator[SEP] Other[0] operator[SEP] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[k] operator[>=] Other[0] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[EWAHPointer32] identifier[next] operator[SEP] operator[SEP] { identifier[EWAHPointer32] identifier[answer] operator[=] identifier[UpdateableBitmapFunction32] operator[SEP] Keyword[this] operator[SEP] identifier[rw] operator[SEP] Keyword[this] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[k] operator[=] identifier[UpdateableBitmapFunction32] operator[SEP] Keyword[this] operator[SEP] identifier[litwlist] operator[SEP] identifier[nextSetBit] operator[SEP] Keyword[this] operator[SEP] identifier[k] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[answer] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[remove] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } operator[SEP] } } operator[SEP] }
public static HtmlTree SECTION(Content body) { HtmlTree htmltree = new HtmlTree(HtmlTag.SECTION, nullCheck(body)); htmltree.setRole(Role.REGION); return htmltree; }
class class_name[name] begin[{] method[SECTION, return_type[type[HtmlTree]], modifier[public static], parameter[body]] begin[{] local_variable[type[HtmlTree], htmltree] call[htmltree.setRole, parameter[member[Role.REGION]]] return[member[.htmltree]] end[}] END[}]
Keyword[public] Keyword[static] identifier[HtmlTree] identifier[SECTION] operator[SEP] identifier[Content] identifier[body] operator[SEP] { identifier[HtmlTree] identifier[htmltree] operator[=] Keyword[new] identifier[HtmlTree] operator[SEP] identifier[HtmlTag] operator[SEP] identifier[SECTION] , identifier[nullCheck] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] identifier[htmltree] operator[SEP] identifier[setRole] operator[SEP] identifier[Role] operator[SEP] identifier[REGION] operator[SEP] operator[SEP] Keyword[return] identifier[htmltree] operator[SEP] }
public static List<File> getFiles(String inputPath) { File file = new File(inputPath); if (!inputPath.contains("*")) { List<File> res = new ArrayList<>(); if (file.exists()) { res.add(file); } return res; } else { String prefix = inputPath.substring(0, inputPath.indexOf(AlluxioURI.WILDCARD) + 1); String parent = new File(prefix).getParent(); return getFiles(inputPath, parent); } }
class class_name[name] begin[{] method[getFiles, return_type[type[List]], modifier[public static], parameter[inputPath]] begin[{] local_variable[type[File], file] if[call[inputPath.contains, parameter[literal["*"]]]] begin[{] local_variable[type[List], res] if[call[file.exists, parameter[]]] begin[{] call[res.add, parameter[member[.file]]] else begin[{] None end[}] return[member[.res]] else begin[{] local_variable[type[String], prefix] local_variable[type[String], parent] return[call[.getFiles, parameter[member[.inputPath], member[.parent]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[File] operator[>] identifier[getFiles] operator[SEP] identifier[String] identifier[inputPath] operator[SEP] { identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[inputPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[inputPath] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[File] operator[>] identifier[res] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[res] operator[SEP] identifier[add] operator[SEP] identifier[file] operator[SEP] operator[SEP] } Keyword[return] identifier[res] operator[SEP] } Keyword[else] { identifier[String] identifier[prefix] operator[=] identifier[inputPath] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[inputPath] operator[SEP] identifier[indexOf] operator[SEP] identifier[AlluxioURI] operator[SEP] identifier[WILDCARD] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[parent] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getFiles] operator[SEP] identifier[inputPath] , identifier[parent] operator[SEP] operator[SEP] } }
private Class<?> beanType(String name) { Class<?> type = context.getType(name); if (ClassUtils.isCglibProxyClass(type)) { return AopProxyUtils.ultimateTargetClass(context.getBean(name)); } return type; }
class class_name[name] begin[{] method[beanType, return_type[type[Class]], modifier[private], parameter[name]] begin[{] local_variable[type[Class], type] if[call[ClassUtils.isCglibProxyClass, parameter[member[.type]]]] begin[{] return[call[AopProxyUtils.ultimateTargetClass, parameter[call[context.getBean, parameter[member[.name]]]]]] else begin[{] None end[}] return[member[.type]] end[}] END[}]
Keyword[private] identifier[Class] operator[<] operator[?] operator[>] identifier[beanType] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[context] operator[SEP] identifier[getType] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ClassUtils] operator[SEP] identifier[isCglibProxyClass] operator[SEP] identifier[type] operator[SEP] operator[SEP] { Keyword[return] identifier[AopProxyUtils] operator[SEP] identifier[ultimateTargetClass] operator[SEP] identifier[context] operator[SEP] identifier[getBean] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[type] operator[SEP] }
public void addMilestone(@NonNull Milestone milestone) { boolean milestoneAdded = milestones.add(milestone); if (!milestoneAdded) { Timber.w("Milestone has already been added to the stack."); } }
class class_name[name] begin[{] method[addMilestone, return_type[void], modifier[public], parameter[milestone]] begin[{] local_variable[type[boolean], milestoneAdded] if[member[.milestoneAdded]] begin[{] call[Timber.w, parameter[literal["Milestone has already been added to the stack."]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addMilestone] operator[SEP] annotation[@] identifier[NonNull] identifier[Milestone] identifier[milestone] operator[SEP] { Keyword[boolean] identifier[milestoneAdded] operator[=] identifier[milestones] operator[SEP] identifier[add] operator[SEP] identifier[milestone] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[milestoneAdded] operator[SEP] { identifier[Timber] operator[SEP] identifier[w] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public BigDecimal adjust(BigDecimal n) { return NumberFormattingUtils.setup(n, options.roundMode(), formatMode, minIntDigits, maxFracDigits, minFracDigits, maxSigDigits, minSigDigits); }
class class_name[name] begin[{] method[adjust, return_type[type[BigDecimal]], modifier[public], parameter[n]] begin[{] return[call[NumberFormattingUtils.setup, parameter[member[.n], call[options.roundMode, parameter[]], member[.formatMode], member[.minIntDigits], member[.maxFracDigits], member[.minFracDigits], member[.maxSigDigits], member[.minSigDigits]]]] end[}] END[}]
Keyword[public] identifier[BigDecimal] identifier[adjust] operator[SEP] identifier[BigDecimal] identifier[n] operator[SEP] { Keyword[return] identifier[NumberFormattingUtils] operator[SEP] identifier[setup] operator[SEP] identifier[n] , identifier[options] operator[SEP] identifier[roundMode] operator[SEP] operator[SEP] , identifier[formatMode] , identifier[minIntDigits] , identifier[maxFracDigits] , identifier[minFracDigits] , identifier[maxSigDigits] , identifier[minSigDigits] operator[SEP] operator[SEP] }
public GenericDraweeHierarchyBuilder setProgressBarImage( int resourceId, @Nullable ScalingUtils.ScaleType progressBarImageScaleType) { mProgressBarImage = mResources.getDrawable(resourceId); mProgressBarImageScaleType = progressBarImageScaleType; return this; }
class class_name[name] begin[{] method[setProgressBarImage, return_type[type[GenericDraweeHierarchyBuilder]], modifier[public], parameter[resourceId, progressBarImageScaleType]] begin[{] assign[member[.mProgressBarImage], call[mResources.getDrawable, parameter[member[.resourceId]]]] assign[member[.mProgressBarImageScaleType], member[.progressBarImageScaleType]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[GenericDraweeHierarchyBuilder] identifier[setProgressBarImage] operator[SEP] Keyword[int] identifier[resourceId] , annotation[@] identifier[Nullable] identifier[ScalingUtils] operator[SEP] identifier[ScaleType] identifier[progressBarImageScaleType] operator[SEP] { identifier[mProgressBarImage] operator[=] identifier[mResources] operator[SEP] identifier[getDrawable] operator[SEP] identifier[resourceId] operator[SEP] operator[SEP] identifier[mProgressBarImageScaleType] operator[=] identifier[progressBarImageScaleType] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void removeCursorController(GVRCursorController controller) { controller.setEnable(false); controllers.remove(controller); controller.getGVRContext().getEventManager().sendEvent(this, ICursorControllerListener.class, "onCursorControllerRemoved", controller); }
class class_name[name] begin[{] method[removeCursorController, return_type[void], modifier[public], parameter[controller]] begin[{] call[controller.setEnable, parameter[literal[false]]] call[controllers.remove, parameter[member[.controller]]] call[controller.getGVRContext, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[removeCursorController] operator[SEP] identifier[GVRCursorController] identifier[controller] operator[SEP] { identifier[controller] operator[SEP] identifier[setEnable] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[controllers] operator[SEP] identifier[remove] operator[SEP] identifier[controller] operator[SEP] operator[SEP] identifier[controller] operator[SEP] identifier[getGVRContext] operator[SEP] operator[SEP] operator[SEP] identifier[getEventManager] operator[SEP] operator[SEP] operator[SEP] identifier[sendEvent] operator[SEP] Keyword[this] , identifier[ICursorControllerListener] operator[SEP] Keyword[class] , literal[String] , identifier[controller] operator[SEP] operator[SEP] }
private void checkOrInvokeValidStartMethod(final boolean invoke, final ClusterId clusterId) throws IllegalStateException { Method startMethod = null; for (final Method method : prototype.getClass().getDeclaredMethods()) { if (method.isAnnotationPresent(Start.class)) { if (startMethod != null) throw new IllegalStateException("Multiple methods on the message processor of type\"" + SafeString.valueOf(prototype) + "\" is identified as a Start method. Please annotate at most one method using @Start."); startMethod = method; } } // if the start method takes a ClusterId or ClusterDefinition then pass it. if (startMethod != null) { final Class<?>[] parameterTypes = startMethod.getParameterTypes(); boolean takesClusterId = false; if (parameterTypes != null && parameterTypes.length == 1) { if (ClusterId.class.isAssignableFrom(parameterTypes[0])) takesClusterId = true; else { throw new IllegalStateException("The method \"" + startMethod.getName() + "\" on " + SafeString.objectDescription(prototype) + " is annotated with the @" + Start.class.getSimpleName() + " annotation but doesn't have the correct signature. " + "It needs to either take no parameters or take a single " + ClusterId.class.getSimpleName() + " parameter."); } } else if (parameterTypes != null && parameterTypes.length > 1) { throw new IllegalStateException("The method \"" + startMethod.getName() + "\" on " + SafeString.objectDescription(prototype) + " is annotated with the @" + Start.class.getSimpleName() + " annotation but doesn't have the correct signature. " + "It needs to either take no parameters or take a single " + ClusterId.class.getSimpleName() + " parameter."); } if (invoke) { try { if (takesClusterId) startMethod.invoke(prototype, clusterId); else startMethod.invoke(prototype); } catch (final Exception e) { LOGGER.error(MarkerFactory.getMarker("FATAL"), "can't run MP initializer " + startMethod.getName(), e); } } } }
class class_name[name] begin[{] method[checkOrInvokeValidStartMethod, return_type[void], modifier[private], parameter[invoke, clusterId]] begin[{] local_variable[type[Method], startMethod] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Start, sub_type=None))], member=isAnnotationPresent, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=startMethod, 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=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Multiple methods on the message processor of type\""), operandr=MethodInvocation(arguments=[MemberReference(member=prototype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=SafeString, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" is identified as a Start method. Please annotate at most one method using @Start."), 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)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=startMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=prototype, selectors=[MethodInvocation(arguments=[], member=getDeclaredMethods, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=method)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))), label=None) if[binary_operation[member[.startMethod], !=, literal[null]]] begin[{] local_variable[type[Class], parameterTypes] local_variable[type[boolean], takesClusterId] if[binary_operation[binary_operation[member[.parameterTypes], !=, literal[null]], &&, binary_operation[member[parameterTypes.length], ==, literal[1]]]] begin[{] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=parameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ClusterId, sub_type=None))] begin[{] assign[member[.takesClusterId], literal[true]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[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="The method \""), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=startMethod, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" on "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=prototype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=objectDescription, postfix_operators=[], prefix_operators=[], qualifier=SafeString, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is annotated with the @"), operator=+), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Start, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" annotation but doesn't have the correct signature. "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="It needs to either take no parameters or take a single "), operator=+), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ClusterId, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" parameter."), 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) end[}] else begin[{] if[binary_operation[binary_operation[member[.parameterTypes], !=, literal[null]], &&, binary_operation[member[parameterTypes.length], >, literal[1]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[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="The method \""), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=startMethod, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" on "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=prototype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=objectDescription, postfix_operators=[], prefix_operators=[], qualifier=SafeString, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is annotated with the @"), operator=+), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Start, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" annotation but doesn't have the correct signature. "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="It needs to either take no parameters or take a single "), operator=+), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ClusterId, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" parameter."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] end[}] if[member[.invoke]] begin[{] TryStatement(block=[IfStatement(condition=MemberReference(member=takesClusterId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prototype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=startMethod, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prototype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=clusterId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=startMethod, selectors=[], type_arguments=None), label=None))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FATAL")], member=getMarker, postfix_operators=[], prefix_operators=[], qualifier=MarkerFactory, selectors=[], type_arguments=None), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="can't run MP initializer "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=startMethod, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, 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) else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkOrInvokeValidStartMethod] operator[SEP] Keyword[final] Keyword[boolean] identifier[invoke] , Keyword[final] identifier[ClusterId] identifier[clusterId] operator[SEP] Keyword[throws] identifier[IllegalStateException] { identifier[Method] identifier[startMethod] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Method] identifier[method] operator[:] identifier[prototype] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredMethods] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[method] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Start] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[startMethod] operator[!=] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[SafeString] operator[SEP] identifier[valueOf] operator[SEP] identifier[prototype] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[startMethod] operator[=] identifier[method] operator[SEP] } } Keyword[if] operator[SEP] identifier[startMethod] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[parameterTypes] operator[=] identifier[startMethod] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[takesClusterId] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[parameterTypes] operator[!=] Other[null] operator[&&] identifier[parameterTypes] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] { Keyword[if] operator[SEP] identifier[ClusterId] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[parameterTypes] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[takesClusterId] operator[=] literal[boolean] operator[SEP] Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[startMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[SafeString] operator[SEP] identifier[objectDescription] operator[SEP] identifier[prototype] operator[SEP] operator[+] literal[String] operator[+] identifier[Start] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[ClusterId] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[parameterTypes] operator[!=] Other[null] operator[&&] identifier[parameterTypes] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[startMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[SafeString] operator[SEP] identifier[objectDescription] operator[SEP] identifier[prototype] operator[SEP] operator[+] literal[String] operator[+] identifier[Start] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[ClusterId] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[invoke] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[takesClusterId] operator[SEP] identifier[startMethod] operator[SEP] identifier[invoke] operator[SEP] identifier[prototype] , identifier[clusterId] operator[SEP] operator[SEP] Keyword[else] identifier[startMethod] operator[SEP] identifier[invoke] operator[SEP] identifier[prototype] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] identifier[MarkerFactory] operator[SEP] identifier[getMarker] operator[SEP] literal[String] operator[SEP] , literal[String] operator[+] identifier[startMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } } }
protected String getDefaultJavaPackage() { return ProjectWizardParametersPage.getDefaultJavaPackage(groupIdCombo.getText().trim(), artifactIdCombo.getText().trim()); }
class class_name[name] begin[{] method[getDefaultJavaPackage, return_type[type[String]], modifier[protected], parameter[]] begin[{] return[call[ProjectWizardParametersPage.getDefaultJavaPackage, parameter[call[groupIdCombo.getText, parameter[]], call[artifactIdCombo.getText, parameter[]]]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getDefaultJavaPackage] operator[SEP] operator[SEP] { Keyword[return] identifier[ProjectWizardParametersPage] operator[SEP] identifier[getDefaultJavaPackage] operator[SEP] identifier[groupIdCombo] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , identifier[artifactIdCombo] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.TILE_POSITION__XOFFSET: return getXOFFSET(); case AfplibPackage.TILE_POSITION__YOFFSET: return getYOFFSET(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=TILE_POSITION__XOFFSET, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getXOFFSET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=TILE_POSITION__YOFFSET, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getYOFFSET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[TILE_POSITION__XOFFSET] operator[:] Keyword[return] identifier[getXOFFSET] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[TILE_POSITION__YOFFSET] operator[:] Keyword[return] identifier[getYOFFSET] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
public final void synpred33_DRL5Expressions_fragment() throws RecognitionException { // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:589:7: ( LEFT_SQUARE RIGHT_SQUARE ) // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:589:8: LEFT_SQUARE RIGHT_SQUARE { match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_synpred33_DRL5Expressions3234); if (state.failed) return; match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_synpred33_DRL5Expressions3236); if (state.failed) return; } }
class class_name[name] begin[{] method[synpred33_DRL5Expressions_fragment, return_type[void], modifier[final public], parameter[]] begin[{] call[.match, parameter[member[.input], member[.LEFT_SQUARE], member[.FOLLOW_LEFT_SQUARE_in_synpred33_DRL5Expressions3234]]] if[member[state.failed]] begin[{] return[None] else begin[{] None end[}] call[.match, parameter[member[.input], member[.RIGHT_SQUARE], member[.FOLLOW_RIGHT_SQUARE_in_synpred33_DRL5Expressions3236]]] if[member[state.failed]] begin[{] return[None] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[synpred33_DRL5Expressions_fragment] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { { identifier[match] operator[SEP] identifier[input] , identifier[LEFT_SQUARE] , identifier[FOLLOW_LEFT_SQUARE_in_synpred33_DRL5Expressions3234] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[RIGHT_SQUARE] , identifier[FOLLOW_RIGHT_SQUARE_in_synpred33_DRL5Expressions3236] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } }
public static int appendParentMap4text(String dept_fullpath,Map dataMap,Map paramObj){ String[] paths=dept_fullpath.split("/"); int size=paths.length; String dept_id=""; if(size>0){ dept_id=paths[size-1]; } String dept_path=""; int dept_id_size=dept_id.length(); dept_path=(String) dept_fullpath.subSequence(0, dept_fullpath.length()-dept_id_size); Map pMap=(Map) getParentObjByPath4text(dataMap,dept_path); List targetList=(List) pMap.get(dept_id); if(targetList==null){ targetList=new ArrayList(); pMap.put(dept_id, targetList); } targetList.add(paramObj); return 1; }
class class_name[name] begin[{] method[appendParentMap4text, return_type[type[int]], modifier[public static], parameter[dept_fullpath, dataMap, paramObj]] begin[{] local_variable[type[String], paths] local_variable[type[int], size] local_variable[type[String], dept_id] if[binary_operation[member[.size], >, literal[0]]] begin[{] assign[member[.dept_id], member[.paths]] else begin[{] None end[}] local_variable[type[String], dept_path] local_variable[type[int], dept_id_size] assign[member[.dept_path], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=dept_fullpath, selectors=[], type_arguments=None), operandr=MemberReference(member=dept_id_size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=subSequence, postfix_operators=[], prefix_operators=[], qualifier=dept_fullpath, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))] local_variable[type[Map], pMap] local_variable[type[List], targetList] if[binary_operation[member[.targetList], ==, literal[null]]] begin[{] assign[member[.targetList], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None))] call[pMap.put, parameter[member[.dept_id], member[.targetList]]] else begin[{] None end[}] call[targetList.add, parameter[member[.paramObj]]] return[literal[1]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[appendParentMap4text] operator[SEP] identifier[String] identifier[dept_fullpath] , identifier[Map] identifier[dataMap] , identifier[Map] identifier[paramObj] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[paths] operator[=] identifier[dept_fullpath] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[paths] operator[SEP] identifier[length] operator[SEP] identifier[String] identifier[dept_id] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[>] Other[0] operator[SEP] { identifier[dept_id] operator[=] identifier[paths] operator[SEP] identifier[size] operator[-] Other[1] operator[SEP] operator[SEP] } identifier[String] identifier[dept_path] operator[=] literal[String] operator[SEP] Keyword[int] identifier[dept_id_size] operator[=] identifier[dept_id] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[dept_path] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[dept_fullpath] operator[SEP] identifier[subSequence] operator[SEP] Other[0] , identifier[dept_fullpath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[dept_id_size] operator[SEP] operator[SEP] identifier[Map] identifier[pMap] operator[=] operator[SEP] identifier[Map] operator[SEP] identifier[getParentObjByPath4text] operator[SEP] identifier[dataMap] , identifier[dept_path] operator[SEP] operator[SEP] identifier[List] identifier[targetList] operator[=] operator[SEP] identifier[List] operator[SEP] identifier[pMap] operator[SEP] identifier[get] operator[SEP] identifier[dept_id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetList] operator[==] Other[null] operator[SEP] { identifier[targetList] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[pMap] operator[SEP] identifier[put] operator[SEP] identifier[dept_id] , identifier[targetList] operator[SEP] operator[SEP] } identifier[targetList] operator[SEP] identifier[add] operator[SEP] identifier[paramObj] operator[SEP] operator[SEP] Keyword[return] Other[1] operator[SEP] }
protected void expandDependency(IntDependency dependency, double count) { //if (Test.prunePunc && pruneTW(dependency.arg)) // return; if (dependency.head == null || dependency.arg == null) { return; } if (dependency.arg.word != STOP_WORD_INT) { expandArg(dependency, valenceBin(dependency.distance), count); } expandStop(dependency, distanceBin(dependency.distance), count, true); }
class class_name[name] begin[{] method[expandDependency, return_type[void], modifier[protected], parameter[dependency, count]] begin[{] if[binary_operation[binary_operation[member[dependency.head], ==, literal[null]], ||, binary_operation[member[dependency.arg], ==, literal[null]]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[member[dependency.arg.word], !=, member[.STOP_WORD_INT]]] begin[{] call[.expandArg, parameter[member[.dependency], call[.valenceBin, parameter[member[dependency.distance]]], member[.count]]] else begin[{] None end[}] call[.expandStop, parameter[member[.dependency], call[.distanceBin, parameter[member[dependency.distance]]], member[.count], literal[true]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[expandDependency] operator[SEP] identifier[IntDependency] identifier[dependency] , Keyword[double] identifier[count] operator[SEP] { Keyword[if] operator[SEP] identifier[dependency] operator[SEP] identifier[head] operator[==] Other[null] operator[||] identifier[dependency] operator[SEP] identifier[arg] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[dependency] operator[SEP] identifier[arg] operator[SEP] identifier[word] operator[!=] identifier[STOP_WORD_INT] operator[SEP] { identifier[expandArg] operator[SEP] identifier[dependency] , identifier[valenceBin] operator[SEP] identifier[dependency] operator[SEP] identifier[distance] operator[SEP] , identifier[count] operator[SEP] operator[SEP] } identifier[expandStop] operator[SEP] identifier[dependency] , identifier[distanceBin] operator[SEP] identifier[dependency] operator[SEP] identifier[distance] operator[SEP] , identifier[count] , literal[boolean] operator[SEP] operator[SEP] }
public void doProcess(String urlString, OutputStream out, InputStream xslInputStream, Map paramsMap, Map headers, String method, byte[] postData, String postContentType, String userName, String password) throws IOException, MalformedURLException { if (paramsMap == null) { paramsMap = new HashMap(); } String format = (String)paramsMap.get("format"); if (format == null) { format = "xml"; } InputStream in = null; BufferedOutputStream os = null; HttpClient httpclient = null; CookieCallback callback = new CookieCallback() { public Map<String, Cookie> getCookies() { return accessCookies(); } }; if (userName != null && password != null) { httpclient = new HttpClient(proxyHost, proxyPort, urlString, headers, method, userName, password, callback); } else { httpclient = new HttpClient(proxyHost, proxyPort, urlString, headers, method, callback, authHeader); } // post data determines whether we are going to do a get or a post if (postData == null) { in = httpclient.getInputStream(); } else { in = httpclient.doPost(postData, postContentType); } // Set-Cookie header if(httpclient.getSetCookieHeader()!=null) { String cookie = httpclient.getSetCookieHeader(); System.out.println("'Set-Cookie' header: "+ cookie); String[] values = cookie.split(";"); Cookie c = new Cookie(); for(String v : values) { String[] tuple = v.split("="); if("Path".equals( tuple[0].trim())) c.path = tuple[1]; else { c.name = tuple[0].trim(); c.value = tuple[1]; } } List<String> toBeRemoved = new ArrayList<String>(); Iterator it = cookies.keySet().iterator(); while(it.hasNext()) { Cookie exists = cookies.get(it.next()); if(exists.name.equals(c.name)) { String msg = exists.value.equals(c.value) ? "Replace with same value: "+exists.value : "Replace with different value: "+exists.value +"->"+c.value; System.out.println("Cookie '"+exists.name+"' exists: " + msg); // avoid doubles toBeRemoved.add(exists.name); } } // clean up for(String s : toBeRemoved) { cookies.remove(s); } cookies.put(c.name, c); } int responseCode = httpclient.getResponseCode(); if(responseCode != 200) { if(401== responseCode || 403==responseCode) { // authentication required throw new AuthenticationException(responseCode, httpclient.getHeader("WWW-Authenticate")); } else if(307==responseCode) { // redirect throw new RedirectException(httpclient.getHeader("Location")); } else if(503==responseCode) { // service unavailable throw new ServiceUnavailableException(httpclient.getHeader("Retry-After")); } else { // pipe the response directly into the servlet output stream //pipeResponsePayload(out, xslInputStream, paramsMap, in, httpclient); // and into the exception GenericException ex = new GenericException("Failed to open input stream, status: " + responseCode); /*try { BufferedInputStream bin = new BufferedInputStream(in); ByteArrayOutputStream bout = new ByteArrayOutputStream(); int next = bin.read(); while (next > -1) { bout.write(next); next = in.read(); } ex.setResponseBody(new String(bout.toByteArray())); } catch (IOException e) { e.printStackTrace(); // ignore } */ ex.setResponseText(httpclient.getResponseMessage()); throw ex; } } pipeResponsePayload(out, xslInputStream, paramsMap, in, httpclient); }
class class_name[name] begin[{] method[doProcess, return_type[void], modifier[public], parameter[urlString, out, xslInputStream, paramsMap, headers, method, postData, postContentType, userName, password]] begin[{] if[binary_operation[member[.paramsMap], ==, literal[null]]] begin[{] assign[member[.paramsMap], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashMap, sub_type=None))] else begin[{] None end[}] local_variable[type[String], format] if[binary_operation[member[.format], ==, literal[null]]] begin[{] assign[member[.format], literal["xml"]] else begin[{] None end[}] local_variable[type[InputStream], in] local_variable[type[BufferedOutputStream], os] local_variable[type[HttpClient], httpclient] local_variable[type[CookieCallback], callback] if[binary_operation[binary_operation[member[.userName], !=, literal[null]], &&, binary_operation[member[.password], !=, literal[null]]]] begin[{] assign[member[.httpclient], ClassCreator(arguments=[MemberReference(member=proxyHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=proxyPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=urlString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=password, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callback, 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=HttpClient, sub_type=None))] else begin[{] assign[member[.httpclient], ClassCreator(arguments=[MemberReference(member=proxyHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=proxyPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=urlString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=authHeader, 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=HttpClient, sub_type=None))] end[}] if[binary_operation[member[.postData], ==, literal[null]]] begin[{] assign[member[.in], call[httpclient.getInputStream, parameter[]]] else begin[{] assign[member[.in], call[httpclient.doPost, parameter[member[.postData], member[.postContentType]]]] end[}] if[binary_operation[call[httpclient.getSetCookieHeader, parameter[]], !=, literal[null]]] begin[{] local_variable[type[String], cookie] call[System.out.println, parameter[binary_operation[literal["'Set-Cookie' header: "], +, member[.cookie]]]] local_variable[type[String], values] local_variable[type[Cookie], c] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=split, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), name=tuple)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=tuple, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="Path"), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[]), type==, value=MemberReference(member=tuple, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[]), type==, value=MemberReference(member=tuple, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])), label=None)]), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[]), type==, value=MemberReference(member=tuple, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[List], toBeRemoved] local_variable[type[Iterator], it] while[call[it.hasNext, parameter[]]] begin[{] local_variable[type[Cookie], exists] if[call[exists.name.equals, parameter[member[c.name]]]] begin[{] local_variable[type[String], msg] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[literal["Cookie '"], +, member[exists.name]], +, literal["' exists: "]], +, member[.msg]]]] call[toBeRemoved.add, parameter[member[exists.name]]] else begin[{] None end[}] end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=cookies, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=toBeRemoved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[cookies.put, parameter[member[c.name], member[.c]]] else begin[{] None end[}] local_variable[type[int], responseCode] if[binary_operation[member[.responseCode], !=, literal[200]]] begin[{] if[binary_operation[binary_operation[literal[401], ==, member[.responseCode]], ||, binary_operation[literal[403], ==, member[.responseCode]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=responseCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="WWW-Authenticate")], member=getHeader, postfix_operators=[], prefix_operators=[], qualifier=httpclient, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuthenticationException, sub_type=None)), label=None) else begin[{] if[binary_operation[literal[307], ==, member[.responseCode]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Location")], member=getHeader, postfix_operators=[], prefix_operators=[], qualifier=httpclient, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RedirectException, sub_type=None)), label=None) else begin[{] if[binary_operation[literal[503], ==, member[.responseCode]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Retry-After")], member=getHeader, postfix_operators=[], prefix_operators=[], qualifier=httpclient, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceUnavailableException, sub_type=None)), label=None) else begin[{] local_variable[type[GenericException], ex] call[ex.setResponseText, parameter[call[httpclient.getResponseMessage, parameter[]]]] ThrowStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] end[}] end[}] else begin[{] None end[}] call[.pipeResponsePayload, parameter[member[.out], member[.xslInputStream], member[.paramsMap], member[.in], member[.httpclient]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[doProcess] operator[SEP] identifier[String] identifier[urlString] , identifier[OutputStream] identifier[out] , identifier[InputStream] identifier[xslInputStream] , identifier[Map] identifier[paramsMap] , identifier[Map] identifier[headers] , identifier[String] identifier[method] , Keyword[byte] operator[SEP] operator[SEP] identifier[postData] , identifier[String] identifier[postContentType] , identifier[String] identifier[userName] , identifier[String] identifier[password] operator[SEP] Keyword[throws] identifier[IOException] , identifier[MalformedURLException] { Keyword[if] operator[SEP] identifier[paramsMap] operator[==] Other[null] operator[SEP] { identifier[paramsMap] operator[=] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[format] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[paramsMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[format] operator[==] Other[null] operator[SEP] { identifier[format] operator[=] literal[String] operator[SEP] } identifier[InputStream] identifier[in] operator[=] Other[null] operator[SEP] identifier[BufferedOutputStream] identifier[os] operator[=] Other[null] operator[SEP] identifier[HttpClient] identifier[httpclient] operator[=] Other[null] operator[SEP] identifier[CookieCallback] identifier[callback] operator[=] Keyword[new] identifier[CookieCallback] operator[SEP] operator[SEP] { Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Cookie] operator[>] identifier[getCookies] operator[SEP] operator[SEP] { Keyword[return] identifier[accessCookies] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] Keyword[if] operator[SEP] identifier[userName] operator[!=] Other[null] operator[&&] identifier[password] operator[!=] Other[null] operator[SEP] { identifier[httpclient] operator[=] Keyword[new] identifier[HttpClient] operator[SEP] identifier[proxyHost] , identifier[proxyPort] , identifier[urlString] , identifier[headers] , identifier[method] , identifier[userName] , identifier[password] , identifier[callback] operator[SEP] operator[SEP] } Keyword[else] { identifier[httpclient] operator[=] Keyword[new] identifier[HttpClient] operator[SEP] identifier[proxyHost] , identifier[proxyPort] , identifier[urlString] , identifier[headers] , identifier[method] , identifier[callback] , identifier[authHeader] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[postData] operator[==] Other[null] operator[SEP] { identifier[in] operator[=] identifier[httpclient] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[in] operator[=] identifier[httpclient] operator[SEP] identifier[doPost] operator[SEP] identifier[postData] , identifier[postContentType] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[httpclient] operator[SEP] identifier[getSetCookieHeader] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[cookie] operator[=] identifier[httpclient] operator[SEP] identifier[getSetCookieHeader] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[cookie] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[cookie] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Cookie] identifier[c] operator[=] Keyword[new] identifier[Cookie] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[v] operator[:] identifier[values] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[tuple] operator[=] identifier[v] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[tuple] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[path] operator[=] identifier[tuple] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[else] { identifier[c] operator[SEP] identifier[name] operator[=] identifier[tuple] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[value] operator[=] identifier[tuple] operator[SEP] Other[1] operator[SEP] operator[SEP] } } identifier[List] operator[<] identifier[String] operator[>] identifier[toBeRemoved] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] identifier[it] operator[=] identifier[cookies] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Cookie] identifier[exists] operator[=] identifier[cookies] operator[SEP] identifier[get] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[exists] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[c] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[String] identifier[msg] operator[=] identifier[exists] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[c] operator[SEP] identifier[value] operator[SEP] operator[?] literal[String] operator[+] identifier[exists] operator[SEP] identifier[value] operator[:] literal[String] operator[+] identifier[exists] operator[SEP] identifier[value] operator[+] literal[String] operator[+] identifier[c] operator[SEP] identifier[value] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[exists] operator[SEP] identifier[name] operator[+] literal[String] operator[+] identifier[msg] operator[SEP] operator[SEP] identifier[toBeRemoved] operator[SEP] identifier[add] operator[SEP] identifier[exists] operator[SEP] identifier[name] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[toBeRemoved] operator[SEP] { identifier[cookies] operator[SEP] identifier[remove] operator[SEP] identifier[s] operator[SEP] operator[SEP] } identifier[cookies] operator[SEP] identifier[put] operator[SEP] identifier[c] operator[SEP] identifier[name] , identifier[c] operator[SEP] operator[SEP] } Keyword[int] identifier[responseCode] operator[=] identifier[httpclient] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[responseCode] operator[!=] Other[200] operator[SEP] { Keyword[if] operator[SEP] Other[401] operator[==] identifier[responseCode] operator[||] Other[403] operator[==] identifier[responseCode] operator[SEP] { Keyword[throw] Keyword[new] identifier[AuthenticationException] operator[SEP] identifier[responseCode] , identifier[httpclient] operator[SEP] identifier[getHeader] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] Other[307] operator[==] identifier[responseCode] operator[SEP] { Keyword[throw] Keyword[new] identifier[RedirectException] operator[SEP] identifier[httpclient] operator[SEP] identifier[getHeader] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] Other[503] operator[==] identifier[responseCode] operator[SEP] { Keyword[throw] Keyword[new] identifier[ServiceUnavailableException] operator[SEP] identifier[httpclient] operator[SEP] identifier[getHeader] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[GenericException] identifier[ex] operator[=] Keyword[new] identifier[GenericException] operator[SEP] literal[String] operator[+] identifier[responseCode] operator[SEP] operator[SEP] identifier[ex] operator[SEP] identifier[setResponseText] operator[SEP] identifier[httpclient] operator[SEP] identifier[getResponseMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[ex] operator[SEP] } } identifier[pipeResponsePayload] operator[SEP] identifier[out] , identifier[xslInputStream] , identifier[paramsMap] , identifier[in] , identifier[httpclient] operator[SEP] operator[SEP] }
@Override protected double[] probabilities( final Seq<Phenotype<G, C>> population, final int count ) { assert population != null : "Population must not be null. "; assert !population.isEmpty() : "Population is empty."; assert count > 0 : "Population to select must be greater than zero. "; final double N = population.size(); final double[] probabilities = new double[population.size()]; final double b = (_c - 1.0)/(pow(_c, N) - 1.0); for (int i = 0; i < probabilities.length; ++i) { probabilities[i] = pow(_c, i)*b; } return probabilities; }
class class_name[name] begin[{] method[probabilities, return_type[type[double]], modifier[protected], parameter[population, count]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=population, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Population must not be null. ")) AssertStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=population, selectors=[], type_arguments=None), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Population is empty.")) AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Population to select must be greater than zero. ")) local_variable[type[double], N] local_variable[type[double], probabilities] local_variable[type[double], b] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=probabilities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=_c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MemberReference(member=b, 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=length, postfix_operators=[], prefix_operators=[], qualifier=probabilities, 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[.probabilities]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[double] operator[SEP] operator[SEP] identifier[probabilities] operator[SEP] Keyword[final] identifier[Seq] operator[<] identifier[Phenotype] operator[<] identifier[G] , identifier[C] operator[>] operator[>] identifier[population] , Keyword[final] Keyword[int] identifier[count] operator[SEP] { Keyword[assert] identifier[population] operator[!=] Other[null] operator[:] literal[String] operator[SEP] Keyword[assert] operator[!] identifier[population] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[:] literal[String] operator[SEP] Keyword[assert] identifier[count] operator[>] Other[0] operator[:] literal[String] operator[SEP] Keyword[final] Keyword[double] identifier[N] operator[=] identifier[population] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[double] operator[SEP] operator[SEP] identifier[probabilities] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[population] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[b] operator[=] operator[SEP] identifier[_c] operator[-] literal[Float] operator[SEP] operator[/] operator[SEP] identifier[pow] operator[SEP] identifier[_c] , identifier[N] operator[SEP] operator[-] literal[Float] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[probabilities] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[probabilities] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[pow] operator[SEP] identifier[_c] , identifier[i] operator[SEP] operator[*] identifier[b] operator[SEP] } Keyword[return] identifier[probabilities] operator[SEP] }
public List<CmsResource> getLockedResourcesObjects(CmsDbContext dbc, CmsResource resource, CmsLockFilter filter) throws CmsException { return m_lockManager.getLockedResources(dbc, resource, filter); }
class class_name[name] begin[{] method[getLockedResourcesObjects, return_type[type[List]], modifier[public], parameter[dbc, resource, filter]] begin[{] return[call[m_lockManager.getLockedResources, parameter[member[.dbc], member[.resource], member[.filter]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[getLockedResourcesObjects] operator[SEP] identifier[CmsDbContext] identifier[dbc] , identifier[CmsResource] identifier[resource] , identifier[CmsLockFilter] identifier[filter] operator[SEP] Keyword[throws] identifier[CmsException] { Keyword[return] identifier[m_lockManager] operator[SEP] identifier[getLockedResources] operator[SEP] identifier[dbc] , identifier[resource] , identifier[filter] operator[SEP] operator[SEP] }
public List<Object> collectParamaters(Object base, Object[] params) throws Throwable { parameters.clear(); for (int i = 0; i < getLastParameterIndex(); i++) parameters.add(coerceToType(params[i], getParameterTypes()[i])); return parameters; }
class class_name[name] begin[{] method[collectParamaters, return_type[type[List]], modifier[public], parameter[base, params]] begin[{] call[parameters.clear, parameter[]] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None)], member=coerceToType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLastParameterIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.parameters]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Object] operator[>] identifier[collectParamaters] operator[SEP] identifier[Object] identifier[base] , identifier[Object] operator[SEP] operator[SEP] identifier[params] operator[SEP] Keyword[throws] identifier[Throwable] { identifier[parameters] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[getLastParameterIndex] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[parameters] operator[SEP] identifier[add] operator[SEP] identifier[coerceToType] operator[SEP] identifier[params] operator[SEP] identifier[i] operator[SEP] , identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[parameters] operator[SEP] }
public ServiceFuture<SummarizeResultsInner> summarizeForSubscriptionLevelPolicyAssignmentAsync(String subscriptionId, String policyAssignmentName, QueryOptions queryOptions, final ServiceCallback<SummarizeResultsInner> serviceCallback) { return ServiceFuture.fromResponse(summarizeForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync(subscriptionId, policyAssignmentName, queryOptions), serviceCallback); }
class class_name[name] begin[{] method[summarizeForSubscriptionLevelPolicyAssignmentAsync, return_type[type[ServiceFuture]], modifier[public], parameter[subscriptionId, policyAssignmentName, queryOptions, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.summarizeForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync, parameter[member[.subscriptionId], member[.policyAssignmentName], member[.queryOptions]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[SummarizeResultsInner] operator[>] identifier[summarizeForSubscriptionLevelPolicyAssignmentAsync] operator[SEP] identifier[String] identifier[subscriptionId] , identifier[String] identifier[policyAssignmentName] , identifier[QueryOptions] identifier[queryOptions] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[SummarizeResultsInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[summarizeForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync] operator[SEP] identifier[subscriptionId] , identifier[policyAssignmentName] , identifier[queryOptions] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
private double calculateOverlapIncrease(N node, SpatialEntry ei, SpatialComparable testMBR) { ModifiableHyperBoundingBox eiMBR = new ModifiableHyperBoundingBox(ei); ModifiableHyperBoundingBox testMBRModifiable = new ModifiableHyperBoundingBox(testMBR); double[] lb = eiMBR.getMinRef(); double[] ub = eiMBR.getMaxRef(); double[] lbT = testMBRModifiable.getMinRef(); double[] ubT = testMBRModifiable.getMaxRef(); double[] lbNext = null; // next tested lower bounds double[] ubNext = null; // and upper bounds boolean[] dimensionChanged = new boolean[lb.length]; for(int i = 0; i < dimensionChanged.length; i++) { if(lb[i] > lbT[i] || ub[i] < ubT[i]) { dimensionChanged[i] = true; } } double multiOverlapInc = 0, multiOverlapMult = 1, mOOld = 1, mONew = 1; double ol, olT; // dimensional overlap for(int j = 0; j < node.getNumEntries(); j++) { SpatialEntry ej = node.getEntry(j); if(getPageID(ej) != getPageID(ei)) { multiOverlapMult = 1; // is constant for a unchanged dimension mOOld = 1; // overlap for old MBR on changed dimensions mONew = 1; // overlap on new MBR on changed dimension ModifiableHyperBoundingBox ejMBR = new ModifiableHyperBoundingBox(ej); lbNext = ejMBR.getMinRef(); ubNext = ejMBR.getMaxRef(); for(int i = 0; i < dimensionChanged.length; i++) { if(dimensionChanged[i]) { if(lbT[i] > ubNext[i] || ubT[i] < lbNext[i]) { multiOverlapMult = 0; break; // old MBR has no overlap either } olT = (ubT[i] > ubNext[i] ? ubNext[i] : ubT[i]) - (lbT[i] < lbNext[i] ? lbNext[i] : lbT[i]); mONew *= olT; if(mOOld != 0) { // else: no use in calculating overlap ol = (ub[i] > ubNext[i] ? ubNext[i] : ub[i]) - (lb[i] < lbNext[i] ? lbNext[i] : lb[i]); if(ol < 0) { ol = 0; } mOOld *= ol; } } else { if(lb[i] > ubNext[i] || ub[i] < lbNext[i]) { multiOverlapMult = 0; break; } ol = (ub[i] > ubNext[i] ? ubNext[i] : ub[i]) - (lb[i] < lbNext[i] ? lbNext[i] : lb[i]); multiOverlapMult *= ol; } } if(multiOverlapMult != 0) { multiOverlapInc += multiOverlapMult * (mONew - mOOld); } } } return multiOverlapInc; }
class class_name[name] begin[{] method[calculateOverlapIncrease, return_type[type[double]], modifier[private], parameter[node, ei, testMBR]] begin[{] local_variable[type[ModifiableHyperBoundingBox], eiMBR] local_variable[type[ModifiableHyperBoundingBox], testMBRModifiable] local_variable[type[double], lb] local_variable[type[double], ub] local_variable[type[double], lbT] local_variable[type[double], ubT] local_variable[type[double], lbNext] local_variable[type[double], ubNext] local_variable[type[boolean], dimensionChanged] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=lbT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=ub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=ubT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=<), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dimensionChanged, 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=true)), 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=dimensionChanged, 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[double], multiOverlapInc] local_variable[type[double], ol] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEntry, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), name=ej)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SpatialEntry, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ej, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPageID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=ei, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPageID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=multiOverlapMult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mOOld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mONew, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=ej, 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=ModifiableHyperBoundingBox, sub_type=None)), name=ejMBR)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModifiableHyperBoundingBox, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lbNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getMinRef, postfix_operators=[], prefix_operators=[], qualifier=ejMBR, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ubNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getMaxRef, postfix_operators=[], prefix_operators=[], qualifier=ejMBR, selectors=[], type_arguments=None)), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=dimensionChanged, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=ubNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=ub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=lbNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=<), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=multiOverlapMult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=ub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=ubNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=>), if_false=MemberReference(member=ub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=MemberReference(member=ubNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=lb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=lbNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=<), if_false=MemberReference(member=lb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=MemberReference(member=lbNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), operator=-)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=multiOverlapMult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=MemberReference(member=ol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lbT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=ubNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=ubT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=lbNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=<), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=multiOverlapMult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=olT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=ubT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=ubNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=>), if_false=MemberReference(member=ubT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=MemberReference(member=ubNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=lbT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=lbNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=<), if_false=MemberReference(member=lbT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=MemberReference(member=lbNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), operator=-)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mONew, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=MemberReference(member=olT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mOOld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=ub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=ubNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=>), if_false=MemberReference(member=ub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=MemberReference(member=ubNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=lb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=lbNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=<), if_false=MemberReference(member=lb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=MemberReference(member=lbNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), operator=-)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mOOld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=MemberReference(member=ol, 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=dimensionChanged, 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), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=multiOverlapMult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=multiOverlapInc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=multiOverlapMult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=mONew, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mOOld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=*)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumEntries, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), 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) return[member[.multiOverlapInc]] end[}] END[}]
Keyword[private] Keyword[double] identifier[calculateOverlapIncrease] operator[SEP] identifier[N] identifier[node] , identifier[SpatialEntry] identifier[ei] , identifier[SpatialComparable] identifier[testMBR] operator[SEP] { identifier[ModifiableHyperBoundingBox] identifier[eiMBR] operator[=] Keyword[new] identifier[ModifiableHyperBoundingBox] operator[SEP] identifier[ei] operator[SEP] operator[SEP] identifier[ModifiableHyperBoundingBox] identifier[testMBRModifiable] operator[=] Keyword[new] identifier[ModifiableHyperBoundingBox] operator[SEP] identifier[testMBR] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[lb] operator[=] identifier[eiMBR] operator[SEP] identifier[getMinRef] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[ub] operator[=] identifier[eiMBR] operator[SEP] identifier[getMaxRef] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[lbT] operator[=] identifier[testMBRModifiable] operator[SEP] identifier[getMinRef] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[ubT] operator[=] identifier[testMBRModifiable] operator[SEP] identifier[getMaxRef] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[lbNext] operator[=] Other[null] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[ubNext] operator[=] Other[null] operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] identifier[dimensionChanged] operator[=] Keyword[new] Keyword[boolean] operator[SEP] identifier[lb] 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[dimensionChanged] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[lb] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[lbT] operator[SEP] identifier[i] operator[SEP] operator[||] identifier[ub] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[ubT] operator[SEP] identifier[i] operator[SEP] operator[SEP] { identifier[dimensionChanged] operator[SEP] identifier[i] operator[SEP] operator[=] literal[boolean] operator[SEP] } } Keyword[double] identifier[multiOverlapInc] operator[=] Other[0] , identifier[multiOverlapMult] operator[=] Other[1] , identifier[mOOld] operator[=] Other[1] , identifier[mONew] operator[=] Other[1] operator[SEP] Keyword[double] identifier[ol] , identifier[olT] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[node] operator[SEP] identifier[getNumEntries] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[SpatialEntry] identifier[ej] operator[=] identifier[node] operator[SEP] identifier[getEntry] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getPageID] operator[SEP] identifier[ej] operator[SEP] operator[!=] identifier[getPageID] operator[SEP] identifier[ei] operator[SEP] operator[SEP] { identifier[multiOverlapMult] operator[=] Other[1] operator[SEP] identifier[mOOld] operator[=] Other[1] operator[SEP] identifier[mONew] operator[=] Other[1] operator[SEP] identifier[ModifiableHyperBoundingBox] identifier[ejMBR] operator[=] Keyword[new] identifier[ModifiableHyperBoundingBox] operator[SEP] identifier[ej] operator[SEP] operator[SEP] identifier[lbNext] operator[=] identifier[ejMBR] operator[SEP] identifier[getMinRef] operator[SEP] operator[SEP] operator[SEP] identifier[ubNext] operator[=] identifier[ejMBR] operator[SEP] identifier[getMaxRef] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dimensionChanged] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[dimensionChanged] operator[SEP] identifier[i] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[lbT] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[ubNext] operator[SEP] identifier[i] operator[SEP] operator[||] identifier[ubT] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[lbNext] operator[SEP] identifier[i] operator[SEP] operator[SEP] { identifier[multiOverlapMult] operator[=] Other[0] operator[SEP] Keyword[break] operator[SEP] } identifier[olT] operator[=] operator[SEP] identifier[ubT] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[ubNext] operator[SEP] identifier[i] operator[SEP] operator[?] identifier[ubNext] operator[SEP] identifier[i] operator[SEP] operator[:] identifier[ubT] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[-] operator[SEP] identifier[lbT] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[lbNext] operator[SEP] identifier[i] operator[SEP] operator[?] identifier[lbNext] operator[SEP] identifier[i] operator[SEP] operator[:] identifier[lbT] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[mONew] operator[*=] identifier[olT] operator[SEP] Keyword[if] operator[SEP] identifier[mOOld] operator[!=] Other[0] operator[SEP] { identifier[ol] operator[=] operator[SEP] identifier[ub] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[ubNext] operator[SEP] identifier[i] operator[SEP] operator[?] identifier[ubNext] operator[SEP] identifier[i] operator[SEP] operator[:] identifier[ub] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[-] operator[SEP] identifier[lb] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[lbNext] operator[SEP] identifier[i] operator[SEP] operator[?] identifier[lbNext] operator[SEP] identifier[i] operator[SEP] operator[:] identifier[lb] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ol] operator[<] Other[0] operator[SEP] { identifier[ol] operator[=] Other[0] operator[SEP] } identifier[mOOld] operator[*=] identifier[ol] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[lb] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[ubNext] operator[SEP] identifier[i] operator[SEP] operator[||] identifier[ub] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[lbNext] operator[SEP] identifier[i] operator[SEP] operator[SEP] { identifier[multiOverlapMult] operator[=] Other[0] operator[SEP] Keyword[break] operator[SEP] } identifier[ol] operator[=] operator[SEP] identifier[ub] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[ubNext] operator[SEP] identifier[i] operator[SEP] operator[?] identifier[ubNext] operator[SEP] identifier[i] operator[SEP] operator[:] identifier[ub] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[-] operator[SEP] identifier[lb] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[lbNext] operator[SEP] identifier[i] operator[SEP] operator[?] identifier[lbNext] operator[SEP] identifier[i] operator[SEP] operator[:] identifier[lb] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[multiOverlapMult] operator[*=] identifier[ol] operator[SEP] } } Keyword[if] operator[SEP] identifier[multiOverlapMult] operator[!=] Other[0] operator[SEP] { identifier[multiOverlapInc] operator[+=] identifier[multiOverlapMult] operator[*] operator[SEP] identifier[mONew] operator[-] identifier[mOOld] operator[SEP] operator[SEP] } } } Keyword[return] identifier[multiOverlapInc] operator[SEP] }
public String encode(String... values) { ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); int i = 0; for (String value : values) { builder.put("$" + i++, value); } // We will get an error if there are named bindings which are not reached by values. return instantiate(builder.build()); }
class class_name[name] begin[{] method[encode, return_type[type[String]], modifier[public], parameter[values]] begin[{] local_variable[type[ImmutableMap], builder] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="$"), operandr=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[.instantiate, parameter[call[builder.build, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[encode] operator[SEP] identifier[String] operator[...] identifier[values] operator[SEP] { identifier[ImmutableMap] operator[SEP] identifier[Builder] operator[<] identifier[String] , identifier[String] operator[>] identifier[builder] operator[=] identifier[ImmutableMap] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[value] operator[:] identifier[values] operator[SEP] { identifier[builder] operator[SEP] identifier[put] operator[SEP] literal[String] operator[+] identifier[i] operator[++] , identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[instantiate] operator[SEP] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static void postDelayed(Object what, long delay) { Handle.getInstance().mHandler.postDelayed(what, delay); }
class class_name[name] begin[{] method[postDelayed, return_type[void], modifier[public static], parameter[what, delay]] begin[{] call[Handle.getInstance, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[postDelayed] operator[SEP] identifier[Object] identifier[what] , Keyword[long] identifier[delay] operator[SEP] { identifier[Handle] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[mHandler] operator[SEP] identifier[postDelayed] operator[SEP] identifier[what] , identifier[delay] operator[SEP] operator[SEP] }
public static Configuration loadConfig(Path configFile, boolean compressSpaces) { if (Files.notExists(configFile)) { return Configuration.newConfig(OneOrOther.<File, Path>ofOther(configFile)); } Configuration config = new Configuration(OneOrOther.<File, Path>ofOther(configFile), compressSpaces); try (BufferedReader reader = Files.newBufferedReader(configFile, Charset.defaultCharset())) { loadConfig(config, reader, compressSpaces); } catch (IOException e) { e.printStackTrace(); } return config; }
class class_name[name] begin[{] method[loadConfig, return_type[type[Configuration]], modifier[public static], parameter[configFile, compressSpaces]] begin[{] if[call[Files.notExists, parameter[member[.configFile]]]] begin[{] return[call[Configuration.newConfig, parameter[call[.OneOrOther, parameter[member[.configFile]]]]]] else begin[{] None end[}] local_variable[type[Configuration], config] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=compressSpaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=reader, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=configFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=defaultCharset, postfix_operators=[], prefix_operators=[], qualifier=Charset, selectors=[], type_arguments=None)], member=newBufferedReader, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None))]) return[member[.config]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Configuration] identifier[loadConfig] operator[SEP] identifier[Path] identifier[configFile] , Keyword[boolean] identifier[compressSpaces] operator[SEP] { Keyword[if] operator[SEP] identifier[Files] operator[SEP] identifier[notExists] operator[SEP] identifier[configFile] operator[SEP] operator[SEP] { Keyword[return] identifier[Configuration] operator[SEP] identifier[newConfig] operator[SEP] identifier[OneOrOther] operator[SEP] operator[<] identifier[File] , identifier[Path] operator[>] identifier[ofOther] operator[SEP] identifier[configFile] operator[SEP] operator[SEP] operator[SEP] } identifier[Configuration] identifier[config] operator[=] Keyword[new] identifier[Configuration] operator[SEP] identifier[OneOrOther] operator[SEP] operator[<] identifier[File] , identifier[Path] operator[>] identifier[ofOther] operator[SEP] identifier[configFile] operator[SEP] , identifier[compressSpaces] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[BufferedReader] identifier[reader] operator[=] identifier[Files] operator[SEP] identifier[newBufferedReader] operator[SEP] identifier[configFile] , identifier[Charset] operator[SEP] identifier[defaultCharset] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[loadConfig] operator[SEP] identifier[config] , identifier[reader] , identifier[compressSpaces] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[config] operator[SEP] }
public long getNextCluster(long cluster) { testCluster(cluster); long entry = entries[(int) cluster]; if (isEofCluster(entry)) { return -1; } else { return entry; } }
class class_name[name] begin[{] method[getNextCluster, return_type[type[long]], modifier[public], parameter[cluster]] begin[{] call[.testCluster, parameter[member[.cluster]]] local_variable[type[long], entry] if[call[.isEofCluster, parameter[member[.entry]]]] begin[{] return[literal[1]] else begin[{] return[member[.entry]] end[}] end[}] END[}]
Keyword[public] Keyword[long] identifier[getNextCluster] operator[SEP] Keyword[long] identifier[cluster] operator[SEP] { identifier[testCluster] operator[SEP] identifier[cluster] operator[SEP] operator[SEP] Keyword[long] identifier[entry] operator[=] identifier[entries] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[cluster] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isEofCluster] operator[SEP] identifier[entry] operator[SEP] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } Keyword[else] { Keyword[return] identifier[entry] operator[SEP] } }
@Override public int[][] fused() { List<int[]> fused = new ArrayList<int[]>(cycles.size()); for (int i = 0; i < cycles.size(); i++) { if (this.fused.get(i)) fused.add(toArray(cycles.get(i))); } return fused.toArray(new int[fused.size()][]); }
class class_name[name] begin[{] method[fused, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[List], fused] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=fused, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cycles, selectors=[], type_arguments=None)], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=fused, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=cycles, 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[fused.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=fused, selectors=[], type_arguments=None), None], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fused] operator[SEP] operator[SEP] { identifier[List] operator[<] Keyword[int] operator[SEP] operator[SEP] operator[>] identifier[fused] operator[=] Keyword[new] identifier[ArrayList] operator[<] Keyword[int] operator[SEP] operator[SEP] operator[>] operator[SEP] identifier[cycles] 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[cycles] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[fused] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[fused] operator[SEP] identifier[add] operator[SEP] identifier[toArray] operator[SEP] identifier[cycles] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[fused] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] Keyword[int] operator[SEP] identifier[fused] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public synchronized static ExecutorService getExecutorService() { if (executorService == null) { executorService = Executors.newCachedThreadPool(); ((ThreadPoolExecutor) executorService).setMaximumPoolSize(executorPoolSize); } return executorService; }
class class_name[name] begin[{] method[getExecutorService, return_type[type[ExecutorService]], modifier[synchronized public static], parameter[]] begin[{] if[binary_operation[member[.executorService], ==, literal[null]]] begin[{] assign[member[.executorService], call[Executors.newCachedThreadPool, parameter[]]] Cast(expression=MemberReference(member=executorService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ThreadPoolExecutor, sub_type=None)) else begin[{] None end[}] return[member[.executorService]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[static] identifier[ExecutorService] identifier[getExecutorService] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[executorService] operator[==] Other[null] operator[SEP] { identifier[executorService] operator[=] identifier[Executors] operator[SEP] identifier[newCachedThreadPool] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ThreadPoolExecutor] operator[SEP] identifier[executorService] operator[SEP] operator[SEP] identifier[setMaximumPoolSize] operator[SEP] identifier[executorPoolSize] operator[SEP] operator[SEP] } Keyword[return] identifier[executorService] operator[SEP] }
@CanIgnoreReturnValue public long updateAndGet(K key, LongUnaryOperator updaterFunction) { checkNotNull(updaterFunction); return map.compute( key, (k, value) -> updaterFunction.applyAsLong((value == null) ? 0L : value.longValue())); }
class class_name[name] begin[{] method[updateAndGet, return_type[type[long]], modifier[public], parameter[key, updaterFunction]] begin[{] call[.checkNotNull, parameter[member[.updaterFunction]]] return[call[map.compute, parameter[member[.key], LambdaExpression(body=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=longValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L))], member=applyAsLong, postfix_operators=[], prefix_operators=[], qualifier=updaterFunction, selectors=[], type_arguments=None), parameters=[InferredFormalParameter(name=k), InferredFormalParameter(name=value)])]]] end[}] END[}]
annotation[@] identifier[CanIgnoreReturnValue] Keyword[public] Keyword[long] identifier[updateAndGet] operator[SEP] identifier[K] identifier[key] , identifier[LongUnaryOperator] identifier[updaterFunction] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[updaterFunction] operator[SEP] operator[SEP] Keyword[return] identifier[map] operator[SEP] identifier[compute] operator[SEP] identifier[key] , operator[SEP] identifier[k] , identifier[value] operator[SEP] operator[->] identifier[updaterFunction] operator[SEP] identifier[applyAsLong] operator[SEP] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] operator[?] Other[0L] operator[:] identifier[value] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "groupName", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "name") public JAXBElement<CodeType> createGroupName(CodeType value) { return new JAXBElement<CodeType>(_GroupName_QNAME, CodeType.class, null, value); }
class class_name[name] begin[{] method[createGroupName, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_GroupName_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CodeType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CodeType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[substitutionHeadNamespace] operator[=] literal[String] , identifier[substitutionHeadName] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[CodeType] operator[>] identifier[createGroupName] operator[SEP] identifier[CodeType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[CodeType] operator[>] operator[SEP] identifier[_GroupName_QNAME] , identifier[CodeType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public EList<Annotation> getAnnotations() { if (annotations == null) { annotations = new EObjectContainmentEList<Annotation>(Annotation.class, this, XtextPackage.ABSTRACT_RULE__ANNOTATIONS); } return annotations; }
class class_name[name] begin[{] method[getAnnotations, return_type[type[EList]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.annotations], ==, literal[null]]] begin[{] assign[member[.annotations], ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Annotation, sub_type=None)), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=ABSTRACT_RULE__ANNOTATIONS, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))], dimensions=None, name=EObjectContainmentEList, sub_type=None))] else begin[{] None end[}] return[member[.annotations]] end[}] END[}]
Keyword[public] identifier[EList] operator[<] identifier[Annotation] operator[>] identifier[getAnnotations] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[annotations] operator[==] Other[null] operator[SEP] { identifier[annotations] operator[=] Keyword[new] identifier[EObjectContainmentEList] operator[<] identifier[Annotation] operator[>] operator[SEP] identifier[Annotation] operator[SEP] Keyword[class] , Keyword[this] , identifier[XtextPackage] operator[SEP] identifier[ABSTRACT_RULE__ANNOTATIONS] operator[SEP] operator[SEP] } Keyword[return] identifier[annotations] operator[SEP] }
public static boolean check() { Class<?> objectType; Class<?> type; Class<?> constants; Class<?> emptyVis; Class<?> repository; try { objectType = Class.forName(ORG_APACHE_BCEL_GENERIC_OBJECT_TYPE); type = Class.forName(ORG_APACHE_BCEL_GENERIC_TYPE); constants = Class.forName(ORG_APACHE_BCEL_CONSTANTS); emptyVis = Class.forName(ORG_APACHE_BCEL_CLASSFILE_EMPTY_VISITOR); repository = Class.forName(ORG_APACHE_BCEL_REPOSITORY); } catch (ClassNotFoundException e) { LOG.error("One or more required BCEL classes were missing." + " Ensure that bcel.jar is placed at the same directory with spotbugs.jar"); return false; } if (isFinal(objectType)) { error(ORG_APACHE_BCEL_GENERIC_OBJECT_TYPE); return false; } if (isFinal(type)) { error(ORG_APACHE_BCEL_GENERIC_TYPE); return false; } if (isFinal(constants)) { error(ORG_APACHE_BCEL_CONSTANTS); return false; } if (isFinal(emptyVis)) { error(ORG_APACHE_BCEL_CLASSFILE_EMPTY_VISITOR); return false; } if (isFinal(repository)) { error(ORG_APACHE_BCEL_REPOSITORY); return false; } return true; }
class class_name[name] begin[{] method[check, return_type[type[boolean]], modifier[public static], parameter[]] begin[{] local_variable[type[Class], objectType] local_variable[type[Class], type] local_variable[type[Class], constants] local_variable[type[Class], emptyVis] local_variable[type[Class], repository] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=objectType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ORG_APACHE_BCEL_GENERIC_OBJECT_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ORG_APACHE_BCEL_GENERIC_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=constants, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ORG_APACHE_BCEL_CONSTANTS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=emptyVis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ORG_APACHE_BCEL_CLASSFILE_EMPTY_VISITOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=repository, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ORG_APACHE_BCEL_REPOSITORY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="One or more required BCEL classes were missing."), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Ensure that bcel.jar is placed at the same directory with spotbugs.jar"), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) if[call[.isFinal, parameter[member[.objectType]]]] begin[{] call[.error, parameter[member[.ORG_APACHE_BCEL_GENERIC_OBJECT_TYPE]]] return[literal[false]] else begin[{] None end[}] if[call[.isFinal, parameter[member[.type]]]] begin[{] call[.error, parameter[member[.ORG_APACHE_BCEL_GENERIC_TYPE]]] return[literal[false]] else begin[{] None end[}] if[call[.isFinal, parameter[member[.constants]]]] begin[{] call[.error, parameter[member[.ORG_APACHE_BCEL_CONSTANTS]]] return[literal[false]] else begin[{] None end[}] if[call[.isFinal, parameter[member[.emptyVis]]]] begin[{] call[.error, parameter[member[.ORG_APACHE_BCEL_CLASSFILE_EMPTY_VISITOR]]] return[literal[false]] else begin[{] None end[}] if[call[.isFinal, parameter[member[.repository]]]] begin[{] call[.error, parameter[member[.ORG_APACHE_BCEL_REPOSITORY]]] return[literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[check] operator[SEP] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[objectType] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[constants] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[emptyVis] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[repository] operator[SEP] Keyword[try] { identifier[objectType] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[ORG_APACHE_BCEL_GENERIC_OBJECT_TYPE] operator[SEP] operator[SEP] identifier[type] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[ORG_APACHE_BCEL_GENERIC_TYPE] operator[SEP] operator[SEP] identifier[constants] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[ORG_APACHE_BCEL_CONSTANTS] operator[SEP] operator[SEP] identifier[emptyVis] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[ORG_APACHE_BCEL_CLASSFILE_EMPTY_VISITOR] operator[SEP] operator[SEP] identifier[repository] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[ORG_APACHE_BCEL_REPOSITORY] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[isFinal] operator[SEP] identifier[objectType] operator[SEP] operator[SEP] { identifier[error] operator[SEP] identifier[ORG_APACHE_BCEL_GENERIC_OBJECT_TYPE] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[isFinal] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[error] operator[SEP] identifier[ORG_APACHE_BCEL_GENERIC_TYPE] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[isFinal] operator[SEP] identifier[constants] operator[SEP] operator[SEP] { identifier[error] operator[SEP] identifier[ORG_APACHE_BCEL_CONSTANTS] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[isFinal] operator[SEP] identifier[emptyVis] operator[SEP] operator[SEP] { identifier[error] operator[SEP] identifier[ORG_APACHE_BCEL_CLASSFILE_EMPTY_VISITOR] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[isFinal] operator[SEP] identifier[repository] operator[SEP] operator[SEP] { identifier[error] operator[SEP] identifier[ORG_APACHE_BCEL_REPOSITORY] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@Override protected synchronized CollectionContext beginCollection(DateTime now) { data_.startNewCycle(now, getDecoratorLookBack()); return new CollectionContext() { final Map<GroupName, Alert> alerts = new HashMap<>(); @Override public Consumer<Alert> alertManager() { return (Alert alert) -> { Alert combined = combine_alert_with_past_(alert, alerts_); alerts.put(combined.getName(), combined); }; } @Override public MutableTimeSeriesCollectionPair tsdata() { return data_; } /** * Store a newly completed collection cycle. */ @Override public void commit() { alerts_ = unmodifiableMap(alerts); try { getHistory().ifPresent(history -> history.add(getCollectionData())); } catch (Exception ex) { logger.log(Level.WARNING, "unable to add collection data to history (dropped)", ex); } } }; }
class class_name[name] begin[{] method[beginCollection, return_type[type[CollectionContext]], modifier[synchronized protected], parameter[now]] begin[{] call[data_.startNewCycle, parameter[member[.now], call[.getDecoratorLookBack, parameter[]]]] return[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), name=alerts)], documentation=None, modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=GroupName, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Alert, sub_type=None))], dimensions=[], name=Map, sub_type=None)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=alert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alerts_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=combine_alert_with_past_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=combined)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Alert, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=combined, selectors=[], type_arguments=None), MemberReference(member=combined, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=alerts, selectors=[], type_arguments=None), label=None)], parameters=[FormalParameter(annotations=[], modifiers=set(), name=alert, type=ReferenceType(arguments=None, dimensions=[], name=Alert, sub_type=None), varargs=False)]), label=None)], documentation=None, modifiers={'public'}, name=alertManager, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Alert, sub_type=None))], dimensions=[], name=Consumer, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=data_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=tsdata, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=MutableTimeSeriesCollectionPair, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alerts_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=alerts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmodifiableMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getHistory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCollectionData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=history, selectors=[], type_arguments=None), parameters=[MemberReference(member=history, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=ifPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unable to add collection data to history (dropped)"), MemberReference(member=ex, 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=ex, types=['Exception']))], finally_block=None, label=None, resources=None)], documentation=/** * Store a newly completed collection cycle. */, modifiers={'public'}, name=commit, 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=CollectionContext, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[synchronized] identifier[CollectionContext] identifier[beginCollection] operator[SEP] identifier[DateTime] identifier[now] operator[SEP] { identifier[data_] operator[SEP] identifier[startNewCycle] operator[SEP] identifier[now] , identifier[getDecoratorLookBack] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CollectionContext] operator[SEP] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[GroupName] , identifier[Alert] operator[>] identifier[alerts] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[Consumer] operator[<] identifier[Alert] operator[>] identifier[alertManager] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[Alert] identifier[alert] operator[SEP] operator[->] { identifier[Alert] identifier[combined] operator[=] identifier[combine_alert_with_past_] operator[SEP] identifier[alert] , identifier[alerts_] operator[SEP] operator[SEP] identifier[alerts] operator[SEP] identifier[put] operator[SEP] identifier[combined] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[combined] operator[SEP] operator[SEP] } operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[MutableTimeSeriesCollectionPair] identifier[tsdata] operator[SEP] operator[SEP] { Keyword[return] identifier[data_] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[commit] operator[SEP] operator[SEP] { identifier[alerts_] operator[=] identifier[unmodifiableMap] operator[SEP] identifier[alerts] operator[SEP] operator[SEP] Keyword[try] { identifier[getHistory] operator[SEP] operator[SEP] operator[SEP] identifier[ifPresent] operator[SEP] identifier[history] operator[->] identifier[history] operator[SEP] identifier[add] operator[SEP] identifier[getCollectionData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] , identifier[ex] operator[SEP] operator[SEP] } } } operator[SEP] }
public NormalizedActionsEnvelope getNormalizedActions(String uid, String ddid, String mid, String offset, Integer count, Long startDate, Long endDate, String order) throws ApiException { ApiResponse<NormalizedActionsEnvelope> resp = getNormalizedActionsWithHttpInfo(uid, ddid, mid, offset, count, startDate, endDate, order); return resp.getData(); }
class class_name[name] begin[{] method[getNormalizedActions, return_type[type[NormalizedActionsEnvelope]], modifier[public], parameter[uid, ddid, mid, offset, count, startDate, endDate, order]] begin[{] local_variable[type[ApiResponse], resp] return[call[resp.getData, parameter[]]] end[}] END[}]
Keyword[public] identifier[NormalizedActionsEnvelope] identifier[getNormalizedActions] operator[SEP] identifier[String] identifier[uid] , identifier[String] identifier[ddid] , identifier[String] identifier[mid] , identifier[String] identifier[offset] , identifier[Integer] identifier[count] , identifier[Long] identifier[startDate] , identifier[Long] identifier[endDate] , identifier[String] identifier[order] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[ApiResponse] operator[<] identifier[NormalizedActionsEnvelope] operator[>] identifier[resp] operator[=] identifier[getNormalizedActionsWithHttpInfo] operator[SEP] identifier[uid] , identifier[ddid] , identifier[mid] , identifier[offset] , identifier[count] , identifier[startDate] , identifier[endDate] , identifier[order] operator[SEP] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] }
public void setIdGenerators(Set<String> idGenerators) { RenamingMap gen = new UniqueRenamingToken(); ImmutableMap.Builder<String, RenamingMap> builder = ImmutableMap.builder(); for (String name : idGenerators) { builder.put(name, gen); } this.idGenerators = builder.build(); }
class class_name[name] begin[{] method[setIdGenerators, return_type[void], modifier[public], parameter[idGenerators]] begin[{] local_variable[type[RenamingMap], gen] local_variable[type[ImmutableMap], builder] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=idGenerators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) assign[THIS[member[None.idGenerators]], call[builder.build, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setIdGenerators] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[idGenerators] operator[SEP] { identifier[RenamingMap] identifier[gen] operator[=] Keyword[new] identifier[UniqueRenamingToken] operator[SEP] operator[SEP] operator[SEP] identifier[ImmutableMap] operator[SEP] identifier[Builder] operator[<] identifier[String] , identifier[RenamingMap] operator[>] identifier[builder] operator[=] identifier[ImmutableMap] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] identifier[idGenerators] operator[SEP] { identifier[builder] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[gen] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[idGenerators] operator[=] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public void addConfiguredDistributer(final DistributerDef distributer) { if (distributer == null) { throw new NullPointerException("distributer"); } distributer.setProject(getProject()); this.distributers.addElement(distributer); }
class class_name[name] begin[{] method[addConfiguredDistributer, return_type[void], modifier[public], parameter[distributer]] begin[{] if[binary_operation[member[.distributer], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="distributer")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] call[distributer.setProject, parameter[call[.getProject, parameter[]]]] THIS[member[None.distributers]call[None.addElement, parameter[member[.distributer]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addConfiguredDistributer] operator[SEP] Keyword[final] identifier[DistributerDef] identifier[distributer] operator[SEP] { Keyword[if] operator[SEP] identifier[distributer] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[distributer] operator[SEP] identifier[setProject] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[distributers] operator[SEP] identifier[addElement] operator[SEP] identifier[distributer] operator[SEP] operator[SEP] }
public DataBuffer.Type nd4jTypeFromOnnxType(OnnxProto3.TensorProto.DataType dataType) { switch (dataType) { case DOUBLE: return DataBuffer.Type.DOUBLE; case FLOAT: return DataBuffer.Type.FLOAT; case FLOAT16: return DataBuffer.Type.HALF; case INT32: case INT64: return DataBuffer.Type.INT; default: return DataBuffer.Type.UNKNOWN; } }
class class_name[name] begin[{] method[nd4jTypeFromOnnxType, return_type[type[DataBuffer]], modifier[public], parameter[dataType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['DOUBLE'], statements=[ReturnStatement(expression=MemberReference(member=DOUBLE, postfix_operators=[], prefix_operators=[], qualifier=DataBuffer.Type, selectors=[]), label=None)]), SwitchStatementCase(case=['FLOAT'], statements=[ReturnStatement(expression=MemberReference(member=FLOAT, postfix_operators=[], prefix_operators=[], qualifier=DataBuffer.Type, selectors=[]), label=None)]), SwitchStatementCase(case=['FLOAT16'], statements=[ReturnStatement(expression=MemberReference(member=HALF, postfix_operators=[], prefix_operators=[], qualifier=DataBuffer.Type, selectors=[]), label=None)]), SwitchStatementCase(case=['INT32', 'INT64'], statements=[ReturnStatement(expression=MemberReference(member=INT, postfix_operators=[], prefix_operators=[], qualifier=DataBuffer.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=MemberReference(member=UNKNOWN, postfix_operators=[], prefix_operators=[], qualifier=DataBuffer.Type, selectors=[]), label=None)])], expression=MemberReference(member=dataType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] identifier[DataBuffer] operator[SEP] identifier[Type] identifier[nd4jTypeFromOnnxType] operator[SEP] identifier[OnnxProto3] operator[SEP] identifier[TensorProto] operator[SEP] identifier[DataType] identifier[dataType] operator[SEP] { Keyword[switch] operator[SEP] identifier[dataType] operator[SEP] { Keyword[case] identifier[DOUBLE] operator[:] Keyword[return] identifier[DataBuffer] operator[SEP] identifier[Type] operator[SEP] identifier[DOUBLE] operator[SEP] Keyword[case] identifier[FLOAT] operator[:] Keyword[return] identifier[DataBuffer] operator[SEP] identifier[Type] operator[SEP] identifier[FLOAT] operator[SEP] Keyword[case] identifier[FLOAT16] operator[:] Keyword[return] identifier[DataBuffer] operator[SEP] identifier[Type] operator[SEP] identifier[HALF] operator[SEP] Keyword[case] identifier[INT32] operator[:] Keyword[case] identifier[INT64] operator[:] Keyword[return] identifier[DataBuffer] operator[SEP] identifier[Type] operator[SEP] identifier[INT] operator[SEP] Keyword[default] operator[:] Keyword[return] identifier[DataBuffer] operator[SEP] identifier[Type] operator[SEP] identifier[UNKNOWN] operator[SEP] } }