code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public void marshall(UpdateBatchPredictionRequest updateBatchPredictionRequest, ProtocolMarshaller protocolMarshaller) { if (updateBatchPredictionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateBatchPredictionRequest.getBatchPredictionId(), BATCHPREDICTIONID_BINDING); protocolMarshaller.marshall(updateBatchPredictionRequest.getBatchPredictionName(), BATCHPREDICTIONNAME_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[updateBatchPredictionRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.updateBatchPredictionRequest], ==, 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=getBatchPredictionId, postfix_operators=[], prefix_operators=[], qualifier=updateBatchPredictionRequest, selectors=[], type_arguments=None), MemberReference(member=BATCHPREDICTIONID_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=getBatchPredictionName, postfix_operators=[], prefix_operators=[], qualifier=updateBatchPredictionRequest, selectors=[], type_arguments=None), MemberReference(member=BATCHPREDICTIONNAME_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[UpdateBatchPredictionRequest] identifier[updateBatchPredictionRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[updateBatchPredictionRequest] 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[updateBatchPredictionRequest] operator[SEP] identifier[getBatchPredictionId] operator[SEP] operator[SEP] , identifier[BATCHPREDICTIONID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateBatchPredictionRequest] operator[SEP] identifier[getBatchPredictionName] operator[SEP] operator[SEP] , identifier[BATCHPREDICTIONNAME_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void setDomainNameConfigurations(java.util.Collection<DomainNameConfiguration> domainNameConfigurations) { if (domainNameConfigurations == null) { this.domainNameConfigurations = null; return; } this.domainNameConfigurations = new java.util.ArrayList<DomainNameConfiguration>(domainNameConfigurations); }
class class_name[name] begin[{] method[setDomainNameConfigurations, return_type[void], modifier[public], parameter[domainNameConfigurations]] begin[{] if[binary_operation[member[.domainNameConfigurations], ==, literal[null]]] begin[{] assign[THIS[member[None.domainNameConfigurations]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.domainNameConfigurations]], ClassCreator(arguments=[MemberReference(member=domainNameConfigurations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DomainNameConfiguration, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDomainNameConfigurations] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[DomainNameConfiguration] operator[>] identifier[domainNameConfigurations] operator[SEP] { Keyword[if] operator[SEP] identifier[domainNameConfigurations] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[domainNameConfigurations] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[domainNameConfigurations] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[DomainNameConfiguration] operator[>] operator[SEP] identifier[domainNameConfigurations] operator[SEP] operator[SEP] }
private String getMandatory(String name) { if (!config.containsKey(name)) { throw new RuntimeException(name + " parameter is missing."); } else { return config.getString(name); } }
class class_name[name] begin[{] method[getMandatory, return_type[type[String]], modifier[private], parameter[name]] begin[{] if[call[config.containsKey, parameter[member[.name]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" parameter is missing."), 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)), label=None) else begin[{] return[call[config.getString, parameter[member[.name]]]] end[}] end[}] END[}]
Keyword[private] identifier[String] identifier[getMandatory] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[config] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[config] operator[SEP] identifier[getString] operator[SEP] identifier[name] operator[SEP] operator[SEP] } }
Object[] readNext(List<String> columnNames) throws IOException { if (currentRowInFileIndex++ >= sasFileProperties.getRowCount() || eof) { return null; } int bitOffset = sasFileProperties.isU64() ? PAGE_BIT_OFFSET_X64 : PAGE_BIT_OFFSET_X86; switch (currentPageType) { case PAGE_META_TYPE_1: case PAGE_META_TYPE_2: SubheaderPointer currentSubheaderPointer = currentPageDataSubheaderPointers.get(currentRowOnPageIndex++); ((ProcessingDataSubheader) subheaderIndexToClass.get(SubheaderIndexes.DATA_SUBHEADER_INDEX)) .processSubheader(currentSubheaderPointer.offset, currentSubheaderPointer.length, columnNames); if (currentRowOnPageIndex == currentPageDataSubheaderPointers.size()) { readNextPage(); currentRowOnPageIndex = 0; } break; case PAGE_MIX_TYPE: int subheaderPointerLength = sasFileProperties.isU64() ? SUBHEADER_POINTER_LENGTH_X64 : SUBHEADER_POINTER_LENGTH_X86; int alignCorrection = (bitOffset + SUBHEADER_POINTERS_OFFSET + currentPageSubheadersCount * subheaderPointerLength) % BITS_IN_BYTE; currentRow = processByteArrayWithData(bitOffset + SUBHEADER_POINTERS_OFFSET + alignCorrection + currentPageSubheadersCount * subheaderPointerLength + currentRowOnPageIndex++ * sasFileProperties.getRowLength(), sasFileProperties.getRowLength(), columnNames); if (currentRowOnPageIndex == Math.min(sasFileProperties.getRowCount(), sasFileProperties.getMixPageRowCount())) { readNextPage(); currentRowOnPageIndex = 0; } break; case PAGE_DATA_TYPE: currentRow = processByteArrayWithData(bitOffset + SUBHEADER_POINTERS_OFFSET + currentRowOnPageIndex++ * sasFileProperties.getRowLength(), sasFileProperties.getRowLength(), columnNames); if (currentRowOnPageIndex == currentPageBlockCount) { readNextPage(); currentRowOnPageIndex = 0; } break; default: break; } return Arrays.copyOf(currentRow, currentRow.length); }
class class_name[name] begin[{] method[readNext, return_type[type[Object]], modifier[default], parameter[columnNames]] begin[{] if[binary_operation[binary_operation[member[.currentRowInFileIndex], >=, call[sasFileProperties.getRowCount, parameter[]]], ||, member[.eof]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], bitOffset] SwitchStatement(cases=[SwitchStatementCase(case=['PAGE_META_TYPE_1', 'PAGE_META_TYPE_2'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentRowOnPageIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=currentPageDataSubheaderPointers, selectors=[], type_arguments=None), name=currentSubheaderPointer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SubheaderPointer, sub_type=None)), StatementExpression(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=DATA_SUBHEADER_INDEX, postfix_operators=[], prefix_operators=[], qualifier=SubheaderIndexes, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=subheaderIndexToClass, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ProcessingDataSubheader, sub_type=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=currentRowOnPageIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=currentPageDataSubheaderPointers, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=readNextPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentRowOnPageIndex, 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)]), SwitchStatementCase(case=['PAGE_MIX_TYPE'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MethodInvocation(arguments=[], member=isU64, postfix_operators=[], prefix_operators=[], qualifier=sasFileProperties, selectors=[], type_arguments=None), if_false=MemberReference(member=SUBHEADER_POINTER_LENGTH_X86, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=SUBHEADER_POINTER_LENGTH_X64, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), name=subheaderPointerLength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SUBHEADER_POINTERS_OFFSET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=currentPageSubheadersCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=subheaderPointerLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), operandr=MemberReference(member=BITS_IN_BYTE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%), name=alignCorrection)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SUBHEADER_POINTERS_OFFSET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=alignCorrection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=currentPageSubheadersCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=subheaderPointerLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=currentRowOnPageIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getRowLength, postfix_operators=[], prefix_operators=[], qualifier=sasFileProperties, selectors=[], type_arguments=None), operator=*), operator=+), MethodInvocation(arguments=[], member=getRowLength, postfix_operators=[], prefix_operators=[], qualifier=sasFileProperties, selectors=[], type_arguments=None), MemberReference(member=columnNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processByteArrayWithData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=currentRowOnPageIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRowCount, postfix_operators=[], prefix_operators=[], qualifier=sasFileProperties, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMixPageRowCount, postfix_operators=[], prefix_operators=[], qualifier=sasFileProperties, selectors=[], type_arguments=None)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=readNextPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentRowOnPageIndex, 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)]), SwitchStatementCase(case=['PAGE_DATA_TYPE'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SUBHEADER_POINTERS_OFFSET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=currentRowOnPageIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getRowLength, postfix_operators=[], prefix_operators=[], qualifier=sasFileProperties, selectors=[], type_arguments=None), operator=*), operator=+), MethodInvocation(arguments=[], member=getRowLength, postfix_operators=[], prefix_operators=[], qualifier=sasFileProperties, selectors=[], type_arguments=None), MemberReference(member=columnNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processByteArrayWithData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=currentRowOnPageIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=currentPageBlockCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=readNextPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentRowOnPageIndex, 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)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MemberReference(member=currentPageType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[call[Arrays.copyOf, parameter[member[.currentRow], member[currentRow.length]]]] end[}] END[}]
identifier[Object] operator[SEP] operator[SEP] identifier[readNext] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[columnNames] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[currentRowInFileIndex] operator[++] operator[>=] identifier[sasFileProperties] operator[SEP] identifier[getRowCount] operator[SEP] operator[SEP] operator[||] identifier[eof] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[bitOffset] operator[=] identifier[sasFileProperties] operator[SEP] identifier[isU64] operator[SEP] operator[SEP] operator[?] identifier[PAGE_BIT_OFFSET_X64] operator[:] identifier[PAGE_BIT_OFFSET_X86] operator[SEP] Keyword[switch] operator[SEP] identifier[currentPageType] operator[SEP] { Keyword[case] identifier[PAGE_META_TYPE_1] operator[:] Keyword[case] identifier[PAGE_META_TYPE_2] operator[:] identifier[SubheaderPointer] identifier[currentSubheaderPointer] operator[=] identifier[currentPageDataSubheaderPointers] operator[SEP] identifier[get] operator[SEP] identifier[currentRowOnPageIndex] operator[++] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ProcessingDataSubheader] operator[SEP] identifier[subheaderIndexToClass] operator[SEP] identifier[get] operator[SEP] identifier[SubheaderIndexes] operator[SEP] identifier[DATA_SUBHEADER_INDEX] operator[SEP] operator[SEP] operator[SEP] identifier[processSubheader] operator[SEP] identifier[currentSubheaderPointer] operator[SEP] identifier[offset] , identifier[currentSubheaderPointer] operator[SEP] identifier[length] , identifier[columnNames] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentRowOnPageIndex] operator[==] identifier[currentPageDataSubheaderPointers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[readNextPage] operator[SEP] operator[SEP] operator[SEP] identifier[currentRowOnPageIndex] operator[=] Other[0] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] identifier[PAGE_MIX_TYPE] operator[:] Keyword[int] identifier[subheaderPointerLength] operator[=] identifier[sasFileProperties] operator[SEP] identifier[isU64] operator[SEP] operator[SEP] operator[?] identifier[SUBHEADER_POINTER_LENGTH_X64] operator[:] identifier[SUBHEADER_POINTER_LENGTH_X86] operator[SEP] Keyword[int] identifier[alignCorrection] operator[=] operator[SEP] identifier[bitOffset] operator[+] identifier[SUBHEADER_POINTERS_OFFSET] operator[+] identifier[currentPageSubheadersCount] operator[*] identifier[subheaderPointerLength] operator[SEP] operator[%] identifier[BITS_IN_BYTE] operator[SEP] identifier[currentRow] operator[=] identifier[processByteArrayWithData] operator[SEP] identifier[bitOffset] operator[+] identifier[SUBHEADER_POINTERS_OFFSET] operator[+] identifier[alignCorrection] operator[+] identifier[currentPageSubheadersCount] operator[*] identifier[subheaderPointerLength] operator[+] identifier[currentRowOnPageIndex] operator[++] operator[*] identifier[sasFileProperties] operator[SEP] identifier[getRowLength] operator[SEP] operator[SEP] , identifier[sasFileProperties] operator[SEP] identifier[getRowLength] operator[SEP] operator[SEP] , identifier[columnNames] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentRowOnPageIndex] operator[==] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[sasFileProperties] operator[SEP] identifier[getRowCount] operator[SEP] operator[SEP] , identifier[sasFileProperties] operator[SEP] identifier[getMixPageRowCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[readNextPage] operator[SEP] operator[SEP] operator[SEP] identifier[currentRowOnPageIndex] operator[=] Other[0] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] identifier[PAGE_DATA_TYPE] operator[:] identifier[currentRow] operator[=] identifier[processByteArrayWithData] operator[SEP] identifier[bitOffset] operator[+] identifier[SUBHEADER_POINTERS_OFFSET] operator[+] identifier[currentRowOnPageIndex] operator[++] operator[*] identifier[sasFileProperties] operator[SEP] identifier[getRowLength] operator[SEP] operator[SEP] , identifier[sasFileProperties] operator[SEP] identifier[getRowLength] operator[SEP] operator[SEP] , identifier[columnNames] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentRowOnPageIndex] operator[==] identifier[currentPageBlockCount] operator[SEP] { identifier[readNextPage] operator[SEP] operator[SEP] operator[SEP] identifier[currentRowOnPageIndex] operator[=] Other[0] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP] } Keyword[return] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[currentRow] , identifier[currentRow] operator[SEP] identifier[length] operator[SEP] operator[SEP] }
@Pure @Inline(value="($1 >>> $2)", constantExpression=true) public static int operator_tripleGreaterThan(int a, int distance) { return a >>> distance; }
class class_name[name] begin[{] method[operator_tripleGreaterThan, return_type[type[int]], modifier[public static], parameter[a, distance]] begin[{] return[binary_operation[member[.a], >>>, member[.distance]]] end[}] END[}]
annotation[@] identifier[Pure] annotation[@] identifier[Inline] operator[SEP] identifier[value] operator[=] literal[String] , identifier[constantExpression] operator[=] literal[boolean] operator[SEP] Keyword[public] Keyword[static] Keyword[int] identifier[operator_tripleGreaterThan] operator[SEP] Keyword[int] identifier[a] , Keyword[int] identifier[distance] operator[SEP] { Keyword[return] identifier[a] operator[>] operator[>] operator[>] identifier[distance] operator[SEP] }
public static Drawable getSelectableBackground(Context ctx) { int selectableBackgroundRes = getSelectableBackgroundRes(ctx); return ContextCompat.getDrawable(ctx, selectableBackgroundRes); }
class class_name[name] begin[{] method[getSelectableBackground, return_type[type[Drawable]], modifier[public static], parameter[ctx]] begin[{] local_variable[type[int], selectableBackgroundRes] return[call[ContextCompat.getDrawable, parameter[member[.ctx], member[.selectableBackgroundRes]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Drawable] identifier[getSelectableBackground] operator[SEP] identifier[Context] identifier[ctx] operator[SEP] { Keyword[int] identifier[selectableBackgroundRes] operator[=] identifier[getSelectableBackgroundRes] operator[SEP] identifier[ctx] operator[SEP] operator[SEP] Keyword[return] identifier[ContextCompat] operator[SEP] identifier[getDrawable] operator[SEP] identifier[ctx] , identifier[selectableBackgroundRes] operator[SEP] operator[SEP] }
public static DocumentFragment readXMLFragment(InputStream stream) throws IOException, SAXException, ParserConfigurationException { return readXMLFragment(stream, false); }
class class_name[name] begin[{] method[readXMLFragment, return_type[type[DocumentFragment]], modifier[public static], parameter[stream]] begin[{] return[call[.readXMLFragment, parameter[member[.stream], literal[false]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DocumentFragment] identifier[readXMLFragment] operator[SEP] identifier[InputStream] identifier[stream] operator[SEP] Keyword[throws] identifier[IOException] , identifier[SAXException] , identifier[ParserConfigurationException] { Keyword[return] identifier[readXMLFragment] operator[SEP] identifier[stream] , literal[boolean] operator[SEP] operator[SEP] }
private String replaceCharacters(String name) { name = name.replaceAll("&gt;", ">"); name = name.replaceAll("&lt;", "<"); name = name.replaceAll("&amp;", "&"); name = name.replaceAll("<\\%", "<%"); name = name.replaceAll("%\\>", "%>"); return name; }
class class_name[name] begin[{] method[replaceCharacters, return_type[type[String]], modifier[private], parameter[name]] begin[{] assign[member[.name], call[name.replaceAll, parameter[literal["&gt;"], literal[">"]]]] assign[member[.name], call[name.replaceAll, parameter[literal["&lt;"], literal["<"]]]] assign[member[.name], call[name.replaceAll, parameter[literal["&amp;"], literal["&"]]]] assign[member[.name], call[name.replaceAll, parameter[literal["<\\%"], literal["<%"]]]] assign[member[.name], call[name.replaceAll, parameter[literal["%\\>"], literal["%>"]]]] return[member[.name]] end[}] END[}]
Keyword[private] identifier[String] identifier[replaceCharacters] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[name] operator[=] identifier[name] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[name] operator[=] identifier[name] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[name] operator[=] identifier[name] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[name] operator[=] identifier[name] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[name] operator[=] identifier[name] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[name] operator[SEP] }
public void disconnect() { if (readyState == ReadyState.OPEN) { // readyState should be set to ReadyState.CLOSED ONLY AFTER the // the WebSocket has been successfully closed in // socketClosedHandler(). this.closeConnection(0, "", 0, 0, null, null); } else if (readyState == ReadyState.CONNECTING) { socketClosedHandler(); } }
class class_name[name] begin[{] method[disconnect, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.readyState], ==, member[ReadyState.OPEN]]] begin[{] THIS[call[None.closeConnection, parameter[literal[0], literal[""], literal[0], literal[0], literal[null], literal[null]]]] else begin[{] if[binary_operation[member[.readyState], ==, member[ReadyState.CONNECTING]]] begin[{] call[.socketClosedHandler, parameter[]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[disconnect] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[readyState] operator[==] identifier[ReadyState] operator[SEP] identifier[OPEN] operator[SEP] { Keyword[this] operator[SEP] identifier[closeConnection] operator[SEP] Other[0] , literal[String] , Other[0] , Other[0] , Other[null] , Other[null] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[readyState] operator[==] identifier[ReadyState] operator[SEP] identifier[CONNECTING] operator[SEP] { identifier[socketClosedHandler] operator[SEP] operator[SEP] operator[SEP] } }
static public void main( String[] argv) { ActionCoordinator ac = new ActionCoordinator("test"); /* System.out.println("failure test------------"); try { ac.addActionSourceListener(new ActionSourceListener("that") { public void actionPerformed( java.awt.event.ActionEvent e) { System.out.println(" event ok "); } }); System.out.println("good dog!"); } catch (IllegalArgumentException e) { System.out.println("bad dog! = "+e); } System.out.println("next test------------"); */ ActionSourceListener as1 = new ActionSourceListener("test") { public void actionPerformed( ActionValueEvent e) { System.out.println(" first listener got event "+e.getValue()); } }; ac.addActionSourceListener(as1); ActionSourceListener as2 = new ActionSourceListener("test") { public void actionPerformed( ActionValueEvent e) { System.out.println(" second listener got event "+e.getValue()); } }; ac.addActionSourceListener(as2); ActionSourceListener as3 = new ActionSourceListener("test") { public void actionPerformed( ActionValueEvent e) { System.out.println(" third listener got event "+e.getValue()); } }; ac.addActionSourceListener(as3); as1.fireActionValueEvent("testing", "newValue 1"); as2.fireActionValueEvent("testing", "newValue 2"); }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[argv]] begin[{] local_variable[type[ActionCoordinator], ac] local_variable[type[ActionSourceListener], as1] call[ac.addActionSourceListener, parameter[member[.as1]]] local_variable[type[ActionSourceListener], as2] call[ac.addActionSourceListener, parameter[member[.as2]]] local_variable[type[ActionSourceListener], as3] call[ac.addActionSourceListener, parameter[member[.as3]]] call[as1.fireActionValueEvent, parameter[literal["testing"], literal["newValue 1"]]] call[as2.fireActionValueEvent, parameter[literal["testing"], literal["newValue 2"]]] end[}] END[}]
Keyword[static] Keyword[public] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[argv] operator[SEP] { identifier[ActionCoordinator] identifier[ac] operator[=] Keyword[new] identifier[ActionCoordinator] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ActionSourceListener] identifier[as1] operator[=] Keyword[new] identifier[ActionSourceListener] operator[SEP] literal[String] operator[SEP] { Keyword[public] Keyword[void] identifier[actionPerformed] operator[SEP] identifier[ActionValueEvent] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] identifier[ac] operator[SEP] identifier[addActionSourceListener] operator[SEP] identifier[as1] operator[SEP] operator[SEP] identifier[ActionSourceListener] identifier[as2] operator[=] Keyword[new] identifier[ActionSourceListener] operator[SEP] literal[String] operator[SEP] { Keyword[public] Keyword[void] identifier[actionPerformed] operator[SEP] identifier[ActionValueEvent] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] identifier[ac] operator[SEP] identifier[addActionSourceListener] operator[SEP] identifier[as2] operator[SEP] operator[SEP] identifier[ActionSourceListener] identifier[as3] operator[=] Keyword[new] identifier[ActionSourceListener] operator[SEP] literal[String] operator[SEP] { Keyword[public] Keyword[void] identifier[actionPerformed] operator[SEP] identifier[ActionValueEvent] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] identifier[ac] operator[SEP] identifier[addActionSourceListener] operator[SEP] identifier[as3] operator[SEP] operator[SEP] identifier[as1] operator[SEP] identifier[fireActionValueEvent] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[as2] operator[SEP] identifier[fireActionValueEvent] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "WohnungMiete", substitutionHeadNamespace = "http://www.immobilienscout24.de/immobilientransfer", substitutionHeadName = "Immobilie") public WohnungMiete createWohnungMiete(WohnungMiete.Type value) { return new WohnungMiete(value); }
class class_name[name] begin[{] method[createWohnungMiete, return_type[type[WohnungMiete]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[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=None, dimensions=None, name=WohnungMiete, 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[WohnungMiete] identifier[createWohnungMiete] operator[SEP] identifier[WohnungMiete] operator[SEP] identifier[Type] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[WohnungMiete] operator[SEP] identifier[value] operator[SEP] operator[SEP] }
public void destroy() { for (Entry<String, Runnable> entry : destructionCallbacks.entrySet()) { try { entry.getValue().run(); } catch (Throwable t) { log.error("Error during destruction callback for bean " + entry.getKey(), t); } } beans.clear(); destructionCallbacks.clear(); }
class class_name[name] begin[{] method[destroy, return_type[void], modifier[public], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=run, 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=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error during destruction callback for bean "), operandr=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operator=+), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=destructionCallbacks, 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=Runnable, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) call[beans.clear, parameter[]] call[destructionCallbacks.clear, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[destroy] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Runnable] operator[>] identifier[entry] operator[:] identifier[destructionCallbacks] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[t] operator[SEP] operator[SEP] } } identifier[beans] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[destructionCallbacks] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] }
public double[] FGFtoSat(double fgf_x, double fgf_y, double scale_x, double offset_x, double scale_y, double offset_y) { double x = fgf_x * scale_x + offset_x; double y = fgf_y * scale_y + offset_y; return new double[]{x, y}; }
class class_name[name] begin[{] method[FGFtoSat, return_type[type[double]], modifier[public], parameter[fgf_x, fgf_y, scale_x, offset_x, scale_y, offset_y]] begin[{] local_variable[type[double], x] local_variable[type[double], y] return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] end[}] END[}]
Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[FGFtoSat] operator[SEP] Keyword[double] identifier[fgf_x] , Keyword[double] identifier[fgf_y] , Keyword[double] identifier[scale_x] , Keyword[double] identifier[offset_x] , Keyword[double] identifier[scale_y] , Keyword[double] identifier[offset_y] operator[SEP] { Keyword[double] identifier[x] operator[=] identifier[fgf_x] operator[*] identifier[scale_x] operator[+] identifier[offset_x] operator[SEP] Keyword[double] identifier[y] operator[=] identifier[fgf_y] operator[*] identifier[scale_y] operator[+] identifier[offset_y] operator[SEP] Keyword[return] Keyword[new] Keyword[double] operator[SEP] operator[SEP] { identifier[x] , identifier[y] } operator[SEP] }
public static final void log(Class<?> clazz, String msg) { if (DEBUG) { System.out.println("[" + sSdf.format(new Date()) + "]" + "-" + "[" + clazz.getSimpleName() + "] " + msg); } }
class class_name[name] begin[{] method[log, return_type[void], modifier[final public static], parameter[clazz, msg]] begin[{] if[member[.DEBUG]] begin[{] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["["], +, call[sSdf.format, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]], +, literal["]"]], +, literal["-"]], +, literal["["]], +, call[clazz.getSimpleName, parameter[]]], +, literal["] "]], +, member[.msg]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] Keyword[void] identifier[log] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[String] identifier[msg] operator[SEP] { Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[sSdf] operator[SEP] identifier[format] operator[SEP] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[msg] operator[SEP] operator[SEP] } }
private void paintBackground(Graphics2D g, JComponent c, int width, int height, ButtonColors colors) { g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g.setColor(colors.top); g.drawLine(1, 0, width - 2, 0); g.setColor(colors.leftOuter); g.drawLine(0, 0, 0, height - 4); g.drawLine(1, height - 3, 1, height - 3); g.setColor(colors.leftInner); g.drawLine(1, 1, 1, height - 4); g.drawLine(2, height - 3, 2, height - 3); g.setColor(colors.edge); g.drawLine(width - 1, 0, width - 1, height - 2); g.drawLine(3, height - 2, width - 2, height - 2); g.setColor(colors.edgeShade); g.drawLine(2, height - 2, 2, height - 2); g.setColor(colors.shadow); g.drawLine(4, height - 1, width - 1, height - 1); g.setColor(colors.interior); g.fillRect(1, 1, width - 1, height - 3); g.drawLine(3, height - 3, width - 2, height - 3); }
class class_name[name] begin[{] method[paintBackground, return_type[void], modifier[private], parameter[g, c, width, height, colors]] begin[{] call[g.setRenderingHint, parameter[member[RenderingHints.KEY_ANTIALIASING], member[RenderingHints.VALUE_ANTIALIAS_OFF]]] call[g.setColor, parameter[member[colors.top]]] call[g.drawLine, parameter[literal[1], literal[0], binary_operation[member[.width], -, literal[2]], literal[0]]] call[g.setColor, parameter[member[colors.leftOuter]]] call[g.drawLine, parameter[literal[0], literal[0], literal[0], binary_operation[member[.height], -, literal[4]]]] call[g.drawLine, parameter[literal[1], binary_operation[member[.height], -, literal[3]], literal[1], binary_operation[member[.height], -, literal[3]]]] call[g.setColor, parameter[member[colors.leftInner]]] call[g.drawLine, parameter[literal[1], literal[1], literal[1], binary_operation[member[.height], -, literal[4]]]] call[g.drawLine, parameter[literal[2], binary_operation[member[.height], -, literal[3]], literal[2], binary_operation[member[.height], -, literal[3]]]] call[g.setColor, parameter[member[colors.edge]]] call[g.drawLine, parameter[binary_operation[member[.width], -, literal[1]], literal[0], binary_operation[member[.width], -, literal[1]], binary_operation[member[.height], -, literal[2]]]] call[g.drawLine, parameter[literal[3], binary_operation[member[.height], -, literal[2]], binary_operation[member[.width], -, literal[2]], binary_operation[member[.height], -, literal[2]]]] call[g.setColor, parameter[member[colors.edgeShade]]] call[g.drawLine, parameter[literal[2], binary_operation[member[.height], -, literal[2]], literal[2], binary_operation[member[.height], -, literal[2]]]] call[g.setColor, parameter[member[colors.shadow]]] call[g.drawLine, parameter[literal[4], binary_operation[member[.height], -, literal[1]], binary_operation[member[.width], -, literal[1]], binary_operation[member[.height], -, literal[1]]]] call[g.setColor, parameter[member[colors.interior]]] call[g.fillRect, parameter[literal[1], literal[1], binary_operation[member[.width], -, literal[1]], binary_operation[member[.height], -, literal[3]]]] call[g.drawLine, parameter[literal[3], binary_operation[member[.height], -, literal[3]], binary_operation[member[.width], -, literal[2]], binary_operation[member[.height], -, literal[3]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[paintBackground] operator[SEP] identifier[Graphics2D] identifier[g] , identifier[JComponent] identifier[c] , Keyword[int] identifier[width] , Keyword[int] identifier[height] , identifier[ButtonColors] identifier[colors] operator[SEP] { identifier[g] operator[SEP] identifier[setRenderingHint] operator[SEP] identifier[RenderingHints] operator[SEP] identifier[KEY_ANTIALIASING] , identifier[RenderingHints] operator[SEP] identifier[VALUE_ANTIALIAS_OFF] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[colors] operator[SEP] identifier[top] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] Other[1] , Other[0] , identifier[width] operator[-] Other[2] , Other[0] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[colors] operator[SEP] identifier[leftOuter] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] Other[0] , Other[0] , Other[0] , identifier[height] operator[-] Other[4] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] Other[1] , identifier[height] operator[-] Other[3] , Other[1] , identifier[height] operator[-] Other[3] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[colors] operator[SEP] identifier[leftInner] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] Other[1] , Other[1] , Other[1] , identifier[height] operator[-] Other[4] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] Other[2] , identifier[height] operator[-] Other[3] , Other[2] , identifier[height] operator[-] Other[3] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[colors] operator[SEP] identifier[edge] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] identifier[width] operator[-] Other[1] , Other[0] , identifier[width] operator[-] Other[1] , identifier[height] operator[-] Other[2] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] Other[3] , identifier[height] operator[-] Other[2] , identifier[width] operator[-] Other[2] , identifier[height] operator[-] Other[2] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[colors] operator[SEP] identifier[edgeShade] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] Other[2] , identifier[height] operator[-] Other[2] , Other[2] , identifier[height] operator[-] Other[2] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[colors] operator[SEP] identifier[shadow] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] Other[4] , identifier[height] operator[-] Other[1] , identifier[width] operator[-] Other[1] , identifier[height] operator[-] Other[1] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setColor] operator[SEP] identifier[colors] operator[SEP] identifier[interior] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[fillRect] operator[SEP] Other[1] , Other[1] , identifier[width] operator[-] Other[1] , identifier[height] operator[-] Other[3] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawLine] operator[SEP] Other[3] , identifier[height] operator[-] Other[3] , identifier[width] operator[-] Other[2] , identifier[height] operator[-] Other[3] operator[SEP] operator[SEP] }
private DirectoryLoaderAdaptor getDirectory(final String indexName) { DirectoryLoaderAdaptor adapter = openDirectories.get(indexName); if (adapter == null) { synchronized (openDirectories) { adapter = openDirectories.get(indexName); if (adapter == null) { final File path = new File(this.rootDirectory, indexName); final FSDirectory directory = openLuceneDirectory(path); adapter = new DirectoryLoaderAdaptor(directory, indexName, autoChunkSize, affinitySegmentId); openDirectories.put(indexName, adapter); } } } return adapter; }
class class_name[name] begin[{] method[getDirectory, return_type[type[DirectoryLoaderAdaptor]], modifier[private], parameter[indexName]] begin[{] local_variable[type[DirectoryLoaderAdaptor], adapter] if[binary_operation[member[.adapter], ==, literal[null]]] begin[{] SYNCHRONIZED[member[.openDirectories]] BEGIN[{] assign[member[.adapter], call[openDirectories.get, parameter[member[.indexName]]]] if[binary_operation[member[.adapter], ==, literal[null]]] begin[{] local_variable[type[File], path] local_variable[type[FSDirectory], directory] assign[member[.adapter], ClassCreator(arguments=[MemberReference(member=directory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indexName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=autoChunkSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=affinitySegmentId, 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=DirectoryLoaderAdaptor, sub_type=None))] call[openDirectories.put, parameter[member[.indexName], member[.adapter]]] else begin[{] None end[}] END[}] else begin[{] None end[}] return[member[.adapter]] end[}] END[}]
Keyword[private] identifier[DirectoryLoaderAdaptor] identifier[getDirectory] operator[SEP] Keyword[final] identifier[String] identifier[indexName] operator[SEP] { identifier[DirectoryLoaderAdaptor] identifier[adapter] operator[=] identifier[openDirectories] operator[SEP] identifier[get] operator[SEP] identifier[indexName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[adapter] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[openDirectories] operator[SEP] { identifier[adapter] operator[=] identifier[openDirectories] operator[SEP] identifier[get] operator[SEP] identifier[indexName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[adapter] operator[==] Other[null] operator[SEP] { Keyword[final] identifier[File] identifier[path] operator[=] Keyword[new] identifier[File] operator[SEP] Keyword[this] operator[SEP] identifier[rootDirectory] , identifier[indexName] operator[SEP] operator[SEP] Keyword[final] identifier[FSDirectory] identifier[directory] operator[=] identifier[openLuceneDirectory] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[adapter] operator[=] Keyword[new] identifier[DirectoryLoaderAdaptor] operator[SEP] identifier[directory] , identifier[indexName] , identifier[autoChunkSize] , identifier[affinitySegmentId] operator[SEP] operator[SEP] identifier[openDirectories] operator[SEP] identifier[put] operator[SEP] identifier[indexName] , identifier[adapter] operator[SEP] operator[SEP] } } } Keyword[return] identifier[adapter] operator[SEP] }
public static int medoid(boolean parallel, List<? extends Vec> X, DistanceMetric dm) { return medoid(parallel, X, 1.0/X.size(), dm); }
class class_name[name] begin[{] method[medoid, return_type[type[int]], modifier[public static], parameter[parallel, X, dm]] begin[{] return[call[.medoid, parameter[member[.parallel], member[.X], binary_operation[literal[1.0], /, call[X.size, parameter[]]], member[.dm]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[medoid] operator[SEP] Keyword[boolean] identifier[parallel] , identifier[List] operator[<] operator[?] Keyword[extends] identifier[Vec] operator[>] identifier[X] , identifier[DistanceMetric] identifier[dm] operator[SEP] { Keyword[return] identifier[medoid] operator[SEP] identifier[parallel] , identifier[X] , literal[Float] operator[/] identifier[X] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[dm] operator[SEP] operator[SEP] }
protected ModificationItem getCompensatingModificationItem( Attributes originalAttributes, ModificationItem modificationItem) { Attribute modificationAttribute = modificationItem.getAttribute(); Attribute originalAttribute = originalAttributes .get(modificationAttribute.getID()); if (modificationItem.getModificationOp() == DirContext.REMOVE_ATTRIBUTE) { if (modificationAttribute.size() == 0) { // If the modification attribute size it means that the // Attribute should be removed entirely - we should store a // ModificationItem to restore all present values for rollback. return new ModificationItem(DirContext.ADD_ATTRIBUTE, (Attribute) originalAttribute.clone()); } else { // The rollback modification will be to re-add the removed // attribute values. return new ModificationItem(DirContext.ADD_ATTRIBUTE, (Attribute) modificationAttribute.clone()); } } else if (modificationItem.getModificationOp() == DirContext.REPLACE_ATTRIBUTE) { if (originalAttribute != null) { return new ModificationItem(DirContext.REPLACE_ATTRIBUTE, (Attribute) originalAttribute.clone()); } else { // The attribute doesn't previously exist - the rollback // operation will be to remove the attribute. return new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute(modificationAttribute.getID())); } } else { // An ADD_ATTRIBUTE operation if (originalAttribute == null) { // The attribute doesn't previously exist - the rollback // operation will be to remove the attribute. return new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute(modificationAttribute.getID())); } else { // The attribute does exist before - we should store the // previous value and it should be used for replacing in // rollback. return new ModificationItem(DirContext.REPLACE_ATTRIBUTE, (Attribute) originalAttribute.clone()); } } }
class class_name[name] begin[{] method[getCompensatingModificationItem, return_type[type[ModificationItem]], modifier[protected], parameter[originalAttributes, modificationItem]] begin[{] local_variable[type[Attribute], modificationAttribute] local_variable[type[Attribute], originalAttribute] if[binary_operation[call[modificationItem.getModificationOp, parameter[]], ==, member[DirContext.REMOVE_ATTRIBUTE]]] begin[{] if[binary_operation[call[modificationAttribute.size, parameter[]], ==, literal[0]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=ADD_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=DirContext, selectors=[]), Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=originalAttribute, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModificationItem, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MemberReference(member=ADD_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=DirContext, selectors=[]), Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=modificationAttribute, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModificationItem, sub_type=None))] end[}] else begin[{] if[binary_operation[call[modificationItem.getModificationOp, parameter[]], ==, member[DirContext.REPLACE_ATTRIBUTE]]] begin[{] if[binary_operation[member[.originalAttribute], !=, literal[null]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=REPLACE_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=DirContext, selectors=[]), Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=originalAttribute, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModificationItem, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MemberReference(member=REMOVE_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=DirContext, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getID, postfix_operators=[], prefix_operators=[], qualifier=modificationAttribute, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BasicAttribute, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModificationItem, sub_type=None))] end[}] else begin[{] if[binary_operation[member[.originalAttribute], ==, literal[null]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=REMOVE_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=DirContext, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getID, postfix_operators=[], prefix_operators=[], qualifier=modificationAttribute, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BasicAttribute, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModificationItem, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MemberReference(member=REPLACE_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=DirContext, selectors=[]), Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=originalAttribute, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModificationItem, sub_type=None))] end[}] end[}] end[}] end[}] END[}]
Keyword[protected] identifier[ModificationItem] identifier[getCompensatingModificationItem] operator[SEP] identifier[Attributes] identifier[originalAttributes] , identifier[ModificationItem] identifier[modificationItem] operator[SEP] { identifier[Attribute] identifier[modificationAttribute] operator[=] identifier[modificationItem] operator[SEP] identifier[getAttribute] operator[SEP] operator[SEP] operator[SEP] identifier[Attribute] identifier[originalAttribute] operator[=] identifier[originalAttributes] operator[SEP] identifier[get] operator[SEP] identifier[modificationAttribute] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[modificationItem] operator[SEP] identifier[getModificationOp] operator[SEP] operator[SEP] operator[==] identifier[DirContext] operator[SEP] identifier[REMOVE_ATTRIBUTE] operator[SEP] { Keyword[if] operator[SEP] identifier[modificationAttribute] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Keyword[new] identifier[ModificationItem] operator[SEP] identifier[DirContext] operator[SEP] identifier[ADD_ATTRIBUTE] , operator[SEP] identifier[Attribute] operator[SEP] identifier[originalAttribute] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[ModificationItem] operator[SEP] identifier[DirContext] operator[SEP] identifier[ADD_ATTRIBUTE] , operator[SEP] identifier[Attribute] operator[SEP] identifier[modificationAttribute] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[modificationItem] operator[SEP] identifier[getModificationOp] operator[SEP] operator[SEP] operator[==] identifier[DirContext] operator[SEP] identifier[REPLACE_ATTRIBUTE] operator[SEP] { Keyword[if] operator[SEP] identifier[originalAttribute] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[ModificationItem] operator[SEP] identifier[DirContext] operator[SEP] identifier[REPLACE_ATTRIBUTE] , operator[SEP] identifier[Attribute] operator[SEP] identifier[originalAttribute] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[ModificationItem] operator[SEP] identifier[DirContext] operator[SEP] identifier[REMOVE_ATTRIBUTE] , Keyword[new] identifier[BasicAttribute] operator[SEP] identifier[modificationAttribute] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[originalAttribute] operator[==] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[ModificationItem] operator[SEP] identifier[DirContext] operator[SEP] identifier[REMOVE_ATTRIBUTE] , Keyword[new] identifier[BasicAttribute] operator[SEP] identifier[modificationAttribute] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[ModificationItem] operator[SEP] identifier[DirContext] operator[SEP] identifier[REPLACE_ATTRIBUTE] , operator[SEP] identifier[Attribute] operator[SEP] identifier[originalAttribute] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
public EmailFilter flag(final Flag flag, final boolean value) { final Flags flags = new Flags(); flags.add(flag); return flags(flags, value); }
class class_name[name] begin[{] method[flag, return_type[type[EmailFilter]], modifier[public], parameter[flag, value]] begin[{] local_variable[type[Flags], flags] call[flags.add, parameter[member[.flag]]] return[call[.flags, parameter[member[.flags], member[.value]]]] end[}] END[}]
Keyword[public] identifier[EmailFilter] identifier[flag] operator[SEP] Keyword[final] identifier[Flag] identifier[flag] , Keyword[final] Keyword[boolean] identifier[value] operator[SEP] { Keyword[final] identifier[Flags] identifier[flags] operator[=] Keyword[new] identifier[Flags] operator[SEP] operator[SEP] operator[SEP] identifier[flags] operator[SEP] identifier[add] operator[SEP] identifier[flag] operator[SEP] operator[SEP] Keyword[return] identifier[flags] operator[SEP] identifier[flags] , identifier[value] operator[SEP] operator[SEP] }
public static void setControllerName(String name) { Map<String, Object> sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap(); sessionMap.put(DART_CONTROLLER_NAME, name); }
class class_name[name] begin[{] method[setControllerName, return_type[void], modifier[public static], parameter[name]] begin[{] local_variable[type[Map], sessionMap] call[sessionMap.put, parameter[member[.DART_CONTROLLER_NAME], member[.name]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setControllerName] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[sessionMap] operator[=] identifier[FacesContext] operator[SEP] identifier[getCurrentInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getExternalContext] operator[SEP] operator[SEP] operator[SEP] identifier[getSessionMap] operator[SEP] operator[SEP] operator[SEP] identifier[sessionMap] operator[SEP] identifier[put] operator[SEP] identifier[DART_CONTROLLER_NAME] , identifier[name] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public static <T> T[] reverse(T[] self, boolean mutate) { if (!mutate) { return (T[]) toList(new ReverseListIterator<T>(Arrays.asList(self))).toArray(); } List<T> items = Arrays.asList(self); Collections.reverse(items); System.arraycopy(items.toArray(), 0, self, 0, items.size()); return self; }
class class_name[name] begin[{] method[reverse, return_type[type[T]], modifier[public static], parameter[self, mutate]] begin[{] if[member[.mutate]] begin[{] return[Cast(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=ReverseListIterator, sub_type=None))], member=toList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=T, sub_type=None))] else begin[{] None end[}] local_variable[type[List], items] call[Collections.reverse, parameter[member[.items]]] call[System.arraycopy, parameter[call[items.toArray, parameter[]], literal[0], member[.self], literal[0], call[items.size, parameter[]]]] return[member[.self]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[reverse] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[self] , Keyword[boolean] identifier[mutate] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[mutate] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] operator[SEP] operator[SEP] identifier[toList] operator[SEP] Keyword[new] identifier[ReverseListIterator] operator[<] identifier[T] operator[>] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[self] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[T] operator[>] identifier[items] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[self] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[reverse] operator[SEP] identifier[items] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[items] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] , Other[0] , identifier[self] , Other[0] , identifier[items] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[self] operator[SEP] }
public void setImages(java.util.Collection<EnvironmentImage> images) { if (images == null) { this.images = null; return; } this.images = new java.util.ArrayList<EnvironmentImage>(images); }
class class_name[name] begin[{] method[setImages, return_type[void], modifier[public], parameter[images]] begin[{] if[binary_operation[member[.images], ==, literal[null]]] begin[{] assign[THIS[member[None.images]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.images]], ClassCreator(arguments=[MemberReference(member=images, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=EnvironmentImage, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setImages] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[EnvironmentImage] operator[>] identifier[images] operator[SEP] { Keyword[if] operator[SEP] identifier[images] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[images] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[images] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[EnvironmentImage] operator[>] operator[SEP] identifier[images] operator[SEP] operator[SEP] }
private ULocale getBestMatchInternal(ULocale languageCode, OutputDouble outputWeight) { languageCode = canonicalize(languageCode); final ULocale maximized = addLikelySubtags(languageCode); if (DEBUG) { System.out.println("\ngetBestMatchInternal: " + languageCode + ";\t" + maximized); } double bestWeight = 0; ULocale bestTableMatch = null; String baseLanguage = maximized.getLanguage(); Set<R3<ULocale, ULocale, Double>> searchTable = desiredLanguageToPossibleLocalesToMaxLocaleToData.get(baseLanguage); if (searchTable != null) { // we preprocessed the table so as to filter by lanugage if (DEBUG) System.out.println("\tSearching: " + searchTable); for (final R3<ULocale, ULocale, Double> tableKeyValue : searchTable) { ULocale tableKey = tableKeyValue.get0(); ULocale maxLocale = tableKeyValue.get1(); Double matchedWeight = tableKeyValue.get2(); final double match = match(languageCode, maximized, tableKey, maxLocale); if (DEBUG) { System.out.println("\t" + tableKeyValue + ";\t" + match + "\n"); } final double weight = match * matchedWeight; if (weight > bestWeight) { bestWeight = weight; bestTableMatch = tableKey; if (weight > 0.999d) { // bail on good enough match. break; } } } } if (bestWeight < threshold) { bestTableMatch = defaultLanguage; } if (outputWeight != null) { outputWeight.value = bestWeight; // only return the weight when needed } return bestTableMatch; }
class class_name[name] begin[{] method[getBestMatchInternal, return_type[type[ULocale]], modifier[private], parameter[languageCode, outputWeight]] begin[{] assign[member[.languageCode], call[.canonicalize, parameter[member[.languageCode]]]] local_variable[type[ULocale], maximized] if[member[.DEBUG]] begin[{] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[literal["\ngetBestMatchInternal: "], +, member[.languageCode]], +, literal[";\t"]], +, member[.maximized]]]] else begin[{] None end[}] local_variable[type[double], bestWeight] local_variable[type[ULocale], bestTableMatch] local_variable[type[String], baseLanguage] local_variable[type[Set], searchTable] if[binary_operation[member[.searchTable], !=, literal[null]]] begin[{] if[member[.DEBUG]] begin[{] call[System.out.println, parameter[binary_operation[literal["\tSearching: "], +, member[.searchTable]]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get0, postfix_operators=[], prefix_operators=[], qualifier=tableKeyValue, selectors=[], type_arguments=None), name=tableKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ULocale, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get1, postfix_operators=[], prefix_operators=[], qualifier=tableKeyValue, selectors=[], type_arguments=None), name=maxLocale)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ULocale, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get2, postfix_operators=[], prefix_operators=[], qualifier=tableKeyValue, selectors=[], type_arguments=None), name=matchedWeight)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=languageCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maximized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tableKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxLocale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=match)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), IfStatement(condition=MemberReference(member=DEBUG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operandr=MemberReference(member=tableKeyValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=";\t"), operator=+), operandr=MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=matchedWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), name=weight)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=weight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bestWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=weight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestTableMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tableKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=weight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.999d), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=searchTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tableKeyValue)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ULocale, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ULocale, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))], dimensions=[], name=R3, sub_type=None))), label=None) else begin[{] None end[}] if[binary_operation[member[.bestWeight], <, member[.threshold]]] begin[{] assign[member[.bestTableMatch], member[.defaultLanguage]] else begin[{] None end[}] if[binary_operation[member[.outputWeight], !=, literal[null]]] begin[{] assign[member[outputWeight.value], member[.bestWeight]] else begin[{] None end[}] return[member[.bestTableMatch]] end[}] END[}]
Keyword[private] identifier[ULocale] identifier[getBestMatchInternal] operator[SEP] identifier[ULocale] identifier[languageCode] , identifier[OutputDouble] identifier[outputWeight] operator[SEP] { identifier[languageCode] operator[=] identifier[canonicalize] operator[SEP] identifier[languageCode] operator[SEP] operator[SEP] Keyword[final] identifier[ULocale] identifier[maximized] operator[=] identifier[addLikelySubtags] operator[SEP] identifier[languageCode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[languageCode] operator[+] literal[String] operator[+] identifier[maximized] operator[SEP] operator[SEP] } Keyword[double] identifier[bestWeight] operator[=] Other[0] operator[SEP] identifier[ULocale] identifier[bestTableMatch] operator[=] Other[null] operator[SEP] identifier[String] identifier[baseLanguage] operator[=] identifier[maximized] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[R3] operator[<] identifier[ULocale] , identifier[ULocale] , identifier[Double] operator[>] operator[>] identifier[searchTable] operator[=] identifier[desiredLanguageToPossibleLocalesToMaxLocaleToData] operator[SEP] identifier[get] operator[SEP] identifier[baseLanguage] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[searchTable] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[searchTable] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[R3] operator[<] identifier[ULocale] , identifier[ULocale] , identifier[Double] operator[>] identifier[tableKeyValue] operator[:] identifier[searchTable] operator[SEP] { identifier[ULocale] identifier[tableKey] operator[=] identifier[tableKeyValue] operator[SEP] identifier[get0] operator[SEP] operator[SEP] operator[SEP] identifier[ULocale] identifier[maxLocale] operator[=] identifier[tableKeyValue] operator[SEP] identifier[get1] operator[SEP] operator[SEP] operator[SEP] identifier[Double] identifier[matchedWeight] operator[=] identifier[tableKeyValue] operator[SEP] identifier[get2] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[match] operator[=] identifier[match] operator[SEP] identifier[languageCode] , identifier[maximized] , identifier[tableKey] , identifier[maxLocale] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[tableKeyValue] operator[+] literal[String] operator[+] identifier[match] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[final] Keyword[double] identifier[weight] operator[=] identifier[match] operator[*] identifier[matchedWeight] operator[SEP] Keyword[if] operator[SEP] identifier[weight] operator[>] identifier[bestWeight] operator[SEP] { identifier[bestWeight] operator[=] identifier[weight] operator[SEP] identifier[bestTableMatch] operator[=] identifier[tableKey] operator[SEP] Keyword[if] operator[SEP] identifier[weight] operator[>] literal[Float] operator[SEP] { Keyword[break] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[bestWeight] operator[<] identifier[threshold] operator[SEP] { identifier[bestTableMatch] operator[=] identifier[defaultLanguage] operator[SEP] } Keyword[if] operator[SEP] identifier[outputWeight] operator[!=] Other[null] operator[SEP] { identifier[outputWeight] operator[SEP] identifier[value] operator[=] identifier[bestWeight] operator[SEP] } Keyword[return] identifier[bestTableMatch] operator[SEP] }
public void setJobQueues(java.util.Collection<String> jobQueues) { if (jobQueues == null) { this.jobQueues = null; return; } this.jobQueues = new java.util.ArrayList<String>(jobQueues); }
class class_name[name] begin[{] method[setJobQueues, return_type[void], modifier[public], parameter[jobQueues]] begin[{] if[binary_operation[member[.jobQueues], ==, literal[null]]] begin[{] assign[THIS[member[None.jobQueues]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.jobQueues]], ClassCreator(arguments=[MemberReference(member=jobQueues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setJobQueues] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[jobQueues] operator[SEP] { Keyword[if] operator[SEP] identifier[jobQueues] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[jobQueues] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[jobQueues] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[jobQueues] operator[SEP] operator[SEP] }
public static String getMessageMetadata(Msg msg, String property) { String data = null; Metadata metadata = msg.getMetadata(); if (metadata != null) { data = metadata.get(property); } return data; }
class class_name[name] begin[{] method[getMessageMetadata, return_type[type[String]], modifier[public static], parameter[msg, property]] begin[{] local_variable[type[String], data] local_variable[type[Metadata], metadata] if[binary_operation[member[.metadata], !=, literal[null]]] begin[{] assign[member[.data], call[metadata.get, parameter[member[.property]]]] else begin[{] None end[}] return[member[.data]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getMessageMetadata] operator[SEP] identifier[Msg] identifier[msg] , identifier[String] identifier[property] operator[SEP] { identifier[String] identifier[data] operator[=] Other[null] operator[SEP] identifier[Metadata] identifier[metadata] operator[=] identifier[msg] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[metadata] operator[!=] Other[null] operator[SEP] { identifier[data] operator[=] identifier[metadata] operator[SEP] identifier[get] operator[SEP] identifier[property] operator[SEP] operator[SEP] } Keyword[return] identifier[data] operator[SEP] }
protected String determinePrincipalId(final RequestContext requestContext, final Credential credential) { if (StringUtils.isBlank(properties.getJdbc().getPrincipalIdAttribute())) { return credential.getId(); } val principal = WebUtils.getAuthentication(requestContext).getPrincipal(); val pIdAttribName = properties.getJdbc().getPrincipalIdAttribute(); if (!principal.getAttributes().containsKey(pIdAttribName)) { throw new IllegalStateException("Principal attribute [" + pIdAttribName + "] cannot be found"); } val pIdAttributeValue = principal.getAttributes().get(pIdAttribName); val pIdAttributeValues = CollectionUtils.toCollection(pIdAttributeValue); var principalId = StringUtils.EMPTY; if (!pIdAttributeValues.isEmpty()) { principalId = pIdAttributeValues.iterator().next().toString().trim(); } if (pIdAttributeValues.size() > 1) { LOGGER.warn("Principal attribute [{}] was found, but its value [{}] is multi-valued. " + "Proceeding with the first element [{}]", pIdAttribName, pIdAttributeValue, principalId); } if (principalId.isEmpty()) { throw new IllegalStateException("Principal attribute [" + pIdAttribName + "] was found, but it is either empty" + " or multi-valued with an empty element"); } return principalId; }
class class_name[name] begin[{] method[determinePrincipalId, return_type[type[String]], modifier[protected], parameter[requestContext, credential]] begin[{] if[call[StringUtils.isBlank, parameter[call[properties.getJdbc, parameter[]]]]] begin[{] return[call[credential.getId, parameter[]]] else begin[{] None end[}] local_variable[type[val], principal] local_variable[type[val], pIdAttribName] if[call[principal.getAttributes, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Principal attribute ["), operandr=MemberReference(member=pIdAttribName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] cannot be found"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[val], pIdAttributeValue] local_variable[type[val], pIdAttributeValues] local_variable[type[var], principalId] if[call[pIdAttributeValues.isEmpty, parameter[]]] begin[{] assign[member[.principalId], call[pIdAttributeValues.iterator, parameter[]]] else begin[{] None end[}] if[binary_operation[call[pIdAttributeValues.size, parameter[]], >, literal[1]]] begin[{] call[LOGGER.warn, parameter[binary_operation[literal["Principal attribute [{}] was found, but its value [{}] is multi-valued. "], +, literal["Proceeding with the first element [{}]"]], member[.pIdAttribName], member[.pIdAttributeValue], member[.principalId]]] else begin[{] None end[}] if[call[principalId.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Principal attribute ["), operandr=MemberReference(member=pIdAttribName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] was found, but it is either empty"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" or multi-valued with an empty element"), 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[}] return[member[.principalId]] end[}] END[}]
Keyword[protected] identifier[String] identifier[determinePrincipalId] operator[SEP] Keyword[final] identifier[RequestContext] identifier[requestContext] , Keyword[final] identifier[Credential] identifier[credential] operator[SEP] { Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[properties] operator[SEP] identifier[getJdbc] operator[SEP] operator[SEP] operator[SEP] identifier[getPrincipalIdAttribute] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[credential] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] } identifier[val] identifier[principal] operator[=] identifier[WebUtils] operator[SEP] identifier[getAuthentication] operator[SEP] identifier[requestContext] operator[SEP] operator[SEP] identifier[getPrincipal] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[pIdAttribName] operator[=] identifier[properties] operator[SEP] identifier[getJdbc] operator[SEP] operator[SEP] operator[SEP] identifier[getPrincipalIdAttribute] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[principal] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[pIdAttribName] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[pIdAttribName] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[val] identifier[pIdAttributeValue] operator[=] identifier[principal] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[pIdAttribName] operator[SEP] operator[SEP] identifier[val] identifier[pIdAttributeValues] operator[=] identifier[CollectionUtils] operator[SEP] identifier[toCollection] operator[SEP] identifier[pIdAttributeValue] operator[SEP] operator[SEP] identifier[var] identifier[principalId] operator[=] identifier[StringUtils] operator[SEP] identifier[EMPTY] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[pIdAttributeValues] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[principalId] operator[=] identifier[pIdAttributeValues] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[pIdAttributeValues] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] literal[String] , identifier[pIdAttribName] , identifier[pIdAttributeValue] , identifier[principalId] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[principalId] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[pIdAttribName] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[principalId] operator[SEP] }
public void setText(String source) { string_ = source; // TODO: do we need to remember the source string in a field? CollationIterator newIter; boolean numeric = rbc_.settings.readOnly().isNumeric(); if (rbc_.settings.readOnly().dontCheckFCD()) { newIter = new UTF16CollationIterator(rbc_.data, numeric, string_, 0); } else { newIter = new FCDUTF16CollationIterator(rbc_.data, numeric, string_, 0); } iter_ = newIter; otherHalf_ = 0; dir_ = 0; }
class class_name[name] begin[{] method[setText, return_type[void], modifier[public], parameter[source]] begin[{] assign[member[.string_], member[.source]] local_variable[type[CollationIterator], newIter] local_variable[type[boolean], numeric] if[call[rbc_.settings.readOnly, parameter[]]] begin[{] assign[member[.newIter], ClassCreator(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=rbc_, selectors=[]), MemberReference(member=numeric, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=string_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UTF16CollationIterator, sub_type=None))] else begin[{] assign[member[.newIter], ClassCreator(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=rbc_, selectors=[]), MemberReference(member=numeric, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=string_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FCDUTF16CollationIterator, sub_type=None))] end[}] assign[member[.iter_], member[.newIter]] assign[member[.otherHalf_], literal[0]] assign[member[.dir_], literal[0]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setText] operator[SEP] identifier[String] identifier[source] operator[SEP] { identifier[string_] operator[=] identifier[source] operator[SEP] identifier[CollationIterator] identifier[newIter] operator[SEP] Keyword[boolean] identifier[numeric] operator[=] identifier[rbc_] operator[SEP] identifier[settings] operator[SEP] identifier[readOnly] operator[SEP] operator[SEP] operator[SEP] identifier[isNumeric] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rbc_] operator[SEP] identifier[settings] operator[SEP] identifier[readOnly] operator[SEP] operator[SEP] operator[SEP] identifier[dontCheckFCD] operator[SEP] operator[SEP] operator[SEP] { identifier[newIter] operator[=] Keyword[new] identifier[UTF16CollationIterator] operator[SEP] identifier[rbc_] operator[SEP] identifier[data] , identifier[numeric] , identifier[string_] , Other[0] operator[SEP] operator[SEP] } Keyword[else] { identifier[newIter] operator[=] Keyword[new] identifier[FCDUTF16CollationIterator] operator[SEP] identifier[rbc_] operator[SEP] identifier[data] , identifier[numeric] , identifier[string_] , Other[0] operator[SEP] operator[SEP] } identifier[iter_] operator[=] identifier[newIter] operator[SEP] identifier[otherHalf_] operator[=] Other[0] operator[SEP] identifier[dir_] operator[=] Other[0] operator[SEP] }
public static void escapeHtml4(final Reader reader, final Writer writer) throws IOException { escapeHtml(reader, writer, HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL, HtmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT); }
class class_name[name] begin[{] method[escapeHtml4, return_type[void], modifier[public static], parameter[reader, writer]] begin[{] call[.escapeHtml, parameter[member[.reader], member[.writer], member[HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL], member[HtmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[escapeHtml4] operator[SEP] Keyword[final] identifier[Reader] identifier[reader] , Keyword[final] identifier[Writer] identifier[writer] operator[SEP] Keyword[throws] identifier[IOException] { identifier[escapeHtml] operator[SEP] identifier[reader] , identifier[writer] , identifier[HtmlEscapeType] operator[SEP] identifier[HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL] , identifier[HtmlEscapeLevel] operator[SEP] identifier[LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT] operator[SEP] operator[SEP] }
public void setIconifiedByDefault(boolean iconified) { if (searchView != null) { searchView.setIconifiedByDefault(iconified); } else if (supportView != null) { supportView.setIconifiedByDefault(iconified); } else { throw new IllegalStateException(ERROR_NO_SEARCHVIEW); } }
class class_name[name] begin[{] method[setIconifiedByDefault, return_type[void], modifier[public], parameter[iconified]] begin[{] if[binary_operation[member[.searchView], !=, literal[null]]] begin[{] call[searchView.setIconifiedByDefault, parameter[member[.iconified]]] else begin[{] if[binary_operation[member[.supportView], !=, literal[null]]] begin[{] call[supportView.setIconifiedByDefault, parameter[member[.iconified]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ERROR_NO_SEARCHVIEW, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setIconifiedByDefault] operator[SEP] Keyword[boolean] identifier[iconified] operator[SEP] { Keyword[if] operator[SEP] identifier[searchView] operator[!=] Other[null] operator[SEP] { identifier[searchView] operator[SEP] identifier[setIconifiedByDefault] operator[SEP] identifier[iconified] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[supportView] operator[!=] Other[null] operator[SEP] { identifier[supportView] operator[SEP] identifier[setIconifiedByDefault] operator[SEP] identifier[iconified] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[ERROR_NO_SEARCHVIEW] operator[SEP] operator[SEP] } }
public void domain_serviceInfos_PUT(String domain, OvhService body) throws IOException { String qPath = "/email/domain/{domain}/serviceInfos"; StringBuilder sb = path(qPath, domain); exec(qPath, "PUT", sb.toString(), body); }
class class_name[name] begin[{] method[domain_serviceInfos_PUT, return_type[void], modifier[public], parameter[domain, body]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] call[.exec, parameter[member[.qPath], literal["PUT"], call[sb.toString, parameter[]], member[.body]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[domain_serviceInfos_PUT] operator[SEP] identifier[String] identifier[domain] , identifier[OvhService] identifier[body] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[domain] operator[SEP] operator[SEP] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[body] operator[SEP] operator[SEP] }
void finishSuccessfully(ChannelPipeline pipeline, SessionProtocol protocol) { if (protocol == H1 || protocol == H1C) { addBeforeSessionHandler(pipeline, new Http1ResponseDecoder(pipeline.channel())); } else if (protocol == H2 || protocol == H2C) { final int initialWindow = clientFactory.http2InitialConnectionWindowSize(); if (initialWindow > DEFAULT_WINDOW_SIZE) { incrementLocalWindowSize(pipeline, initialWindow - DEFAULT_WINDOW_SIZE); } } final long idleTimeoutMillis = clientFactory.idleTimeoutMillis(); if (idleTimeoutMillis > 0) { pipeline.addFirst(new HttpClientIdleTimeoutHandler(idleTimeoutMillis)); } pipeline.channel().eventLoop().execute(() -> pipeline.fireUserEventTriggered(protocol)); }
class class_name[name] begin[{] method[finishSuccessfully, return_type[void], modifier[default], parameter[pipeline, protocol]] begin[{] if[binary_operation[binary_operation[member[.protocol], ==, member[.H1]], ||, binary_operation[member[.protocol], ==, member[.H1C]]]] begin[{] call[.addBeforeSessionHandler, parameter[member[.pipeline], ClassCreator(arguments=[MethodInvocation(arguments=[], member=channel, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Http1ResponseDecoder, sub_type=None))]] else begin[{] if[binary_operation[binary_operation[member[.protocol], ==, member[.H2]], ||, binary_operation[member[.protocol], ==, member[.H2C]]]] begin[{] local_variable[type[int], initialWindow] if[binary_operation[member[.initialWindow], >, member[.DEFAULT_WINDOW_SIZE]]] begin[{] call[.incrementLocalWindowSize, parameter[member[.pipeline], binary_operation[member[.initialWindow], -, member[.DEFAULT_WINDOW_SIZE]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] local_variable[type[long], idleTimeoutMillis] if[binary_operation[member[.idleTimeoutMillis], >, literal[0]]] begin[{] call[pipeline.addFirst, parameter[ClassCreator(arguments=[MemberReference(member=idleTimeoutMillis, 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=HttpClientIdleTimeoutHandler, sub_type=None))]] else begin[{] None end[}] call[pipeline.channel, parameter[]] end[}] END[}]
Keyword[void] identifier[finishSuccessfully] operator[SEP] identifier[ChannelPipeline] identifier[pipeline] , identifier[SessionProtocol] identifier[protocol] operator[SEP] { Keyword[if] operator[SEP] identifier[protocol] operator[==] identifier[H1] operator[||] identifier[protocol] operator[==] identifier[H1C] operator[SEP] { identifier[addBeforeSessionHandler] operator[SEP] identifier[pipeline] , Keyword[new] identifier[Http1ResponseDecoder] operator[SEP] identifier[pipeline] operator[SEP] identifier[channel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[protocol] operator[==] identifier[H2] operator[||] identifier[protocol] operator[==] identifier[H2C] operator[SEP] { Keyword[final] Keyword[int] identifier[initialWindow] operator[=] identifier[clientFactory] operator[SEP] identifier[http2InitialConnectionWindowSize] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[initialWindow] operator[>] identifier[DEFAULT_WINDOW_SIZE] operator[SEP] { identifier[incrementLocalWindowSize] operator[SEP] identifier[pipeline] , identifier[initialWindow] operator[-] identifier[DEFAULT_WINDOW_SIZE] operator[SEP] operator[SEP] } } Keyword[final] Keyword[long] identifier[idleTimeoutMillis] operator[=] identifier[clientFactory] operator[SEP] identifier[idleTimeoutMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[idleTimeoutMillis] operator[>] Other[0] operator[SEP] { identifier[pipeline] operator[SEP] identifier[addFirst] operator[SEP] Keyword[new] identifier[HttpClientIdleTimeoutHandler] operator[SEP] identifier[idleTimeoutMillis] operator[SEP] operator[SEP] operator[SEP] } identifier[pipeline] operator[SEP] identifier[channel] operator[SEP] operator[SEP] operator[SEP] identifier[eventLoop] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[pipeline] operator[SEP] identifier[fireUserEventTriggered] operator[SEP] identifier[protocol] operator[SEP] operator[SEP] operator[SEP] }
@Override public BELAnnotationDefinition convert(AnnotationDefinition ad) { if (ad == null) { return null; } if (ad.getType() == null) { return new BELAnnotationDefinition( ad.getId(), BELAnnotationType.URL, ad.getURL()); } switch (ad.getType()) { case ENUMERATION: return new BELAnnotationDefinition(ad.getId(), BELAnnotationType.LIST, ad.getEnums()); case REGULAR_EXPRESSION: return new BELAnnotationDefinition(ad.getId(), BELAnnotationType.PATTERN, ad.getValue()); default: throw new InvalidArgument("AnnotationType '" + ad.getType() + "' not known."); } }
class class_name[name] begin[{] method[convert, return_type[type[BELAnnotationDefinition]], modifier[public], parameter[ad]] begin[{] if[binary_operation[member[.ad], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[call[ad.getType, parameter[]], ==, literal[null]]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=ad, selectors=[], type_arguments=None), MemberReference(member=URL, postfix_operators=[], prefix_operators=[], qualifier=BELAnnotationType, selectors=[]), MethodInvocation(arguments=[], member=getURL, postfix_operators=[], prefix_operators=[], qualifier=ad, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BELAnnotationDefinition, sub_type=None))] else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=['ENUMERATION'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=ad, selectors=[], type_arguments=None), MemberReference(member=LIST, postfix_operators=[], prefix_operators=[], qualifier=BELAnnotationType, selectors=[]), MethodInvocation(arguments=[], member=getEnums, postfix_operators=[], prefix_operators=[], qualifier=ad, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BELAnnotationDefinition, sub_type=None)), label=None)]), SwitchStatementCase(case=['REGULAR_EXPRESSION'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=ad, selectors=[], type_arguments=None), MemberReference(member=PATTERN, postfix_operators=[], prefix_operators=[], qualifier=BELAnnotationType, selectors=[]), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=ad, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BELAnnotationDefinition, sub_type=None)), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AnnotationType '"), operandr=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=ad, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' not known."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgument, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=ad, selectors=[], type_arguments=None), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[BELAnnotationDefinition] identifier[convert] operator[SEP] identifier[AnnotationDefinition] identifier[ad] operator[SEP] { Keyword[if] operator[SEP] identifier[ad] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[ad] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[BELAnnotationDefinition] operator[SEP] identifier[ad] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[BELAnnotationType] operator[SEP] identifier[URL] , identifier[ad] operator[SEP] identifier[getURL] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[ad] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[ENUMERATION] operator[:] Keyword[return] Keyword[new] identifier[BELAnnotationDefinition] operator[SEP] identifier[ad] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[BELAnnotationType] operator[SEP] identifier[LIST] , identifier[ad] operator[SEP] identifier[getEnums] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[REGULAR_EXPRESSION] operator[:] Keyword[return] Keyword[new] identifier[BELAnnotationDefinition] operator[SEP] identifier[ad] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[BELAnnotationType] operator[SEP] identifier[PATTERN] , identifier[ad] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[InvalidArgument] operator[SEP] literal[String] operator[+] identifier[ad] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } }
protected final AbstractConfigValue peekAssumingResolved(String key, Path originalPath) { try { return attemptPeekWithPartialResolve(key); } catch (ConfigException.NotResolved e) { throw ConfigImpl.improveNotResolved(originalPath, e); } }
class class_name[name] begin[{] method[peekAssumingResolved, return_type[type[AbstractConfigValue]], modifier[final protected], parameter[key, originalPath]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=attemptPeekWithPartialResolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=originalPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=improveNotResolved, postfix_operators=[], prefix_operators=[], qualifier=ConfigImpl, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ConfigException.NotResolved']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[final] identifier[AbstractConfigValue] identifier[peekAssumingResolved] operator[SEP] identifier[String] identifier[key] , identifier[Path] identifier[originalPath] operator[SEP] { Keyword[try] { Keyword[return] identifier[attemptPeekWithPartialResolve] operator[SEP] identifier[key] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ConfigException] operator[SEP] identifier[NotResolved] identifier[e] operator[SEP] { Keyword[throw] identifier[ConfigImpl] operator[SEP] identifier[improveNotResolved] operator[SEP] identifier[originalPath] , identifier[e] operator[SEP] operator[SEP] } }
public void marshall(Entity entity, ProtocolMarshaller protocolMarshaller) { if (entity == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(entity.getId(), ID_BINDING); protocolMarshaller.marshall(entity.getBeginOffset(), BEGINOFFSET_BINDING); protocolMarshaller.marshall(entity.getEndOffset(), ENDOFFSET_BINDING); protocolMarshaller.marshall(entity.getScore(), SCORE_BINDING); protocolMarshaller.marshall(entity.getText(), TEXT_BINDING); protocolMarshaller.marshall(entity.getCategory(), CATEGORY_BINDING); protocolMarshaller.marshall(entity.getType(), TYPE_BINDING); protocolMarshaller.marshall(entity.getTraits(), TRAITS_BINDING); protocolMarshaller.marshall(entity.getAttributes(), ATTRIBUTES_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[entity, protocolMarshaller]] begin[{] if[binary_operation[member[.entity], ==, 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=getId, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=ID_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=getBeginOffset, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=BEGINOFFSET_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=getEndOffset, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=ENDOFFSET_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=getScore, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=SCORE_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=getText, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=TEXT_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=getCategory, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=CATEGORY_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=TYPE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTraits, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=TRAITS_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=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), MemberReference(member=ATTRIBUTES_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[Entity] identifier[entity] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[entity] 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[entity] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[ID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[entity] operator[SEP] identifier[getBeginOffset] operator[SEP] operator[SEP] , identifier[BEGINOFFSET_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[entity] operator[SEP] identifier[getEndOffset] operator[SEP] operator[SEP] , identifier[ENDOFFSET_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[entity] operator[SEP] identifier[getScore] operator[SEP] operator[SEP] , identifier[SCORE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[entity] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , identifier[TEXT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[entity] operator[SEP] identifier[getCategory] operator[SEP] operator[SEP] , identifier[CATEGORY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[entity] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[TYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[entity] operator[SEP] identifier[getTraits] operator[SEP] operator[SEP] , identifier[TRAITS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[entity] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] , identifier[ATTRIBUTES_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private void firePluginStopped(final Plugin plugin) { PluginEvent e = null; synchronized (listenerList) { for (Iterator iter = listenerList.iterator(); iter.hasNext();) { PluginListener l = (PluginListener) iter.next(); if (e == null) { e = new PluginEvent(plugin); } l.pluginStopped(e); } } }
class class_name[name] begin[{] method[firePluginStopped, return_type[void], modifier[private], parameter[plugin]] begin[{] local_variable[type[PluginEvent], e] SYNCHRONIZED[member[.listenerList]] BEGIN[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=PluginListener, sub_type=None)), name=l)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PluginListener, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, 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=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=plugin, 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=PluginEvent, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pluginStopped, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=listenerList, selectors=[], type_arguments=None), name=iter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) END[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[firePluginStopped] operator[SEP] Keyword[final] identifier[Plugin] identifier[plugin] operator[SEP] { identifier[PluginEvent] identifier[e] operator[=] Other[null] operator[SEP] Keyword[synchronized] operator[SEP] identifier[listenerList] operator[SEP] { Keyword[for] operator[SEP] identifier[Iterator] identifier[iter] operator[=] identifier[listenerList] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[PluginListener] identifier[l] operator[=] operator[SEP] identifier[PluginListener] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[e] operator[==] Other[null] operator[SEP] { identifier[e] operator[=] Keyword[new] identifier[PluginEvent] operator[SEP] identifier[plugin] operator[SEP] operator[SEP] } identifier[l] operator[SEP] identifier[pluginStopped] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } }
public void setReadTimeout(int timeout) { Assert.isTrue(timeout >= 0, "Timeout must be a non-negative value"); getHttpClient().getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, timeout); }
class class_name[name] begin[{] method[setReadTimeout, return_type[void], modifier[public], parameter[timeout]] begin[{] call[Assert.isTrue, parameter[binary_operation[member[.timeout], >=, literal[0]], literal["Timeout must be a non-negative value"]]] call[.getHttpClient, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setReadTimeout] operator[SEP] Keyword[int] identifier[timeout] operator[SEP] { identifier[Assert] operator[SEP] identifier[isTrue] operator[SEP] identifier[timeout] operator[>=] Other[0] , literal[String] operator[SEP] operator[SEP] identifier[getHttpClient] operator[SEP] operator[SEP] operator[SEP] identifier[getParams] operator[SEP] operator[SEP] operator[SEP] identifier[setIntParameter] operator[SEP] identifier[CoreConnectionPNames] operator[SEP] identifier[SO_TIMEOUT] , identifier[timeout] operator[SEP] operator[SEP] }
private void setEventChannelTimeoutMillis(EventChannel eventChannel, int millis) { // Change Jacorb policy for timeout org.omg.CORBA.Policy p = new org.jacorb.orb.policies.RelativeRoundtripTimeoutPolicy(10000 * millis); eventChannel._set_policy_override(new Policy[]{p}, org.omg.CORBA.SetOverrideType.ADD_OVERRIDE); }
class class_name[name] begin[{] method[setEventChannelTimeoutMillis, return_type[void], modifier[private], parameter[eventChannel, millis]] begin[{] local_variable[type[org], p] call[eventChannel._set_policy_override, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Policy, sub_type=None)), member[org.omg.CORBA.SetOverrideType.ADD_OVERRIDE]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setEventChannelTimeoutMillis] operator[SEP] identifier[EventChannel] identifier[eventChannel] , Keyword[int] identifier[millis] operator[SEP] { identifier[org] operator[SEP] identifier[omg] operator[SEP] identifier[CORBA] operator[SEP] identifier[Policy] identifier[p] operator[=] Keyword[new] identifier[org] operator[SEP] identifier[jacorb] operator[SEP] identifier[orb] operator[SEP] identifier[policies] operator[SEP] identifier[RelativeRoundtripTimeoutPolicy] operator[SEP] Other[10000] operator[*] identifier[millis] operator[SEP] operator[SEP] identifier[eventChannel] operator[SEP] identifier[_set_policy_override] operator[SEP] Keyword[new] identifier[Policy] operator[SEP] operator[SEP] { identifier[p] } , identifier[org] operator[SEP] identifier[omg] operator[SEP] identifier[CORBA] operator[SEP] identifier[SetOverrideType] operator[SEP] identifier[ADD_OVERRIDE] operator[SEP] operator[SEP] }
public boolean validateChannel(final Channel channel) { boolean ret = false; final SetVarAction var = new SetVarAction(channel, "testState", "1"); ManagerResponse response = null; try { AsteriskPBX pbx = (AsteriskPBX) PBXFactory.getActivePBX(); response = pbx.sendAction(var, 500); } catch (final Exception e) { ActivityHelper.logger.debug(e, e); ActivityHelper.logger.error("getVariable: " + e); } if ((response != null) && (response.getAttribute("Response").compareToIgnoreCase("success") == 0)) { ret = true; } return ret; }
class class_name[name] begin[{] method[validateChannel, return_type[type[boolean]], modifier[public], parameter[channel]] begin[{] local_variable[type[boolean], ret] local_variable[type[SetVarAction], var] local_variable[type[ManagerResponse], response] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getActivePBX, postfix_operators=[], prefix_operators=[], qualifier=PBXFactory, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AsteriskPBX, sub_type=None)), name=pbx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AsteriskPBX, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=500)], member=sendAction, postfix_operators=[], prefix_operators=[], qualifier=pbx, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=ActivityHelper.logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getVariable: "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=ActivityHelper.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) if[binary_operation[binary_operation[member[.response], !=, literal[null]], &&, binary_operation[call[response.getAttribute, parameter[literal["Response"]]], ==, literal[0]]]] begin[{] assign[member[.ret], literal[true]] else begin[{] None end[}] return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[validateChannel] operator[SEP] Keyword[final] identifier[Channel] identifier[channel] operator[SEP] { Keyword[boolean] identifier[ret] operator[=] literal[boolean] operator[SEP] Keyword[final] identifier[SetVarAction] identifier[var] operator[=] Keyword[new] identifier[SetVarAction] operator[SEP] identifier[channel] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[ManagerResponse] identifier[response] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[AsteriskPBX] identifier[pbx] operator[=] operator[SEP] identifier[AsteriskPBX] operator[SEP] identifier[PBXFactory] operator[SEP] identifier[getActivePBX] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[=] identifier[pbx] operator[SEP] identifier[sendAction] operator[SEP] identifier[var] , Other[500] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[ActivityHelper] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[e] , identifier[e] operator[SEP] operator[SEP] identifier[ActivityHelper] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[response] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[response] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[compareToIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] { identifier[ret] operator[=] literal[boolean] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "multiPointProperty") public JAXBElement<MultiPointPropertyType> createMultiPointProperty(MultiPointPropertyType value) { return new JAXBElement<MultiPointPropertyType>(_MultiPointProperty_QNAME, MultiPointPropertyType.class, null, value); }
class class_name[name] begin[{] method[createMultiPointProperty, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_MultiPointProperty_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultiPointPropertyType, 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=MultiPointPropertyType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[MultiPointPropertyType] operator[>] identifier[createMultiPointProperty] operator[SEP] identifier[MultiPointPropertyType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[MultiPointPropertyType] operator[>] operator[SEP] identifier[_MultiPointProperty_QNAME] , identifier[MultiPointPropertyType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public static int getNumberCode(int length) {//-2147483648~2147483647 if(length > 9) new Exception("The number is too big"); Random random = new Random(); StringBuffer max = new StringBuffer().append("8"); StringBuffer min = new StringBuffer().append("1"); while (max.length() <= length - 1) { max.append("9"); min.append("0"); } int maxNumber = Integer.parseInt(max.toString()); int minNumber = Integer.parseInt(min.toString()); return random.nextInt(maxNumber) + minNumber; }
class class_name[name] begin[{] method[getNumberCode, return_type[type[int]], modifier[public static], parameter[length]] begin[{] if[binary_operation[member[.length], >, literal[9]]] begin[{] ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The number is too big")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)) else begin[{] None end[}] local_variable[type[Random], random] local_variable[type[StringBuffer], max] local_variable[type[StringBuffer], min] while[binary_operation[call[max.length, parameter[]], <=, binary_operation[member[.length], -, literal[1]]]] begin[{] call[max.append, parameter[literal["9"]]] call[min.append, parameter[literal["0"]]] end[}] local_variable[type[int], maxNumber] local_variable[type[int], minNumber] return[binary_operation[call[random.nextInt, parameter[member[.maxNumber]]], +, member[.minNumber]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[getNumberCode] operator[SEP] Keyword[int] identifier[length] operator[SEP] { Keyword[if] operator[SEP] identifier[length] operator[>] Other[9] operator[SEP] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Random] identifier[random] operator[=] Keyword[new] identifier[Random] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[max] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[min] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[max] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<=] identifier[length] operator[-] Other[1] operator[SEP] { identifier[max] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[min] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[maxNumber] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[max] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[minNumber] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[min] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] identifier[maxNumber] operator[SEP] operator[+] identifier[minNumber] operator[SEP] }
public static ModelNode getOperationAddress(final ModelNode op) { return op.hasDefined(OP_ADDR) ? op.get(OP_ADDR) : new ModelNode(); }
class class_name[name] begin[{] method[getOperationAddress, return_type[type[ModelNode]], modifier[public static], parameter[op]] begin[{] return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=OP_ADDR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasDefined, postfix_operators=[], prefix_operators=[], qualifier=op, selectors=[], type_arguments=None), if_false=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModelNode, sub_type=None)), if_true=MethodInvocation(arguments=[MemberReference(member=OP_ADDR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=op, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ModelNode] identifier[getOperationAddress] operator[SEP] Keyword[final] identifier[ModelNode] identifier[op] operator[SEP] { Keyword[return] identifier[op] operator[SEP] identifier[hasDefined] operator[SEP] identifier[OP_ADDR] operator[SEP] operator[?] identifier[op] operator[SEP] identifier[get] operator[SEP] identifier[OP_ADDR] operator[SEP] operator[:] Keyword[new] identifier[ModelNode] operator[SEP] operator[SEP] operator[SEP] }
public static byte[] calculateHmacSha1(byte[] message, int offset, int length, byte[] key) throws IllegalArgumentException { try { // get an HMAC-SHA1 key from the raw key bytes SecretKeySpec signingKey = new SecretKeySpec(key, HMAC_SHA1_ALGORITHM); // get an HMAC-SHA1 Mac instance and initialize it with the key Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM); mac.init(signingKey); // compute the hmac on input data bytes byte[] macInput = new byte[length]; System.arraycopy(message, offset, macInput, 0, length); return mac.doFinal(macInput); } catch (Exception exc) { throw new IllegalArgumentException("Could not create HMAC-SHA1 request encoding", exc); } }
class class_name[name] begin[{] method[calculateHmacSha1, return_type[type[byte]], modifier[public static], parameter[message, offset, length, key]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=HMAC_SHA1_ALGORITHM, 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=SecretKeySpec, sub_type=None)), name=signingKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SecretKeySpec, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=HMAC_SHA1_ALGORITHM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Mac, selectors=[], type_arguments=None), name=mac)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Mac, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=signingKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=mac, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=macInput)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=macInput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=macInput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doFinal, postfix_operators=[], prefix_operators=[], qualifier=mac, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not create HMAC-SHA1 request encoding"), MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exc, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[calculateHmacSha1] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[message] , Keyword[int] identifier[offset] , Keyword[int] identifier[length] , Keyword[byte] operator[SEP] operator[SEP] identifier[key] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { Keyword[try] { identifier[SecretKeySpec] identifier[signingKey] operator[=] Keyword[new] identifier[SecretKeySpec] operator[SEP] identifier[key] , identifier[HMAC_SHA1_ALGORITHM] operator[SEP] operator[SEP] identifier[Mac] identifier[mac] operator[=] identifier[Mac] operator[SEP] identifier[getInstance] operator[SEP] identifier[HMAC_SHA1_ALGORITHM] operator[SEP] operator[SEP] identifier[mac] operator[SEP] identifier[init] operator[SEP] identifier[signingKey] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[macInput] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[message] , identifier[offset] , identifier[macInput] , Other[0] , identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[mac] operator[SEP] identifier[doFinal] operator[SEP] identifier[macInput] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[exc] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] , identifier[exc] operator[SEP] operator[SEP] } }
public ActivatedRule withExcludedRules(ExcludedRule... excludedRules) { if (this.excludedRules == null) { setExcludedRules(new java.util.ArrayList<ExcludedRule>(excludedRules.length)); } for (ExcludedRule ele : excludedRules) { this.excludedRules.add(ele); } return this; }
class class_name[name] begin[{] method[withExcludedRules, return_type[type[ActivatedRule]], modifier[public], parameter[excludedRules]] begin[{] if[binary_operation[THIS[member[None.excludedRules]], ==, literal[null]]] begin[{] call[.setExcludedRules, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=excludedRules, 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=ExcludedRule, 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=excludedRules, 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=excludedRules, 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=ExcludedRule, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ActivatedRule] identifier[withExcludedRules] operator[SEP] identifier[ExcludedRule] operator[...] identifier[excludedRules] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[excludedRules] operator[==] Other[null] operator[SEP] { identifier[setExcludedRules] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ExcludedRule] operator[>] operator[SEP] identifier[excludedRules] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ExcludedRule] identifier[ele] operator[:] identifier[excludedRules] operator[SEP] { Keyword[this] operator[SEP] identifier[excludedRules] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override public int intersectionSize(Collection<? extends T> other) { if (isEmpty() || other == null || other.isEmpty()) return 0; if (this == other) return size(); if (elements instanceof List<?> && other instanceof GenericExtendedSet<?> && ((GenericExtendedSet<?>) other).elements instanceof List<?>) { int res = 0; Iterator<T> thisItr = elements.iterator(); @SuppressWarnings("unchecked") Iterator<T> otherItr = ((GenericExtendedSet<T>) other).elements.iterator(); while (thisItr.hasNext() && otherItr.hasNext()) { T thisValue = thisItr.next(); T otherValue = otherItr.next(); int r = thisValue.compareTo(otherValue); while (r != 0) { while ((r = thisValue.compareTo(otherValue)) > 0) { if (!otherItr.hasNext()) return res; otherValue = otherItr.next(); } if (r == 0) break; while ((r = otherValue.compareTo(thisValue)) > 0) { if (!thisItr.hasNext()) return res; thisValue = thisItr.next(); } } res++; } return res; } return super.intersectionSize(other); }
class class_name[name] begin[{] method[intersectionSize, return_type[type[int]], modifier[public], parameter[other]] begin[{] if[binary_operation[binary_operation[call[.isEmpty, parameter[]], ||, binary_operation[member[.other], ==, literal[null]]], ||, call[other.isEmpty, parameter[]]]] begin[{] return[literal[0]] else begin[{] None end[}] if[binary_operation[THIS[], ==, member[.other]]] begin[{] return[call[.size, parameter[]]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[member[.elements], instanceof, type[List]], &&, binary_operation[member[.other], instanceof, type[GenericExtendedSet]]], &&, binary_operation[Cast(expression=MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=GenericExtendedSet, sub_type=None)), instanceof, type[List]]]] begin[{] local_variable[type[int], res] local_variable[type[Iterator], thisItr] local_variable[type[Iterator], otherItr] while[binary_operation[call[thisItr.hasNext, parameter[]], &&, call[otherItr.hasNext, parameter[]]]] begin[{] local_variable[type[T], thisValue] local_variable[type[T], otherValue] local_variable[type[int], r] while[binary_operation[member[.r], !=, literal[0]]] begin[{] while[binary_operation[assign[member[.r], call[thisValue.compareTo, parameter[member[.otherValue]]]], >, literal[0]]] begin[{] if[call[otherItr.hasNext, parameter[]]] begin[{] return[member[.res]] else begin[{] None end[}] assign[member[.otherValue], call[otherItr.next, parameter[]]] end[}] if[binary_operation[member[.r], ==, literal[0]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] while[binary_operation[assign[member[.r], call[otherValue.compareTo, parameter[member[.thisValue]]]], >, literal[0]]] begin[{] if[call[thisItr.hasNext, parameter[]]] begin[{] return[member[.res]] else begin[{] None end[}] assign[member[.thisValue], call[thisItr.next, parameter[]]] end[}] end[}] member[.res] end[}] return[member[.res]] else begin[{] None end[}] return[SuperMethodInvocation(arguments=[MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=intersectionSize, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[intersectionSize] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[other] operator[SEP] { Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[other] operator[==] Other[null] operator[||] identifier[other] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[==] identifier[other] operator[SEP] Keyword[return] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elements] Keyword[instanceof] identifier[List] operator[<] operator[?] operator[>] operator[&&] identifier[other] Keyword[instanceof] identifier[GenericExtendedSet] operator[<] operator[?] operator[>] operator[&&] operator[SEP] operator[SEP] identifier[GenericExtendedSet] operator[<] operator[?] operator[>] operator[SEP] identifier[other] operator[SEP] operator[SEP] identifier[elements] Keyword[instanceof] identifier[List] operator[<] operator[?] operator[>] operator[SEP] { Keyword[int] identifier[res] operator[=] Other[0] operator[SEP] identifier[Iterator] operator[<] identifier[T] operator[>] identifier[thisItr] operator[=] identifier[elements] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Iterator] operator[<] identifier[T] operator[>] identifier[otherItr] operator[=] operator[SEP] operator[SEP] identifier[GenericExtendedSet] operator[<] identifier[T] operator[>] operator[SEP] identifier[other] operator[SEP] operator[SEP] identifier[elements] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[thisItr] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] identifier[otherItr] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[T] identifier[thisValue] operator[=] identifier[thisItr] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[T] identifier[otherValue] operator[=] identifier[otherItr] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[r] operator[=] identifier[thisValue] operator[SEP] identifier[compareTo] operator[SEP] identifier[otherValue] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[r] operator[!=] Other[0] operator[SEP] { Keyword[while] operator[SEP] operator[SEP] identifier[r] operator[=] identifier[thisValue] operator[SEP] identifier[compareTo] operator[SEP] identifier[otherValue] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[otherItr] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[res] operator[SEP] identifier[otherValue] operator[=] identifier[otherItr] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[r] operator[==] Other[0] operator[SEP] Keyword[break] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[r] operator[=] identifier[otherValue] operator[SEP] identifier[compareTo] operator[SEP] identifier[thisValue] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[thisItr] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[res] operator[SEP] identifier[thisValue] operator[=] identifier[thisItr] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } } identifier[res] operator[++] operator[SEP] } Keyword[return] identifier[res] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[intersectionSize] operator[SEP] identifier[other] operator[SEP] operator[SEP] }
private static int parseInt(final String str) throws BOSHException { try { return Integer.parseInt(str); } catch (NumberFormatException nfx) { throw(new BOSHException( "Could not parse an integer from the value provided: " + str, nfx)); } }
class class_name[name] begin[{] method[parseInt, return_type[type[int]], modifier[private static], parameter[str]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not parse an integer from the value provided: "), operandr=MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=nfx, 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=BOSHException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nfx, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] Keyword[int] identifier[parseInt] operator[SEP] Keyword[final] identifier[String] identifier[str] operator[SEP] Keyword[throws] identifier[BOSHException] { Keyword[try] { Keyword[return] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[str] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[nfx] operator[SEP] { Keyword[throw] operator[SEP] Keyword[new] identifier[BOSHException] operator[SEP] literal[String] operator[+] identifier[str] , identifier[nfx] operator[SEP] operator[SEP] operator[SEP] } }
private static double parseResizeWeight(String token) { if (token.equals("g") || token.equals("grow")) { return DEFAULT_GROW; } if (token.equals("n") || token.equals("nogrow") || token.equals("none")) { return NO_GROW; } // Must have format: grow(<double>) if ((token.startsWith("grow(") || token.startsWith("g(")) && token.endsWith(")")) { int leftParen = token.indexOf('('); int rightParen = token.indexOf(')'); String substring = token.substring(leftParen + 1, rightParen); return Double.parseDouble(substring); } throw new IllegalArgumentException( "The resize argument '" + token + "' is invalid. " + " Must be one of: grow, g, none, n, grow(<double>), g(<double>)"); }
class class_name[name] begin[{] method[parseResizeWeight, return_type[type[double]], modifier[private static], parameter[token]] begin[{] if[binary_operation[call[token.equals, parameter[literal["g"]]], ||, call[token.equals, parameter[literal["grow"]]]]] begin[{] return[member[.DEFAULT_GROW]] else begin[{] None end[}] if[binary_operation[binary_operation[call[token.equals, parameter[literal["n"]]], ||, call[token.equals, parameter[literal["nogrow"]]]], ||, call[token.equals, parameter[literal["none"]]]]] begin[{] return[member[.NO_GROW]] else begin[{] None end[}] if[binary_operation[binary_operation[call[token.startsWith, parameter[literal["grow("]]], ||, call[token.startsWith, parameter[literal["g("]]]], &&, call[token.endsWith, parameter[literal[")"]]]]] begin[{] local_variable[type[int], leftParen] local_variable[type[int], rightParen] local_variable[type[String], substring] return[call[Double.parseDouble, parameter[member[.substring]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The resize argument '"), operandr=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is invalid. "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Must be one of: grow, g, none, n, grow(<double>), g(<double>)"), 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) end[}] END[}]
Keyword[private] Keyword[static] Keyword[double] identifier[parseResizeWeight] operator[SEP] identifier[String] identifier[token] operator[SEP] { Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[token] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[DEFAULT_GROW] operator[SEP] } Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[token] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[token] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[NO_GROW] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[token] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[token] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[&&] identifier[token] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[int] identifier[leftParen] operator[=] identifier[token] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[rightParen] operator[=] identifier[token] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[substring] operator[=] identifier[token] operator[SEP] identifier[substring] operator[SEP] identifier[leftParen] operator[+] Other[1] , identifier[rightParen] operator[SEP] operator[SEP] Keyword[return] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[substring] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[token] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] }
@Override public EEnum getIfcGeographicElementTypeEnum() { if (ifcGeographicElementTypeEnumEEnum == null) { ifcGeographicElementTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(997); } return ifcGeographicElementTypeEnumEEnum; }
class class_name[name] begin[{] method[getIfcGeographicElementTypeEnum, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcGeographicElementTypeEnumEEnum], ==, literal[null]]] begin[{] assign[member[.ifcGeographicElementTypeEnumEEnum], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=997)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.ifcGeographicElementTypeEnumEEnum]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EEnum] identifier[getIfcGeographicElementTypeEnum] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcGeographicElementTypeEnumEEnum] operator[==] Other[null] operator[SEP] { identifier[ifcGeographicElementTypeEnumEEnum] operator[=] operator[SEP] identifier[EEnum] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[997] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcGeographicElementTypeEnumEEnum] operator[SEP] }
public void closeAllSockets() { if(transport.equalsIgnoreCase("udp")) { logger.warn("Cannot close TCP sockets on UDP connector"); return; } MBeanServer mbeanServer = getMBeanServer(); try { if(logger.isDebugEnabled()) { logger.debug("MBean Server = " + mbeanServer); } Set<ObjectName> queryNames = mbeanServer.queryNames(new ObjectName("*:type=GlobalRequestProcessor,*"), null); for(ObjectName objectName : queryNames) { if(objectName.getCanonicalName().toLowerCase().contains("sip-tcp") || objectName.getCanonicalName().toLowerCase().contains("sip-tls")) { // TODO: we may want to check the IP address if it matches this.ipAddress if(logger.isInfoEnabled()) { logger.info("Invoking closeAllTcpSockets()"); } mbeanServer.invoke(objectName, "closeAllTcpSockets", null, null); } } } catch (Exception e) { logger.error("Error closing the TCP sockets", e); } }
class class_name[name] begin[{] method[closeAllSockets, return_type[void], modifier[public], parameter[]] begin[{] if[call[transport.equalsIgnoreCase, parameter[literal["udp"]]]] begin[{] call[logger.warn, parameter[literal["Cannot close TCP sockets on UDP connector"]]] return[None] else begin[{] None end[}] local_variable[type[MBeanServer], mbeanServer] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MBean Server = "), operandr=MemberReference(member=mbeanServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*:type=GlobalRequestProcessor,*")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectName, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=queryNames, postfix_operators=[], prefix_operators=[], qualifier=mbeanServer, selectors=[], type_arguments=None), name=queryNames)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ObjectName, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=objectName, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sip-tcp")], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=objectName, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sip-tls")], member=contains, 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=[IfStatement(condition=MethodInvocation(arguments=[], member=isInfoEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invoking closeAllTcpSockets()")], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=objectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="closeAllTcpSockets"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=mbeanServer, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=queryNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=objectName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectName, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error closing the TCP sockets"), 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) end[}] END[}]
Keyword[public] Keyword[void] identifier[closeAllSockets] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[transport] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[MBeanServer] identifier[mbeanServer] operator[=] identifier[getMBeanServer] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[mbeanServer] operator[SEP] operator[SEP] } identifier[Set] operator[<] identifier[ObjectName] operator[>] identifier[queryNames] operator[=] identifier[mbeanServer] operator[SEP] identifier[queryNames] operator[SEP] Keyword[new] identifier[ObjectName] operator[SEP] literal[String] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ObjectName] identifier[objectName] operator[:] identifier[queryNames] operator[SEP] { Keyword[if] operator[SEP] identifier[objectName] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[||] identifier[objectName] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[mbeanServer] operator[SEP] identifier[invoke] operator[SEP] identifier[objectName] , literal[String] , Other[null] , Other[null] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public static byte[] decryptAsBytes(final byte[] encryptedIvTextBytes) throws Exception { final SecretKey secretKey = KeyManager.getInstance().getSecretKey(); return decryptAsBytes(secretKey, encryptedIvTextBytes); }
class class_name[name] begin[{] method[decryptAsBytes, return_type[type[byte]], modifier[public static], parameter[encryptedIvTextBytes]] begin[{] local_variable[type[SecretKey], secretKey] return[call[.decryptAsBytes, parameter[member[.secretKey], member[.encryptedIvTextBytes]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[decryptAsBytes] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[encryptedIvTextBytes] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[final] identifier[SecretKey] identifier[secretKey] operator[=] identifier[KeyManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getSecretKey] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[decryptAsBytes] operator[SEP] identifier[secretKey] , identifier[encryptedIvTextBytes] operator[SEP] operator[SEP] }
public List<PeerInfo> peerInfo() { if (!th.is_valid()) { return new ArrayList<>(); } peer_info_vector v = new peer_info_vector(); th.get_peer_info(v); int size = (int) v.size(); ArrayList<PeerInfo> l = new ArrayList<>(size); for (int i = 0; i < size; i++) { l.add(new PeerInfo(v.get(i))); } return l; }
class class_name[name] begin[{] method[peerInfo, return_type[type[List]], modifier[public], parameter[]] begin[{] if[call[th.is_valid, parameter[]]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] local_variable[type[peer_info_vector], v] call[th.get_peer_info, parameter[member[.v]]] local_variable[type[int], size] local_variable[type[ArrayList], l] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PeerInfo, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.l]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[PeerInfo] operator[>] identifier[peerInfo] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[th] operator[SEP] identifier[is_valid] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[peer_info_vector] identifier[v] operator[=] Keyword[new] identifier[peer_info_vector] operator[SEP] operator[SEP] operator[SEP] identifier[th] operator[SEP] identifier[get_peer_info] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[v] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[PeerInfo] operator[>] identifier[l] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[l] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[PeerInfo] operator[SEP] identifier[v] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[l] operator[SEP] }
public static boolean isCompositeComponentExpression(String expression) { if (expression.contains(CC)) { return CC_EXPRESSION_REGEX.matcher(expression).matches(); } else { return false; } }
class class_name[name] begin[{] method[isCompositeComponentExpression, return_type[type[boolean]], modifier[public static], parameter[expression]] begin[{] if[call[expression.contains, parameter[member[.CC]]]] begin[{] return[call[CC_EXPRESSION_REGEX.matcher, parameter[member[.expression]]]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isCompositeComponentExpression] operator[SEP] identifier[String] identifier[expression] operator[SEP] { Keyword[if] operator[SEP] identifier[expression] operator[SEP] identifier[contains] operator[SEP] identifier[CC] operator[SEP] operator[SEP] { Keyword[return] identifier[CC_EXPRESSION_REGEX] operator[SEP] identifier[matcher] operator[SEP] identifier[expression] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
public void put(Set<HBeanRow> rows) { final List<Row> create = new ArrayList<>(); try { for (HBeanRow row : rows) { final Put write = new Put(row.getRowKey()); if (row.getPropertiesKeyValue() != null) { write.add(row.getPropertiesKeyValue()); } for (KeyValue kv : row.getPredecessors()) { write.add(kv); } for (KeyValue kv : row.getReferencesKeyValue().values()) { write.add(kv); } KeyValue hBean = row.getHBeanKeyValue(); write.add(hBean); if (row.isSingleton()) { write.add(new KeyValue(row.getRowKey(), HBeanRow.SINGLETON_COLUMN_FAMILY, HBeanRow.SINGLETON_COLUMN_FAMILY, new byte[] { 1 })); } // hbase cannot have rowkeys without columns so we need // a dummy value to represent beans without any values write.add(new KeyValue(row.getRowKey(), HBeanRow.DUMMY_COLUMN_FAMILY, HBeanRow.DUMMY_COLUMN_FAMILY, new byte[] { 1 })); create.add(write); } table.batch(create); table.flushCommits(); } catch (Exception e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[put, return_type[void], modifier[public], parameter[rows]] begin[{] local_variable[type[List], create] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getRowKey, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Put, sub_type=None)), name=write)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Put, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPropertiesKeyValue, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPropertiesKeyValue, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=write, selectors=[], type_arguments=None), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=write, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPredecessors, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=kv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KeyValue, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=write, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getReferencesKeyValue, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[MethodInvocation(arguments=[], member=values, 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=kv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KeyValue, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getHBeanKeyValue, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), name=hBean)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KeyValue, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=hBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=write, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isSingleton, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getRowKey, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), MemberReference(member=SINGLETON_COLUMN_FAMILY, postfix_operators=[], prefix_operators=[], qualifier=HBeanRow, selectors=[]), MemberReference(member=SINGLETON_COLUMN_FAMILY, postfix_operators=[], prefix_operators=[], qualifier=HBeanRow, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KeyValue, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=write, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getRowKey, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), MemberReference(member=DUMMY_COLUMN_FAMILY, postfix_operators=[], prefix_operators=[], qualifier=HBeanRow, selectors=[]), MemberReference(member=DUMMY_COLUMN_FAMILY, postfix_operators=[], prefix_operators=[], qualifier=HBeanRow, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KeyValue, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=write, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=write, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=create, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HBeanRow, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=create, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=batch, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flushCommits, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[put] operator[SEP] identifier[Set] operator[<] identifier[HBeanRow] operator[>] identifier[rows] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[Row] operator[>] identifier[create] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[HBeanRow] identifier[row] operator[:] identifier[rows] operator[SEP] { Keyword[final] identifier[Put] identifier[write] operator[=] Keyword[new] identifier[Put] operator[SEP] identifier[row] operator[SEP] identifier[getRowKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[row] operator[SEP] identifier[getPropertiesKeyValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[write] operator[SEP] identifier[add] operator[SEP] identifier[row] operator[SEP] identifier[getPropertiesKeyValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[KeyValue] identifier[kv] operator[:] identifier[row] operator[SEP] identifier[getPredecessors] operator[SEP] operator[SEP] operator[SEP] { identifier[write] operator[SEP] identifier[add] operator[SEP] identifier[kv] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[KeyValue] identifier[kv] operator[:] identifier[row] operator[SEP] identifier[getReferencesKeyValue] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[write] operator[SEP] identifier[add] operator[SEP] identifier[kv] operator[SEP] operator[SEP] } identifier[KeyValue] identifier[hBean] operator[=] identifier[row] operator[SEP] identifier[getHBeanKeyValue] operator[SEP] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[add] operator[SEP] identifier[hBean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[row] operator[SEP] identifier[isSingleton] operator[SEP] operator[SEP] operator[SEP] { identifier[write] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[KeyValue] operator[SEP] identifier[row] operator[SEP] identifier[getRowKey] operator[SEP] operator[SEP] , identifier[HBeanRow] operator[SEP] identifier[SINGLETON_COLUMN_FAMILY] , identifier[HBeanRow] operator[SEP] identifier[SINGLETON_COLUMN_FAMILY] , Keyword[new] Keyword[byte] operator[SEP] operator[SEP] { Other[1] } operator[SEP] operator[SEP] operator[SEP] } identifier[write] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[KeyValue] operator[SEP] identifier[row] operator[SEP] identifier[getRowKey] operator[SEP] operator[SEP] , identifier[HBeanRow] operator[SEP] identifier[DUMMY_COLUMN_FAMILY] , identifier[HBeanRow] operator[SEP] identifier[DUMMY_COLUMN_FAMILY] , Keyword[new] Keyword[byte] operator[SEP] operator[SEP] { Other[1] } operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[add] operator[SEP] identifier[write] operator[SEP] operator[SEP] } identifier[table] operator[SEP] identifier[batch] operator[SEP] identifier[create] operator[SEP] operator[SEP] identifier[table] operator[SEP] identifier[flushCommits] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static int[] compact (int[] list) { int llength = list.length, lcount = 0; // count up the non-zero entries for (int i = 0; i < llength; i++) { if (list[i] != 0) { lcount++; } } int[] nlist = new int[lcount]; int n = 0; for (int i = 0; i < llength; i++) { if (list[i] != 0) { nlist[n++] = list[i]; } } return nlist; }
class class_name[name] begin[{] method[compact, return_type[type[int]], modifier[public static], parameter[list]] begin[{] local_variable[type[int], llength] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=lcount, 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=llength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[int], nlist] local_variable[type[int], n] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nlist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=n, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=llength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.nlist]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] operator[SEP] operator[SEP] identifier[compact] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[list] operator[SEP] { Keyword[int] identifier[llength] operator[=] identifier[list] operator[SEP] identifier[length] , identifier[lcount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[llength] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[lcount] operator[++] operator[SEP] } } Keyword[int] operator[SEP] operator[SEP] identifier[nlist] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[lcount] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[llength] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[nlist] operator[SEP] identifier[n] operator[++] operator[SEP] operator[=] identifier[list] operator[SEP] identifier[i] operator[SEP] operator[SEP] } } Keyword[return] identifier[nlist] operator[SEP] }
public static void validateCnn1DKernelStridePadding(int kernel, int stride, int padding) { if (kernel <= 0) { throw new IllegalStateException("Invalid kernel size: value must be positive (> 0). Got: " + kernel); } if (stride <= 0) { throw new IllegalStateException("Invalid kernel size: value must be positive (> 0). Got: " + stride); } if (padding < 0) { throw new IllegalStateException("Invalid kernel size: value must be positive (> 0). Got: " + padding); } }
class class_name[name] begin[{] method[validateCnn1DKernelStridePadding, return_type[void], modifier[public static], parameter[kernel, stride, padding]] begin[{] if[binary_operation[member[.kernel], <=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid kernel size: value must be positive (> 0). Got: "), operandr=MemberReference(member=kernel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.stride], <=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid kernel size: value must be positive (> 0). Got: "), operandr=MemberReference(member=stride, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.padding], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid kernel size: value must be positive (> 0). Got: "), operandr=MemberReference(member=padding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[validateCnn1DKernelStridePadding] operator[SEP] Keyword[int] identifier[kernel] , Keyword[int] identifier[stride] , Keyword[int] identifier[padding] operator[SEP] { Keyword[if] operator[SEP] identifier[kernel] operator[<=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[kernel] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[stride] operator[<=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[stride] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[padding] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[padding] operator[SEP] operator[SEP] } }
private void shiftBufData() { if (bufRead != buf.limit()) { throw new IllegalStateException("bufRead should be same as " + "buf.limit()"); } //shift the remaining data on buf to the front if (buf.position() > 0) { int dataLeft = buf.remaining(); if (dataLeft > 0) { byte[] b = buf.array(); System.arraycopy(b, buf.position(), b, 0, dataLeft); } buf.position(0); bufRead = dataLeft; buf.limit(bufRead); } }
class class_name[name] begin[{] method[shiftBufData, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[member[.bufRead], !=, call[buf.limit, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bufRead should be same as "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="buf.limit()"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[call[buf.position, parameter[]], >, literal[0]]] begin[{] local_variable[type[int], dataLeft] if[binary_operation[member[.dataLeft], >, literal[0]]] begin[{] local_variable[type[byte], b] call[System.arraycopy, parameter[member[.b], call[buf.position, parameter[]], member[.b], literal[0], member[.dataLeft]]] else begin[{] None end[}] call[buf.position, parameter[literal[0]]] assign[member[.bufRead], member[.dataLeft]] call[buf.limit, parameter[member[.bufRead]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[shiftBufData] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[bufRead] operator[!=] identifier[buf] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[buf] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[dataLeft] operator[=] identifier[buf] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dataLeft] operator[>] Other[0] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[buf] operator[SEP] identifier[array] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[b] , identifier[buf] operator[SEP] identifier[position] operator[SEP] operator[SEP] , identifier[b] , Other[0] , identifier[dataLeft] operator[SEP] operator[SEP] } identifier[buf] operator[SEP] identifier[position] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[bufRead] operator[=] identifier[dataLeft] operator[SEP] identifier[buf] operator[SEP] identifier[limit] operator[SEP] identifier[bufRead] operator[SEP] operator[SEP] } }
private static List<Integer> parseRange(String range, int max) { List<Integer> idx = new ArrayList<Integer>(); String[] n = range.split(","); for (String s : n) { String[] d = s.split("-"); int mi = Integer.parseInt(d[0]); if (mi < 0 || mi >= max) { throw new IllegalArgumentException(range); } if (d.length == 2) { if (d[1].equals("*")) { d[1] = Integer.toString(max - 1); } int ma = Integer.parseInt(d[1]); if (ma <= mi || ma >= max || ma < 0) { throw new IllegalArgumentException(range); } for (int i = mi; i <= ma; i++) { idx.add(i); } } else { idx.add(mi); } } return idx; }
class class_name[name] begin[{] method[parseRange, return_type[type[List]], modifier[private static], parameter[range, max]] begin[{] local_variable[type[List], idx] local_variable[type[String], n] 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=s, selectors=[], type_arguments=None), name=d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=mi)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=mi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=range, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=idx, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=ma)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ma, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operandr=BinaryOperation(operandl=MemberReference(member=ma, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=ma, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=range, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=idx, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ma, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=mi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=n, 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) return[member[.idx]] end[}] END[}]
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[Integer] operator[>] identifier[parseRange] operator[SEP] identifier[String] identifier[range] , Keyword[int] identifier[max] operator[SEP] { identifier[List] operator[<] identifier[Integer] operator[>] identifier[idx] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[n] operator[=] identifier[range] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[n] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[d] operator[=] identifier[s] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[mi] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[d] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mi] operator[<] Other[0] operator[||] identifier[mi] operator[>=] identifier[max] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[range] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[d] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] { Keyword[if] operator[SEP] identifier[d] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[d] operator[SEP] Other[1] operator[SEP] operator[=] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[max] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[int] identifier[ma] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[d] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ma] operator[<=] identifier[mi] operator[||] identifier[ma] operator[>=] identifier[max] operator[||] identifier[ma] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[range] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[mi] operator[SEP] identifier[i] operator[<=] identifier[ma] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[idx] operator[SEP] identifier[add] operator[SEP] identifier[i] operator[SEP] operator[SEP] } } Keyword[else] { identifier[idx] operator[SEP] identifier[add] operator[SEP] identifier[mi] operator[SEP] operator[SEP] } } Keyword[return] identifier[idx] operator[SEP] }
private static Type[] getImplicitUpperBounds(final WildcardType wildcardType) { Assert.requireNonNull(wildcardType, "wildcardType"); final Type[] bounds = wildcardType.getUpperBounds(); return bounds.length == 0 ? new Type[]{Object.class} : normalizeUpperBounds(bounds); }
class class_name[name] begin[{] method[getImplicitUpperBounds, return_type[type[Type]], modifier[private static], parameter[wildcardType]] begin[{] call[Assert.requireNonNull, parameter[member[.wildcardType], literal["wildcardType"]]] local_variable[type[Type], bounds] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bounds, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=bounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=normalizeUpperBounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Type, sub_type=None)))] end[}] END[}]
Keyword[private] Keyword[static] identifier[Type] operator[SEP] operator[SEP] identifier[getImplicitUpperBounds] operator[SEP] Keyword[final] identifier[WildcardType] identifier[wildcardType] operator[SEP] { identifier[Assert] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[wildcardType] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Type] operator[SEP] operator[SEP] identifier[bounds] operator[=] identifier[wildcardType] operator[SEP] identifier[getUpperBounds] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[bounds] operator[SEP] identifier[length] operator[==] Other[0] operator[?] Keyword[new] identifier[Type] operator[SEP] operator[SEP] { identifier[Object] operator[SEP] Keyword[class] } operator[:] identifier[normalizeUpperBounds] operator[SEP] identifier[bounds] operator[SEP] operator[SEP] }
private <T extends Request, U> void sendRequest(T request, BiFunction<Request, Connection, CompletableFuture<U>> sender, CompletableFuture<U> future) { if (open) { connect().whenComplete((c, e) -> sendRequest(request, sender, c, e, future)); } }
class class_name[name] begin[{] method[sendRequest, return_type[void], modifier[private], parameter[request, sender, future]] begin[{] if[member[.open]] begin[{] call[.connect, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[private] operator[<] identifier[T] Keyword[extends] identifier[Request] , identifier[U] operator[>] Keyword[void] identifier[sendRequest] operator[SEP] identifier[T] identifier[request] , identifier[BiFunction] operator[<] identifier[Request] , identifier[Connection] , identifier[CompletableFuture] operator[<] identifier[U] operator[>] operator[>] identifier[sender] , identifier[CompletableFuture] operator[<] identifier[U] operator[>] identifier[future] operator[SEP] { Keyword[if] operator[SEP] identifier[open] operator[SEP] { identifier[connect] operator[SEP] operator[SEP] operator[SEP] identifier[whenComplete] operator[SEP] operator[SEP] identifier[c] , identifier[e] operator[SEP] operator[->] identifier[sendRequest] operator[SEP] identifier[request] , identifier[sender] , identifier[c] , identifier[e] , identifier[future] operator[SEP] operator[SEP] operator[SEP] } }
public static Object toBean( JSONObject jsonObject, Object root, JsonConfig jsonConfig ) { if( jsonObject == null || jsonObject.isNullObject() || root == null ){ return root; } Class rootClass = root.getClass(); if( rootClass.isInterface() ){ throw new JSONException( "Root bean is an interface. " + rootClass ); } Map classMap = jsonConfig.getClassMap(); if( classMap == null ){ classMap = Collections.EMPTY_MAP; } Map props = JSONUtils.getProperties( jsonObject ); PropertyFilter javaPropertyFilter = jsonConfig.getJavaPropertyFilter(); for( Iterator entries = jsonObject.names( jsonConfig ) .iterator(); entries.hasNext(); ){ String name = (String) entries.next(); Class type = (Class) props.get( name ); Object value = jsonObject.get( name ); if( javaPropertyFilter != null && javaPropertyFilter.apply( root, name, value ) ){ continue; } String key = JSONUtils.convertToJavaIdentifier( name, jsonConfig ); try{ PropertyDescriptor pd = PropertyUtils.getPropertyDescriptor( root, key ); if( pd != null && pd.getWriteMethod() == null ){ log.info( "Property '" + key + "' of "+ root.getClass()+" has no write method. SKIPPED." ); continue; } if( !JSONUtils.isNull( value ) ){ if( value instanceof JSONArray ){ if( pd == null || List.class.isAssignableFrom( pd.getPropertyType() ) ){ Class targetClass = resolveClass(classMap, key, name, type); Object newRoot = jsonConfig.getNewBeanInstanceStrategy() .newInstance( targetClass, null ); List list = JSONArray.toList( (JSONArray) value, newRoot, jsonConfig ); setProperty( root, key, list, jsonConfig ); }else{ Class innerType = JSONUtils.getInnerComponentType( pd.getPropertyType() ); Class targetInnerType = findTargetClass( key, classMap ); if( innerType.equals( Object.class ) && targetInnerType != null && !targetInnerType.equals( Object.class ) ){ innerType = targetInnerType; } Object newRoot = jsonConfig.getNewBeanInstanceStrategy() .newInstance( innerType, null ); Object array = JSONArray.toArray( (JSONArray) value, newRoot, jsonConfig ); if( innerType.isPrimitive() || JSONUtils.isNumber( innerType ) || Boolean.class.isAssignableFrom( innerType ) || JSONUtils.isString( innerType ) ){ array = JSONUtils.getMorpherRegistry() .morph( Array.newInstance( innerType, 0 ) .getClass(), array ); }else if( !array.getClass() .equals( pd.getPropertyType() ) ){ if( !pd.getPropertyType() .equals( Object.class ) ){ Morpher morpher = JSONUtils.getMorpherRegistry() .getMorpherFor( Array.newInstance( innerType, 0 ) .getClass() ); if( IdentityObjectMorpher.getInstance() .equals( morpher ) ){ ObjectArrayMorpher beanMorpher = new ObjectArrayMorpher( new BeanMorpher( innerType, JSONUtils.getMorpherRegistry() ) ); JSONUtils.getMorpherRegistry() .registerMorpher( beanMorpher ); } array = JSONUtils.getMorpherRegistry() .morph( Array.newInstance( innerType, 0 ) .getClass(), array ); } } setProperty( root, key, array, jsonConfig ); } }else if( String.class.isAssignableFrom( type ) || JSONUtils.isBoolean( type ) || JSONUtils.isNumber( type ) || JSONUtils.isString( type ) || JSONFunction.class.isAssignableFrom( type ) ){ if( pd != null ){ if( jsonConfig.isHandleJettisonEmptyElement() && "".equals( value ) ){ setProperty( root, key, null, jsonConfig ); }else if( !pd.getPropertyType() .isInstance( value ) ){ Morpher morpher = JSONUtils.getMorpherRegistry() .getMorpherFor( pd.getPropertyType() ); if( IdentityObjectMorpher.getInstance() .equals( morpher ) ){ log.warn( "Can't transform property '" + key + "' from " + type.getName() + " into " + pd.getPropertyType() .getName() + ". Will register a default BeanMorpher" ); JSONUtils.getMorpherRegistry() .registerMorpher( new BeanMorpher( pd.getPropertyType(), JSONUtils.getMorpherRegistry() ) ); } setProperty( root, key, JSONUtils.getMorpherRegistry() .morph( pd.getPropertyType(), value ), jsonConfig ); }else{ setProperty( root, key, value, jsonConfig ); } }else if( root instanceof Map ){ setProperty( root, key, value, jsonConfig ); }else{ log.warn( "Tried to assign property " + key + ":" + type.getName() + " to bean of class " + root.getClass() .getName() ); } }else{ if( pd != null ){ Class targetClass = pd.getPropertyType(); if( jsonConfig.isHandleJettisonSingleElementArray() ){ JSONArray array = new JSONArray().element( value, jsonConfig ); Class newTargetClass = resolveClass(classMap, key, name, type); Object newRoot = jsonConfig.getNewBeanInstanceStrategy() .newInstance( newTargetClass, (JSONObject) value ); if( targetClass.isArray() ){ setProperty( root, key, JSONArray.toArray( array, newRoot, jsonConfig ), jsonConfig ); }else if( Collection.class.isAssignableFrom( targetClass ) ){ setProperty( root, key, JSONArray.toList( array, newRoot, jsonConfig ), jsonConfig ); }else if( JSONArray.class.isAssignableFrom( targetClass ) ){ setProperty( root, key, array, jsonConfig ); }else{ setProperty( root, key, toBean( (JSONObject) value, newRoot, jsonConfig ), jsonConfig ); } }else{ if( targetClass == Object.class ){ targetClass = resolveClass(classMap, key, name, type); if(targetClass == null) { targetClass = Object.class; } } Object newRoot = jsonConfig.getNewBeanInstanceStrategy() .newInstance( targetClass, (JSONObject) value ); setProperty( root, key, toBean( (JSONObject) value, newRoot, jsonConfig ), jsonConfig ); } }else if( root instanceof Map ){ Class targetClass = findTargetClass( key, classMap ); targetClass = targetClass == null ? findTargetClass( name, classMap ) : targetClass; Object newRoot = jsonConfig.getNewBeanInstanceStrategy() .newInstance( targetClass, (JSONObject) value ); setProperty( root, key, toBean( (JSONObject) value, newRoot, jsonConfig ), jsonConfig ); }else{ log.warn( "Tried to assign property " + key + ":" + type.getName() + " to bean of class " + rootClass.getName() ); } } }else{ if( type.isPrimitive() ){ // assume assigned default value log.warn( "Tried to assign null value to " + key + ":" + type.getName() ); setProperty( root, key, JSONUtils.getMorpherRegistry() .morph( type, null ), jsonConfig ); }else{ setProperty( root, key, null, jsonConfig ); } } }catch( JSONException jsone ){ throw jsone; }catch( Exception e ){ throw new JSONException( "Error while setting property=" + name + " type " + type, e ); } } return root; }
class class_name[name] begin[{] method[toBean, return_type[type[Object]], modifier[public static], parameter[jsonObject, root, jsonConfig]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.jsonObject], ==, literal[null]], ||, call[jsonObject.isNullObject, parameter[]]], ||, binary_operation[member[.root], ==, literal[null]]]] begin[{] return[member[.root]] else begin[{] None end[}] local_variable[type[Class], rootClass] if[call[rootClass.isInterface, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Root bean is an interface. "), operandr=MemberReference(member=rootClass, 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=JSONException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Map], classMap] if[binary_operation[member[.classMap], ==, literal[null]]] begin[{] assign[member[.classMap], member[Collections.EMPTY_MAP]] else begin[{] None end[}] local_variable[type[Map], props] local_variable[type[PropertyFilter], javaPropertyFilter] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=entries, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=jsonObject, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=javaPropertyFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=javaPropertyFilter, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertToJavaIdentifier, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPropertyDescriptor, postfix_operators=[], prefix_operators=[], qualifier=PropertyUtils, selectors=[], type_arguments=None), name=pd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getWriteMethod, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Property '"), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' of "), operator=+), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has no write method. SKIPPED."), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNull, postfix_operators=[], prefix_operators=['!'], qualifier=JSONUtils, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isPrimitive, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Tried to assign null value to "), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMorpherRegistry, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=morph, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JSONArray, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), operandr=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBoolean, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNumber, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isString, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[], type_arguments=None), operator=||), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JSONFunction, sub_type=None)), operator=||), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pd, 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=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Tried to assign property "), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to bean of class "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=rootClass, selectors=[], type_arguments=None), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findTargetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=targetClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findTargetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNewBeanInstanceStrategy, postfix_operators=[], prefix_operators=[], qualifier=jsonConfig, selectors=[MethodInvocation(arguments=[MemberReference(member=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None))], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=newRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None)), MemberReference(member=newRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None), name=targetClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isHandleJettisonSingleElementArray, postfix_operators=[], prefix_operators=[], qualifier=jsonConfig, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=classMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=targetClass, 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=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNewBeanInstanceStrategy, postfix_operators=[], prefix_operators=[], qualifier=jsonConfig, selectors=[MethodInvocation(arguments=[MemberReference(member=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None))], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=newRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None)), MemberReference(member=newRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=element, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JSONArray, sub_type=None)), name=array)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSONArray, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=classMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=newTargetClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNewBeanInstanceStrategy, postfix_operators=[], prefix_operators=[], qualifier=jsonConfig, selectors=[MethodInvocation(arguments=[MemberReference(member=newTargetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None))], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=newRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isArray, postfix_operators=[], prefix_operators=[], qualifier=targetClass, selectors=[], type_arguments=None), else_statement=IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Collection, sub_type=None)), else_statement=IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JSONArray, sub_type=None)), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None)), MemberReference(member=newRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toList, postfix_operators=[], prefix_operators=[], qualifier=JSONArray, selectors=[], type_arguments=None), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=JSONArray, selectors=[], type_arguments=None), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pd, 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=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Tried to assign property "), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to bean of class "), operator=+), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isHandleJettisonEmptyElement, postfix_operators=[], prefix_operators=[], qualifier=jsonConfig, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operator=&&), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=['!'], qualifier=pd, selectors=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMorpherRegistry, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None)], member=getMorpherFor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=morpher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Morpher, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=IdentityObjectMorpher, selectors=[MethodInvocation(arguments=[MemberReference(member=morpher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't transform property '"), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' from "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" into "), operator=+), operandr=MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Will register a default BeanMorpher"), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getMorpherRegistry, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMorpherRegistry, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BeanMorpher, sub_type=None))], member=registerMorpher, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMorpherRegistry, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=morph, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=List, sub_type=None)), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None)], member=getInnerComponentType, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[], type_arguments=None), name=innerType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findTargetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=targetInnerType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=innerType, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=targetInnerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), operandr=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=targetInnerType, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=innerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=targetInnerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNewBeanInstanceStrategy, postfix_operators=[], prefix_operators=[], qualifier=jsonConfig, selectors=[MethodInvocation(arguments=[MemberReference(member=innerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=newRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONArray, sub_type=None)), MemberReference(member=newRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=JSONArray, selectors=[], type_arguments=None), name=array)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isPrimitive, postfix_operators=[], prefix_operators=[], qualifier=innerType, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=innerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNumber, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[], type_arguments=None), operator=||), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=innerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None)), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=innerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isString, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[], type_arguments=None), operator=||), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=['!'], qualifier=array, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=[], qualifier=pd, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=['!'], qualifier=pd, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMorpherRegistry, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=innerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=Array, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getMorpherFor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=morpher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Morpher, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=IdentityObjectMorpher, selectors=[MethodInvocation(arguments=[MemberReference(member=morpher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=innerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMorpherRegistry, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BeanMorpher, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectArrayMorpher, sub_type=None)), name=beanMorpher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectArrayMorpher, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getMorpherRegistry, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[MethodInvocation(arguments=[MemberReference(member=beanMorpher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerMorpher, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getMorpherRegistry, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=innerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=Array, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=morph, 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=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getMorpherRegistry, postfix_operators=[], prefix_operators=[], qualifier=JSONUtils, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=innerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=Array, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=morph, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=classMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=targetClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNewBeanInstanceStrategy, postfix_operators=[], prefix_operators=[], qualifier=jsonConfig, selectors=[MethodInvocation(arguments=[MemberReference(member=targetClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=newRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JSONArray, sub_type=None)), MemberReference(member=newRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toList, postfix_operators=[], prefix_operators=[], qualifier=JSONArray, selectors=[], type_arguments=None), name=list)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))]))], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=jsone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=jsone, types=['JSONException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while setting property="), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" type "), operator=+), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=entries, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[MemberReference(member=jsonConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=names, postfix_operators=[], prefix_operators=[], qualifier=jsonObject, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=entries)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) return[member[.root]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[toBean] operator[SEP] identifier[JSONObject] identifier[jsonObject] , identifier[Object] identifier[root] , identifier[JsonConfig] identifier[jsonConfig] operator[SEP] { Keyword[if] operator[SEP] identifier[jsonObject] operator[==] Other[null] operator[||] identifier[jsonObject] operator[SEP] identifier[isNullObject] operator[SEP] operator[SEP] operator[||] identifier[root] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[root] operator[SEP] } identifier[Class] identifier[rootClass] operator[=] identifier[root] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rootClass] operator[SEP] identifier[isInterface] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[JSONException] operator[SEP] literal[String] operator[+] identifier[rootClass] operator[SEP] operator[SEP] } identifier[Map] identifier[classMap] operator[=] identifier[jsonConfig] operator[SEP] identifier[getClassMap] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[classMap] operator[==] Other[null] operator[SEP] { identifier[classMap] operator[=] identifier[Collections] operator[SEP] identifier[EMPTY_MAP] operator[SEP] } identifier[Map] identifier[props] operator[=] identifier[JSONUtils] operator[SEP] identifier[getProperties] operator[SEP] identifier[jsonObject] operator[SEP] operator[SEP] identifier[PropertyFilter] identifier[javaPropertyFilter] operator[=] identifier[jsonConfig] operator[SEP] identifier[getJavaPropertyFilter] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] identifier[entries] operator[=] identifier[jsonObject] operator[SEP] identifier[names] operator[SEP] identifier[jsonConfig] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[entries] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[entries] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Class] identifier[type] operator[=] operator[SEP] identifier[Class] operator[SEP] identifier[props] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[=] identifier[jsonObject] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[javaPropertyFilter] operator[!=] Other[null] operator[&&] identifier[javaPropertyFilter] operator[SEP] identifier[apply] operator[SEP] identifier[root] , identifier[name] , identifier[value] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[String] identifier[key] operator[=] identifier[JSONUtils] operator[SEP] identifier[convertToJavaIdentifier] operator[SEP] identifier[name] , identifier[jsonConfig] operator[SEP] operator[SEP] Keyword[try] { identifier[PropertyDescriptor] identifier[pd] operator[=] identifier[PropertyUtils] operator[SEP] identifier[getPropertyDescriptor] operator[SEP] identifier[root] , identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pd] operator[!=] Other[null] operator[&&] identifier[pd] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[root] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[JSONUtils] operator[SEP] identifier[isNull] operator[SEP] identifier[value] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[JSONArray] operator[SEP] { Keyword[if] operator[SEP] identifier[pd] operator[==] Other[null] operator[||] identifier[List] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[pd] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Class] identifier[targetClass] operator[=] identifier[resolveClass] operator[SEP] identifier[classMap] , identifier[key] , identifier[name] , identifier[type] operator[SEP] operator[SEP] identifier[Object] identifier[newRoot] operator[=] identifier[jsonConfig] operator[SEP] identifier[getNewBeanInstanceStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[targetClass] , Other[null] operator[SEP] operator[SEP] identifier[List] identifier[list] operator[=] identifier[JSONArray] operator[SEP] identifier[toList] operator[SEP] operator[SEP] identifier[JSONArray] operator[SEP] identifier[value] , identifier[newRoot] , identifier[jsonConfig] operator[SEP] operator[SEP] identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[list] , identifier[jsonConfig] operator[SEP] operator[SEP] } Keyword[else] { identifier[Class] identifier[innerType] operator[=] identifier[JSONUtils] operator[SEP] identifier[getInnerComponentType] operator[SEP] identifier[pd] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Class] identifier[targetInnerType] operator[=] identifier[findTargetClass] operator[SEP] identifier[key] , identifier[classMap] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[innerType] operator[SEP] identifier[equals] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[&&] identifier[targetInnerType] operator[!=] Other[null] operator[&&] operator[!] identifier[targetInnerType] operator[SEP] identifier[equals] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[innerType] operator[=] identifier[targetInnerType] operator[SEP] } identifier[Object] identifier[newRoot] operator[=] identifier[jsonConfig] operator[SEP] identifier[getNewBeanInstanceStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[innerType] , Other[null] operator[SEP] operator[SEP] identifier[Object] identifier[array] operator[=] identifier[JSONArray] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] identifier[JSONArray] operator[SEP] identifier[value] , identifier[newRoot] , identifier[jsonConfig] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[innerType] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[||] identifier[JSONUtils] operator[SEP] identifier[isNumber] operator[SEP] identifier[innerType] operator[SEP] operator[||] identifier[Boolean] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[innerType] operator[SEP] operator[||] identifier[JSONUtils] operator[SEP] identifier[isString] operator[SEP] identifier[innerType] operator[SEP] operator[SEP] { identifier[array] operator[=] identifier[JSONUtils] operator[SEP] identifier[getMorpherRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[morph] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[innerType] , Other[0] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[array] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[array] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[pd] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[pd] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[Morpher] identifier[morpher] operator[=] identifier[JSONUtils] operator[SEP] identifier[getMorpherRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[getMorpherFor] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[innerType] , Other[0] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[IdentityObjectMorpher] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[morpher] operator[SEP] operator[SEP] { identifier[ObjectArrayMorpher] identifier[beanMorpher] operator[=] Keyword[new] identifier[ObjectArrayMorpher] operator[SEP] Keyword[new] identifier[BeanMorpher] operator[SEP] identifier[innerType] , identifier[JSONUtils] operator[SEP] identifier[getMorpherRegistry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[JSONUtils] operator[SEP] identifier[getMorpherRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[registerMorpher] operator[SEP] identifier[beanMorpher] operator[SEP] operator[SEP] } identifier[array] operator[=] identifier[JSONUtils] operator[SEP] identifier[getMorpherRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[morph] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[innerType] , Other[0] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[array] operator[SEP] operator[SEP] } } identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[array] , identifier[jsonConfig] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[type] operator[SEP] operator[||] identifier[JSONUtils] operator[SEP] identifier[isBoolean] operator[SEP] identifier[type] operator[SEP] operator[||] identifier[JSONUtils] operator[SEP] identifier[isNumber] operator[SEP] identifier[type] operator[SEP] operator[||] identifier[JSONUtils] operator[SEP] identifier[isString] operator[SEP] identifier[type] operator[SEP] operator[||] identifier[JSONFunction] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[type] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[pd] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[jsonConfig] operator[SEP] identifier[isHandleJettisonEmptyElement] operator[SEP] operator[SEP] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[value] operator[SEP] operator[SEP] { identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , Other[null] , identifier[jsonConfig] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[pd] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] identifier[isInstance] operator[SEP] identifier[value] operator[SEP] operator[SEP] { identifier[Morpher] identifier[morpher] operator[=] identifier[JSONUtils] operator[SEP] identifier[getMorpherRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[getMorpherFor] operator[SEP] identifier[pd] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[IdentityObjectMorpher] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[morpher] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[pd] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[JSONUtils] operator[SEP] identifier[getMorpherRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[registerMorpher] operator[SEP] Keyword[new] identifier[BeanMorpher] operator[SEP] identifier[pd] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] , identifier[JSONUtils] operator[SEP] identifier[getMorpherRegistry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[JSONUtils] operator[SEP] identifier[getMorpherRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[morph] operator[SEP] identifier[pd] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] , identifier[value] operator[SEP] , identifier[jsonConfig] operator[SEP] operator[SEP] } Keyword[else] { identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[value] , identifier[jsonConfig] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[root] Keyword[instanceof] identifier[Map] operator[SEP] { identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[value] , identifier[jsonConfig] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[root] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[pd] operator[!=] Other[null] operator[SEP] { identifier[Class] identifier[targetClass] operator[=] identifier[pd] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jsonConfig] operator[SEP] identifier[isHandleJettisonSingleElementArray] operator[SEP] operator[SEP] operator[SEP] { identifier[JSONArray] identifier[array] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[value] , identifier[jsonConfig] operator[SEP] operator[SEP] identifier[Class] identifier[newTargetClass] operator[=] identifier[resolveClass] operator[SEP] identifier[classMap] , identifier[key] , identifier[name] , identifier[type] operator[SEP] operator[SEP] identifier[Object] identifier[newRoot] operator[=] identifier[jsonConfig] operator[SEP] identifier[getNewBeanInstanceStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[newTargetClass] , operator[SEP] identifier[JSONObject] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetClass] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] { identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[JSONArray] operator[SEP] identifier[toArray] operator[SEP] identifier[array] , identifier[newRoot] , identifier[jsonConfig] operator[SEP] , identifier[jsonConfig] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Collection] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[targetClass] operator[SEP] operator[SEP] { identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[JSONArray] operator[SEP] identifier[toList] operator[SEP] identifier[array] , identifier[newRoot] , identifier[jsonConfig] operator[SEP] , identifier[jsonConfig] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[JSONArray] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[targetClass] operator[SEP] operator[SEP] { identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[array] , identifier[jsonConfig] operator[SEP] operator[SEP] } Keyword[else] { identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[toBean] operator[SEP] operator[SEP] identifier[JSONObject] operator[SEP] identifier[value] , identifier[newRoot] , identifier[jsonConfig] operator[SEP] , identifier[jsonConfig] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[targetClass] operator[==] identifier[Object] operator[SEP] Keyword[class] operator[SEP] { identifier[targetClass] operator[=] identifier[resolveClass] operator[SEP] identifier[classMap] , identifier[key] , identifier[name] , identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetClass] operator[==] Other[null] operator[SEP] { identifier[targetClass] operator[=] identifier[Object] operator[SEP] Keyword[class] operator[SEP] } } identifier[Object] identifier[newRoot] operator[=] identifier[jsonConfig] operator[SEP] identifier[getNewBeanInstanceStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[targetClass] , operator[SEP] identifier[JSONObject] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[toBean] operator[SEP] operator[SEP] identifier[JSONObject] operator[SEP] identifier[value] , identifier[newRoot] , identifier[jsonConfig] operator[SEP] , identifier[jsonConfig] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[root] Keyword[instanceof] identifier[Map] operator[SEP] { identifier[Class] identifier[targetClass] operator[=] identifier[findTargetClass] operator[SEP] identifier[key] , identifier[classMap] operator[SEP] operator[SEP] identifier[targetClass] operator[=] identifier[targetClass] operator[==] Other[null] operator[?] identifier[findTargetClass] operator[SEP] identifier[name] , identifier[classMap] operator[SEP] operator[:] identifier[targetClass] operator[SEP] identifier[Object] identifier[newRoot] operator[=] identifier[jsonConfig] operator[SEP] identifier[getNewBeanInstanceStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[targetClass] , operator[SEP] identifier[JSONObject] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[toBean] operator[SEP] operator[SEP] identifier[JSONObject] operator[SEP] identifier[value] , identifier[newRoot] , identifier[jsonConfig] operator[SEP] , identifier[jsonConfig] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[rootClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] { Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , identifier[JSONUtils] operator[SEP] identifier[getMorpherRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[morph] operator[SEP] identifier[type] , Other[null] operator[SEP] , identifier[jsonConfig] operator[SEP] operator[SEP] } Keyword[else] { identifier[setProperty] operator[SEP] identifier[root] , identifier[key] , Other[null] , identifier[jsonConfig] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[JSONException] identifier[jsone] operator[SEP] { Keyword[throw] identifier[jsone] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[JSONException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[type] , identifier[e] operator[SEP] operator[SEP] } } Keyword[return] identifier[root] operator[SEP] }
public static appfwprofile_stats[] get(nitro_service service) throws Exception{ appfwprofile_stats obj = new appfwprofile_stats(); appfwprofile_stats[] response = (appfwprofile_stats[])obj.stat_resources(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[appfwprofile_stats]], modifier[public static], parameter[service]] begin[{] local_variable[type[appfwprofile_stats], obj] local_variable[type[appfwprofile_stats], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[appfwprofile_stats] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] operator[SEP] Keyword[throws] identifier[Exception] { identifier[appfwprofile_stats] identifier[obj] operator[=] Keyword[new] identifier[appfwprofile_stats] operator[SEP] operator[SEP] operator[SEP] identifier[appfwprofile_stats] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[appfwprofile_stats] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[stat_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
@Override public synchronized void start() { if (this.hasStarted) { LOG.warn("ApplicationLauncher has already started"); return; } this.hasStarted = true; this.serviceManager = new ServiceManager(this.services); // A listener that shutdowns the application if any service fails. this.serviceManager.addListener(new ServiceManager.Listener() { @Override public void failure(Service service) { super.failure(service); LOG.error(String.format("Service %s has failed.", service.getClass().getSimpleName()), service.failureCause()); try { service.stopAsync(); ServiceBasedAppLauncher.this.stop(); } catch (ApplicationException ae) { LOG.error("Could not shutdown services gracefully. This may cause the application to hang."); } } }); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { try { ServiceBasedAppLauncher.this.stop(); } catch (ApplicationException e) { LOG.error("Failed to shutdown application", e); } finally { try { ServiceBasedAppLauncher.this.close(); } catch (IOException e) { LOG.error("Failed to close application", e); } } } }); LOG.info("Starting the Gobblin application and all its associated Services"); // Start the application this.serviceManager.startAsync().awaitHealthy(); }
class class_name[name] begin[{] method[start, return_type[void], modifier[synchronized public], parameter[]] begin[{] if[THIS[member[None.hasStarted]]] begin[{] call[LOG.warn, parameter[literal["ApplicationLauncher has already started"]]] return[None] else begin[{] None end[}] assign[THIS[member[None.hasStarted]], literal[true]] assign[THIS[member[None.serviceManager]], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=services, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceManager, sub_type=None))] THIS[member[None.serviceManager]call[None.addListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=SuperMethodInvocation(arguments=[MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=failure, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Service %s has failed."), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=failureCause, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=stopAsync, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=ServiceBasedAppLauncher, selectors=[MethodInvocation(arguments=[], member=stop, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not shutdown services gracefully. This may cause the application to hang.")], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ae, types=['ApplicationException']))], finally_block=None, label=None, resources=None)], documentation=None, modifiers={'public'}, name=failure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=service, type=ReferenceType(arguments=None, dimensions=[], name=Service, 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=None, dimensions=None, name=ServiceManager, sub_type=ReferenceType(arguments=None, dimensions=None, name=Listener, sub_type=None)))]]] call[Runtime.getRuntime, parameter[]] call[LOG.info, parameter[literal["Starting the Gobblin application and all its associated Services"]]] THIS[member[None.serviceManager]call[None.startAsync, parameter[]]call[None.awaitHealthy, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[start] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[hasStarted] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[hasStarted] operator[=] literal[boolean] operator[SEP] Keyword[this] operator[SEP] identifier[serviceManager] operator[=] Keyword[new] identifier[ServiceManager] operator[SEP] Keyword[this] operator[SEP] identifier[services] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[serviceManager] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[ServiceManager] operator[SEP] identifier[Listener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[failure] operator[SEP] identifier[Service] identifier[service] operator[SEP] { Keyword[super] operator[SEP] identifier[failure] operator[SEP] identifier[service] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[service] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] , identifier[service] operator[SEP] identifier[failureCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[service] operator[SEP] identifier[stopAsync] operator[SEP] operator[SEP] operator[SEP] identifier[ServiceBasedAppLauncher] operator[SEP] Keyword[this] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ApplicationException] identifier[ae] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] identifier[Runtime] operator[SEP] identifier[getRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[addShutdownHook] operator[SEP] Keyword[new] identifier[Thread] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[try] { identifier[ServiceBasedAppLauncher] operator[SEP] Keyword[this] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ApplicationException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[try] { identifier[ServiceBasedAppLauncher] operator[SEP] Keyword[this] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } } } operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[serviceManager] operator[SEP] identifier[startAsync] operator[SEP] operator[SEP] operator[SEP] identifier[awaitHealthy] operator[SEP] operator[SEP] operator[SEP] }
public void disconnect() { if (isConnected()) { SharedObjectMessage msg = new SharedObjectMessage(name, 0, isPersistent()); msg.addEvent(new SharedObjectEvent(Type.SERVER_DISCONNECT, null, null)); Channel c = ((RTMPConnection) source).getChannel(3); c.write(msg); notifyDisconnect(); initialSyncReceived = false; } }
class class_name[name] begin[{] method[disconnect, return_type[void], modifier[public], parameter[]] begin[{] if[call[.isConnected, parameter[]]] begin[{] local_variable[type[SharedObjectMessage], msg] call[msg.addEvent, parameter[ClassCreator(arguments=[MemberReference(member=SERVER_DISCONNECT, postfix_operators=[], prefix_operators=[], qualifier=Type, 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=SharedObjectEvent, sub_type=None))]] local_variable[type[Channel], c] call[c.write, parameter[member[.msg]]] call[.notifyDisconnect, parameter[]] assign[member[.initialSyncReceived], literal[false]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[disconnect] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isConnected] operator[SEP] operator[SEP] operator[SEP] { identifier[SharedObjectMessage] identifier[msg] operator[=] Keyword[new] identifier[SharedObjectMessage] operator[SEP] identifier[name] , Other[0] , identifier[isPersistent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[addEvent] operator[SEP] Keyword[new] identifier[SharedObjectEvent] operator[SEP] identifier[Type] operator[SEP] identifier[SERVER_DISCONNECT] , Other[null] , Other[null] operator[SEP] operator[SEP] operator[SEP] identifier[Channel] identifier[c] operator[=] operator[SEP] operator[SEP] identifier[RTMPConnection] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[getChannel] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[write] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[notifyDisconnect] operator[SEP] operator[SEP] operator[SEP] identifier[initialSyncReceived] operator[=] literal[boolean] operator[SEP] } }
public static String getHashMD5(String str) { try { return getHash(str, "MD5"); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[getHashMD5, return_type[type[String]], modifier[public static], parameter[str]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MD5")], member=getHash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getHashMD5] operator[SEP] identifier[String] identifier[str] operator[SEP] { Keyword[try] { Keyword[return] identifier[getHash] operator[SEP] identifier[str] , literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
protected Class<?> getCurrentScriptClass() { Class<?>[] context = getClassContext(); for (Class<?> c : context) { if (c != InterpretedFunction.class && NativeFunction.class.isAssignableFrom(c) || PolicySecurityController.SecureCaller.class.isAssignableFrom(c)) { return c; } } return null; }
class class_name[name] begin[{] method[getCurrentScriptClass, return_type[type[Class]], modifier[protected], parameter[]] begin[{] local_variable[type[Class], context] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InterpretedFunction, sub_type=None)), operator=!=), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=NativeFunction, sub_type=None)), operator=&&), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=PolicySecurityController, selectors=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SecureCaller, sub_type=None)), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[protected] identifier[Class] operator[<] operator[?] operator[>] identifier[getCurrentScriptClass] operator[SEP] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[context] operator[=] identifier[getClassContext] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[c] operator[:] identifier[context] operator[SEP] { Keyword[if] operator[SEP] identifier[c] operator[!=] identifier[InterpretedFunction] operator[SEP] Keyword[class] operator[&&] identifier[NativeFunction] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[c] operator[SEP] operator[||] identifier[PolicySecurityController] operator[SEP] identifier[SecureCaller] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[c] operator[SEP] operator[SEP] { Keyword[return] identifier[c] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public Geometry pickGeometry( long position, long size ) throws Exception { byte[] geomBytes = new byte[(int) size]; raf.seek(position); raf.read(geomBytes); ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(geomBytes)); return (Geometry) in.readObject(); }
class class_name[name] begin[{] method[pickGeometry, return_type[type[Geometry]], modifier[public], parameter[position, size]] begin[{] local_variable[type[byte], geomBytes] call[raf.seek, parameter[member[.position]]] call[raf.read, parameter[member[.geomBytes]]] local_variable[type[ObjectInputStream], in] return[Cast(expression=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Geometry, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Geometry] identifier[pickGeometry] operator[SEP] Keyword[long] identifier[position] , Keyword[long] identifier[size] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[byte] operator[SEP] operator[SEP] identifier[geomBytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[raf] operator[SEP] identifier[seek] operator[SEP] identifier[position] operator[SEP] operator[SEP] identifier[raf] operator[SEP] identifier[read] operator[SEP] identifier[geomBytes] operator[SEP] operator[SEP] identifier[ObjectInputStream] identifier[in] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[geomBytes] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Geometry] operator[SEP] identifier[in] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] }
public final ChannelFuture handshake(Channel channel, FullHttpRequest req, HttpHeaders responseHeaders, final ChannelPromise promise) { if (logger.isDebugEnabled()) { logger.debug("{} WebSocket version {} server handshake", channel, version()); } FullHttpResponse response = newHandshakeResponse(req, responseHeaders); ChannelPipeline p = channel.pipeline(); if (p.get(HttpObjectAggregator.class) != null) { p.remove(HttpObjectAggregator.class); } if (p.get(HttpContentCompressor.class) != null) { p.remove(HttpContentCompressor.class); } ChannelHandlerContext ctx = p.context(HttpRequestDecoder.class); final String encoderName; if (ctx == null) { // this means the user use a HttpServerCodec ctx = p.context(HttpServerCodec.class); if (ctx == null) { promise.setFailure( new IllegalStateException("No HttpDecoder and no HttpServerCodec in the pipeline")); return promise; } p.addBefore(ctx.name(), "wsdecoder", newWebsocketDecoder()); p.addBefore(ctx.name(), "wsencoder", newWebSocketEncoder()); encoderName = ctx.name(); } else { p.replace(ctx.name(), "wsdecoder", newWebsocketDecoder()); encoderName = p.context(HttpResponseEncoder.class).name(); p.addBefore(encoderName, "wsencoder", newWebSocketEncoder()); } channel.writeAndFlush(response).addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { ChannelPipeline p = future.channel().pipeline(); p.remove(encoderName); promise.setSuccess(); } else { promise.setFailure(future.cause()); } } }); return promise; }
class class_name[name] begin[{] method[handshake, return_type[type[ChannelFuture]], modifier[final public], parameter[channel, req, responseHeaders, promise]] begin[{] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[literal["{} WebSocket version {} server handshake"], member[.channel], call[.version, parameter[]]]] else begin[{] None end[}] local_variable[type[FullHttpResponse], response] local_variable[type[ChannelPipeline], p] if[binary_operation[call[p.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpObjectAggregator, sub_type=None))]], !=, literal[null]]] begin[{] call[p.remove, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpObjectAggregator, sub_type=None))]] else begin[{] None end[}] if[binary_operation[call[p.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpContentCompressor, sub_type=None))]], !=, literal[null]]] begin[{] call[p.remove, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpContentCompressor, sub_type=None))]] else begin[{] None end[}] local_variable[type[ChannelHandlerContext], ctx] local_variable[type[String], encoderName] if[binary_operation[member[.ctx], ==, literal[null]]] begin[{] assign[member[.ctx], call[p.context, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpServerCodec, sub_type=None))]]] if[binary_operation[member[.ctx], ==, literal[null]]] begin[{] call[promise.setFailure, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No HttpDecoder and no HttpServerCodec in the pipeline")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None))]] return[member[.promise]] else begin[{] None end[}] call[p.addBefore, parameter[call[ctx.name, parameter[]], literal["wsdecoder"], call[.newWebsocketDecoder, parameter[]]]] call[p.addBefore, parameter[call[ctx.name, parameter[]], literal["wsencoder"], call[.newWebSocketEncoder, parameter[]]]] assign[member[.encoderName], call[ctx.name, parameter[]]] else begin[{] call[p.replace, parameter[call[ctx.name, parameter[]], literal["wsdecoder"], call[.newWebsocketDecoder, parameter[]]]] assign[member[.encoderName], call[p.context, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpResponseEncoder, sub_type=None))]]] call[p.addBefore, parameter[member[.encoderName], literal["wsencoder"], call[.newWebSocketEncoder, parameter[]]]] end[}] call[channel.writeAndFlush, parameter[member[.response]]] return[member[.promise]] end[}] END[}]
Keyword[public] Keyword[final] identifier[ChannelFuture] identifier[handshake] operator[SEP] identifier[Channel] identifier[channel] , identifier[FullHttpRequest] identifier[req] , identifier[HttpHeaders] identifier[responseHeaders] , Keyword[final] identifier[ChannelPromise] identifier[promise] 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[channel] , identifier[version] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[FullHttpResponse] identifier[response] operator[=] identifier[newHandshakeResponse] operator[SEP] identifier[req] , identifier[responseHeaders] operator[SEP] operator[SEP] identifier[ChannelPipeline] identifier[p] operator[=] identifier[channel] operator[SEP] identifier[pipeline] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[p] operator[SEP] identifier[get] operator[SEP] identifier[HttpObjectAggregator] operator[SEP] Keyword[class] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[p] operator[SEP] identifier[remove] operator[SEP] identifier[HttpObjectAggregator] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[p] operator[SEP] identifier[get] operator[SEP] identifier[HttpContentCompressor] operator[SEP] Keyword[class] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[p] operator[SEP] identifier[remove] operator[SEP] identifier[HttpContentCompressor] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } identifier[ChannelHandlerContext] identifier[ctx] operator[=] identifier[p] operator[SEP] identifier[context] operator[SEP] identifier[HttpRequestDecoder] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[encoderName] operator[SEP] Keyword[if] operator[SEP] identifier[ctx] operator[==] Other[null] operator[SEP] { identifier[ctx] operator[=] identifier[p] operator[SEP] identifier[context] operator[SEP] identifier[HttpServerCodec] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ctx] operator[==] Other[null] operator[SEP] { identifier[promise] operator[SEP] identifier[setFailure] operator[SEP] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[promise] operator[SEP] } identifier[p] operator[SEP] identifier[addBefore] operator[SEP] identifier[ctx] operator[SEP] identifier[name] operator[SEP] operator[SEP] , literal[String] , identifier[newWebsocketDecoder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[p] operator[SEP] identifier[addBefore] operator[SEP] identifier[ctx] operator[SEP] identifier[name] operator[SEP] operator[SEP] , literal[String] , identifier[newWebSocketEncoder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[encoderName] operator[=] identifier[ctx] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[p] operator[SEP] identifier[replace] operator[SEP] identifier[ctx] operator[SEP] identifier[name] operator[SEP] operator[SEP] , literal[String] , identifier[newWebsocketDecoder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[encoderName] operator[=] identifier[p] operator[SEP] identifier[context] operator[SEP] identifier[HttpResponseEncoder] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[p] operator[SEP] identifier[addBefore] operator[SEP] identifier[encoderName] , literal[String] , identifier[newWebSocketEncoder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[channel] operator[SEP] identifier[writeAndFlush] operator[SEP] identifier[response] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[ChannelFutureListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[operationComplete] operator[SEP] identifier[ChannelFuture] identifier[future] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[future] operator[SEP] identifier[isSuccess] operator[SEP] operator[SEP] operator[SEP] { identifier[ChannelPipeline] identifier[p] operator[=] identifier[future] operator[SEP] identifier[channel] operator[SEP] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] operator[SEP] operator[SEP] identifier[p] operator[SEP] identifier[remove] operator[SEP] identifier[encoderName] operator[SEP] operator[SEP] identifier[promise] operator[SEP] identifier[setSuccess] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[promise] operator[SEP] identifier[setFailure] operator[SEP] identifier[future] operator[SEP] identifier[cause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] Keyword[return] identifier[promise] operator[SEP] }
public static boolean sendTextMail(MailSenderInfo mailInfo) { try { // 设置一些通用的数据 Message mailMessage = setCommon(mailInfo); // 设置邮件消息的主要内容 String mailContent = mailInfo.getContent(); mailMessage.setText(mailContent); // 发送邮件 Transport.send(mailMessage); return true; } catch (MessagingException ex) { ex.printStackTrace(); } return false; }
class class_name[name] begin[{] method[sendTextMail, return_type[type[boolean]], modifier[public static], parameter[mailInfo]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=mailInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCommon, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=mailMessage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Message, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getContent, postfix_operators=[], prefix_operators=[], qualifier=mailInfo, selectors=[], type_arguments=None), name=mailContent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mailContent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setText, postfix_operators=[], prefix_operators=[], qualifier=mailMessage, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mailMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=send, postfix_operators=[], prefix_operators=[], qualifier=Transport, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['MessagingException']))], finally_block=None, label=None, resources=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[sendTextMail] operator[SEP] identifier[MailSenderInfo] identifier[mailInfo] operator[SEP] { Keyword[try] { identifier[Message] identifier[mailMessage] operator[=] identifier[setCommon] operator[SEP] identifier[mailInfo] operator[SEP] operator[SEP] identifier[String] identifier[mailContent] operator[=] identifier[mailInfo] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] identifier[mailMessage] operator[SEP] identifier[setText] operator[SEP] identifier[mailContent] operator[SEP] operator[SEP] identifier[Transport] operator[SEP] identifier[send] operator[SEP] identifier[mailMessage] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[MessagingException] identifier[ex] operator[SEP] { identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static Logger get(Class<?> cls, String resourceBundleName) { return Logger.getLogger(cls.getPackage().getName(), resourceBundleName); }
class class_name[name] begin[{] method[get, return_type[type[Logger]], modifier[public static], parameter[cls, resourceBundleName]] begin[{] return[call[Logger.getLogger, parameter[call[cls.getPackage, parameter[]], member[.resourceBundleName]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Logger] identifier[get] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[cls] , identifier[String] identifier[resourceBundleName] operator[SEP] { Keyword[return] identifier[Logger] operator[SEP] identifier[getLogger] operator[SEP] identifier[cls] operator[SEP] identifier[getPackage] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[resourceBundleName] operator[SEP] operator[SEP] }
public static void write(byte[] data, OutputStream output) throws IOException { ByteArrayInputStream input = null; try { input = new ByteArrayInputStream(data); copy(input, output); output.flush(); } finally { IOUtils.closeQuietly(output); } }
class class_name[name] begin[{] method[write, return_type[void], modifier[public static], parameter[data, output]] begin[{] local_variable[type[ByteArrayInputStream], input] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=data, 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=ByteArrayInputStream, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[write] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] , identifier[OutputStream] identifier[output] operator[SEP] Keyword[throws] identifier[IOException] { identifier[ByteArrayInputStream] identifier[input] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[input] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[copy] operator[SEP] identifier[input] , identifier[output] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[output] operator[SEP] operator[SEP] } }
@Override public EEnum getActionState() { if (actionStateEEnum == null) { actionStateEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(StorePackage.eNS_URI).getEClassifiers().get(42); } return actionStateEEnum; }
class class_name[name] begin[{] method[getActionState, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.actionStateEEnum], ==, literal[null]]] begin[{] assign[member[.actionStateEEnum], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=StorePackage, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=42)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.actionStateEEnum]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EEnum] identifier[getActionState] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[actionStateEEnum] operator[==] Other[null] operator[SEP] { identifier[actionStateEEnum] operator[=] operator[SEP] identifier[EEnum] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[StorePackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[42] operator[SEP] operator[SEP] } Keyword[return] identifier[actionStateEEnum] operator[SEP] }
public static boolean isKnownCountryCode(String aCountryCode) { if (aCountryCode == null || aCountryCode.length() != 2) { return false; } return indexOf(aCountryCode) >= 0; }
class class_name[name] begin[{] method[isKnownCountryCode, return_type[type[boolean]], modifier[public static], parameter[aCountryCode]] begin[{] if[binary_operation[binary_operation[member[.aCountryCode], ==, literal[null]], ||, binary_operation[call[aCountryCode.length, parameter[]], !=, literal[2]]]] begin[{] return[literal[false]] else begin[{] None end[}] return[binary_operation[call[.indexOf, parameter[member[.aCountryCode]]], >=, literal[0]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isKnownCountryCode] operator[SEP] identifier[String] identifier[aCountryCode] operator[SEP] { Keyword[if] operator[SEP] identifier[aCountryCode] operator[==] Other[null] operator[||] identifier[aCountryCode] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[2] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] identifier[indexOf] operator[SEP] identifier[aCountryCode] operator[SEP] operator[>=] Other[0] operator[SEP] }
public static void write(final String templateFilename, final Map<String, Object> data, final Writer writer) { Template tmpl = null; try { /*- * note that we don't need to cache templates by ourselves since getTemplate() does that internally already */ tmpl = conf.getTemplate(templateFilename); } catch (FileNotFoundException e1) { String errMsg = "FileNotFoundException: template file '" + templateFilename + "' not found"; log.error("{}: {}", errMsg, e1.getMessage()); throw new AwsMockException(errMsg, e1); } catch (IOException e) { String errMsg = "IOException: failed to getTemplate (filename is " + templateFilename + ")"; log.error("{}: {}", errMsg, e.getMessage()); throw new AwsMockException(errMsg, e); } try { tmpl.process(data, writer); } catch (TemplateException e) { StringBuilder dataDescription = new StringBuilder(); if (null != data) { for (Map.Entry<String, Object> entry : data.entrySet()) { dataDescription.append(entry.getKey() + " - " + entry.getValue()).append('\n'); } } String errMsg = "TemplateException: failed to process template '" + templateFilename + "', with data: " + dataDescription.toString() + " The probable cause could be un-matching of key-values for that template. "; log.error("{}: {}", errMsg, e.getMessage()); throw new AwsMockException(errMsg, e); } catch (IOException e) { String errMsg = "IOException: failed to process template and write to writer. "; log.error("{}: {}", errMsg, e.getMessage()); throw new AwsMockException(errMsg, e); } }
class class_name[name] begin[{] method[write, return_type[void], modifier[public static], parameter[templateFilename, data, writer]] begin[{] local_variable[type[Template], tmpl] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tmpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=templateFilename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTemplate, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FileNotFoundException: template file '"), operandr=MemberReference(member=templateFilename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' not found"), operator=+), name=errMsg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{}: {}"), MemberReference(member=errMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e1, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=errMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e1, 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=AwsMockException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['FileNotFoundException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IOException: failed to getTemplate (filename is "), operandr=MemberReference(member=templateFilename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+), name=errMsg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{}: {}"), MemberReference(member=errMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=errMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=AwsMockException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=process, postfix_operators=[], prefix_operators=[], qualifier=tmpl, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=dataDescription)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=dataDescription, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TemplateException: failed to process template '"), operandr=MemberReference(member=templateFilename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="', with data: "), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=dataDescription, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" The probable cause could be un-matching of key-values for that template. "), operator=+), name=errMsg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{}: {}"), MemberReference(member=errMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=errMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=AwsMockException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TemplateException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IOException: failed to process template and write to writer. "), name=errMsg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{}: {}"), MemberReference(member=errMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=errMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=AwsMockException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[write] operator[SEP] Keyword[final] identifier[String] identifier[templateFilename] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[data] , Keyword[final] identifier[Writer] identifier[writer] operator[SEP] { identifier[Template] identifier[tmpl] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[tmpl] operator[=] identifier[conf] operator[SEP] identifier[getTemplate] operator[SEP] identifier[templateFilename] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e1] operator[SEP] { identifier[String] identifier[errMsg] operator[=] literal[String] operator[+] identifier[templateFilename] operator[+] literal[String] operator[SEP] identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[errMsg] , identifier[e1] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[AwsMockException] operator[SEP] identifier[errMsg] , identifier[e1] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[String] identifier[errMsg] operator[=] literal[String] operator[+] identifier[templateFilename] operator[+] literal[String] operator[SEP] identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[errMsg] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[AwsMockException] operator[SEP] identifier[errMsg] , identifier[e] operator[SEP] operator[SEP] } Keyword[try] { identifier[tmpl] operator[SEP] identifier[process] operator[SEP] identifier[data] , identifier[writer] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TemplateException] identifier[e] operator[SEP] { identifier[StringBuilder] identifier[dataDescription] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[data] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[data] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[dataDescription] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[String] identifier[errMsg] operator[=] literal[String] operator[+] identifier[templateFilename] operator[+] literal[String] operator[+] identifier[dataDescription] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[errMsg] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[AwsMockException] operator[SEP] identifier[errMsg] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[String] identifier[errMsg] operator[=] literal[String] operator[SEP] identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[errMsg] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[AwsMockException] operator[SEP] identifier[errMsg] , identifier[e] operator[SEP] operator[SEP] } }
private ExtractionGuard placeExtractionGuard(String path) { boolean isPrimary; CountDownLatch completionLatch; synchronized( extractionsLock ) { completionLatch = extractionLocks.get(path); if ( completionLatch != null ) { isPrimary = false; } else { isPrimary = true; completionLatch = new CountDownLatch(1); extractionLocks.put(path, completionLatch); } } return new ExtractionGuard(path, isPrimary, completionLatch); }
class class_name[name] begin[{] method[placeExtractionGuard, return_type[type[ExtractionGuard]], modifier[private], parameter[path]] begin[{] local_variable[type[boolean], isPrimary] local_variable[type[CountDownLatch], completionLatch] SYNCHRONIZED[member[.extractionsLock]] BEGIN[{] assign[member[.completionLatch], call[extractionLocks.get, parameter[member[.path]]]] if[binary_operation[member[.completionLatch], !=, literal[null]]] begin[{] assign[member[.isPrimary], literal[false]] else begin[{] assign[member[.isPrimary], literal[true]] assign[member[.completionLatch], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CountDownLatch, sub_type=None))] call[extractionLocks.put, parameter[member[.path], member[.completionLatch]]] end[}] END[}] return[ClassCreator(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isPrimary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=completionLatch, 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=ExtractionGuard, sub_type=None))] end[}] END[}]
Keyword[private] identifier[ExtractionGuard] identifier[placeExtractionGuard] operator[SEP] identifier[String] identifier[path] operator[SEP] { Keyword[boolean] identifier[isPrimary] operator[SEP] identifier[CountDownLatch] identifier[completionLatch] operator[SEP] Keyword[synchronized] operator[SEP] identifier[extractionsLock] operator[SEP] { identifier[completionLatch] operator[=] identifier[extractionLocks] operator[SEP] identifier[get] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[completionLatch] operator[!=] Other[null] operator[SEP] { identifier[isPrimary] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[isPrimary] operator[=] literal[boolean] operator[SEP] identifier[completionLatch] operator[=] Keyword[new] identifier[CountDownLatch] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[extractionLocks] operator[SEP] identifier[put] operator[SEP] identifier[path] , identifier[completionLatch] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[ExtractionGuard] operator[SEP] identifier[path] , identifier[isPrimary] , identifier[completionLatch] operator[SEP] operator[SEP] }
@Override public PutPolicyResult putPolicy(PutPolicyRequest request) { request = beforeClientExecution(request); return executePutPolicy(request); }
class class_name[name] begin[{] method[putPolicy, return_type[type[PutPolicyResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executePutPolicy, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[PutPolicyResult] identifier[putPolicy] operator[SEP] identifier[PutPolicyRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executePutPolicy] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static HttpMethod valueOf(String name) { if (name == null) { throw new NullPointerException("name"); } name = name.trim().toUpperCase(); if (name.length() == 0) { throw new IllegalArgumentException("empty name"); } HttpMethod result = methodMap.get(name); if (result != null) { return result; } else { return new HttpMethod(name); } }
class class_name[name] begin[{] method[valueOf, return_type[type[HttpMethod]], modifier[public static], parameter[name]] begin[{] if[binary_operation[member[.name], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name")], 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[}] assign[member[.name], call[name.trim, parameter[]]] if[binary_operation[call[name.length, parameter[]], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="empty name")], 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[HttpMethod], result] if[binary_operation[member[.result], !=, literal[null]]] begin[{] return[member[.result]] else begin[{] return[ClassCreator(arguments=[MemberReference(member=name, 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=HttpMethod, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[HttpMethod] identifier[valueOf] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[name] operator[=] identifier[name] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[HttpMethod] identifier[result] operator[=] identifier[methodMap] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[result] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[HttpMethod] operator[SEP] identifier[name] operator[SEP] operator[SEP] } }
private StorageDirView allocateBlock(long sessionId, long blockSize, BlockStoreLocation location) { Preconditions.checkNotNull(location, "location"); if (location.equals(BlockStoreLocation.anyTier())) { // When any tier is ok, loop over all tier views and dir views, // and return a temp block meta from the first available dirview. for (StorageTierView tierView : mManagerView.getTierViews()) { for (StorageDirView dirView : tierView.getDirViews()) { if (dirView.getAvailableBytes() >= blockSize) { return dirView; } } } return null; } String tierAlias = location.tierAlias(); StorageTierView tierView = mManagerView.getTierView(tierAlias); if (location.equals(BlockStoreLocation.anyDirInTier(tierAlias))) { // Loop over all dir views in the given tier for (StorageDirView dirView : tierView.getDirViews()) { if (dirView.getAvailableBytes() >= blockSize) { return dirView; } } return null; } int dirIndex = location.dir(); StorageDirView dirView = tierView.getDirView(dirIndex); if (dirView.getAvailableBytes() >= blockSize) { return dirView; } return null; }
class class_name[name] begin[{] method[allocateBlock, return_type[type[StorageDirView]], modifier[private], parameter[sessionId, blockSize, location]] begin[{] call[Preconditions.checkNotNull, parameter[member[.location], literal["location"]]] if[call[location.equals, parameter[call[BlockStoreLocation.anyTier, parameter[]]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getAvailableBytes, postfix_operators=[], prefix_operators=[], qualifier=dirView, selectors=[], type_arguments=None), operandr=MemberReference(member=blockSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=dirView, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDirViews, postfix_operators=[], prefix_operators=[], qualifier=tierView, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dirView)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StorageDirView, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getTierViews, postfix_operators=[], prefix_operators=[], qualifier=mManagerView, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tierView)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StorageTierView, sub_type=None))), label=None) return[literal[null]] else begin[{] None end[}] local_variable[type[String], tierAlias] local_variable[type[StorageTierView], tierView] if[call[location.equals, parameter[call[BlockStoreLocation.anyDirInTier, parameter[member[.tierAlias]]]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getAvailableBytes, postfix_operators=[], prefix_operators=[], qualifier=dirView, selectors=[], type_arguments=None), operandr=MemberReference(member=blockSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=dirView, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDirViews, postfix_operators=[], prefix_operators=[], qualifier=tierView, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dirView)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StorageDirView, sub_type=None))), label=None) return[literal[null]] else begin[{] None end[}] local_variable[type[int], dirIndex] local_variable[type[StorageDirView], dirView] if[binary_operation[call[dirView.getAvailableBytes, parameter[]], >=, member[.blockSize]]] begin[{] return[member[.dirView]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] identifier[StorageDirView] identifier[allocateBlock] operator[SEP] Keyword[long] identifier[sessionId] , Keyword[long] identifier[blockSize] , identifier[BlockStoreLocation] identifier[location] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[location] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[location] operator[SEP] identifier[equals] operator[SEP] identifier[BlockStoreLocation] operator[SEP] identifier[anyTier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[StorageTierView] identifier[tierView] operator[:] identifier[mManagerView] operator[SEP] identifier[getTierViews] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[StorageDirView] identifier[dirView] operator[:] identifier[tierView] operator[SEP] identifier[getDirViews] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[dirView] operator[SEP] identifier[getAvailableBytes] operator[SEP] operator[SEP] operator[>=] identifier[blockSize] operator[SEP] { Keyword[return] identifier[dirView] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] } identifier[String] identifier[tierAlias] operator[=] identifier[location] operator[SEP] identifier[tierAlias] operator[SEP] operator[SEP] operator[SEP] identifier[StorageTierView] identifier[tierView] operator[=] identifier[mManagerView] operator[SEP] identifier[getTierView] operator[SEP] identifier[tierAlias] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[location] operator[SEP] identifier[equals] operator[SEP] identifier[BlockStoreLocation] operator[SEP] identifier[anyDirInTier] operator[SEP] identifier[tierAlias] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[StorageDirView] identifier[dirView] operator[:] identifier[tierView] operator[SEP] identifier[getDirViews] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[dirView] operator[SEP] identifier[getAvailableBytes] operator[SEP] operator[SEP] operator[>=] identifier[blockSize] operator[SEP] { Keyword[return] identifier[dirView] operator[SEP] } } Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[dirIndex] operator[=] identifier[location] operator[SEP] identifier[dir] operator[SEP] operator[SEP] operator[SEP] identifier[StorageDirView] identifier[dirView] operator[=] identifier[tierView] operator[SEP] identifier[getDirView] operator[SEP] identifier[dirIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dirView] operator[SEP] identifier[getAvailableBytes] operator[SEP] operator[SEP] operator[>=] identifier[blockSize] operator[SEP] { Keyword[return] identifier[dirView] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public String text() { try { connect(); return responseCode() >= 400 ? read(connection.getErrorStream()) : read(connection.getInputStream()); } catch (IOException e) { throw new HttpException("Failed URL: " + url, e); }finally { dispose(); } }
class class_name[name] begin[{] method[text, return_type[type[String]], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=connect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=responseCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=400), operator=>=), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None)], member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getErrorStream, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None)], member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed URL: "), operandr=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=dispose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[String] identifier[text] operator[SEP] operator[SEP] { Keyword[try] { identifier[connect] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[responseCode] operator[SEP] operator[SEP] operator[>=] Other[400] operator[?] identifier[read] operator[SEP] identifier[connection] operator[SEP] identifier[getErrorStream] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[read] operator[SEP] identifier[connection] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[HttpException] operator[SEP] literal[String] operator[+] identifier[url] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[dispose] operator[SEP] operator[SEP] operator[SEP] } }
private void buildStandardFile() { // Build station list List<GempakStation> stations = gemreader.getStations(); //Trace.msg("GEMPAKSIOSP: now have " + stations.size() + " stations"); Dimension station = new Dimension("station", stations.size(), true); ncfile.addDimension(null, station); ncfile.addDimension(null, DIM_LEN8); ncfile.addDimension(null, DIM_LEN4); ncfile.addDimension(null, DIM_LEN2); List<Variable> stationVars = makeStationVars(stations, station); // loop through and add to ncfile for (Variable stnVar : stationVars) { ncfile.addVariable(null, stnVar); } // Build variable list (var(station,time)) // time List<Date> timeList = gemreader.getDates(); int numTimes = timeList.size(); Dimension times = new Dimension(TIME_VAR, numTimes, true); ncfile.addDimension(null, times); Array varArray; Variable timeVar = new Variable(ncfile, null, null, TIME_VAR, DataType.DOUBLE, TIME_VAR); timeVar.addAttribute(new Attribute(CDM.UNITS, "seconds since 1970-01-01 00:00:00")); timeVar.addAttribute(new Attribute("long_name", TIME_VAR)); varArray = new ArrayDouble.D1(numTimes); int i = 0; for (Date date : timeList) { ((ArrayDouble.D1) varArray).set(i, date.getTime() / 1000.d); i++; } timeVar.setCachedData(varArray, false); ncfile.addVariable(null, timeVar); List<Dimension> stationTime = new ArrayList<>(); stationTime.add(station); stationTime.add(times); // TODO: handle other parts Structure sfData = makeStructure(GempakSurfaceFileReader.SFDT, stationTime, true); if (sfData == null) { return; } sfData.addAttribute(new Attribute(CF.COORDINATES, "time SLAT SLON SELV")); ncfile.addVariable(null, sfData); ncfile.addAttribute( null, new Attribute( "CF:featureType", CF.FeatureType.timeSeries.toString())); }
class class_name[name] begin[{] method[buildStandardFile, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[List], stations] local_variable[type[Dimension], station] call[ncfile.addDimension, parameter[literal[null], member[.station]]] call[ncfile.addDimension, parameter[literal[null], member[.DIM_LEN8]]] call[ncfile.addDimension, parameter[literal[null], member[.DIM_LEN4]]] call[ncfile.addDimension, parameter[literal[null], member[.DIM_LEN2]]] local_variable[type[List], stationVars] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=stnVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addVariable, postfix_operators=[], prefix_operators=[], qualifier=ncfile, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=stationVars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=stnVar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Variable, sub_type=None))), label=None) local_variable[type[List], timeList] local_variable[type[int], numTimes] local_variable[type[Dimension], times] call[ncfile.addDimension, parameter[literal[null], member[.times]]] local_variable[type[Array], varArray] local_variable[type[Variable], timeVar] call[timeVar.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=UNITS, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="seconds since 1970-01-01 00:00:00")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] call[timeVar.addAttribute, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="long_name"), MemberReference(member=TIME_VAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] assign[member[.varArray], ClassCreator(arguments=[MemberReference(member=numTimes, 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=ArrayDouble, sub_type=ReferenceType(arguments=None, dimensions=None, name=D1, sub_type=None)))] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=varArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ArrayDouble, sub_type=ReferenceType(arguments=None, dimensions=None, name=D1, sub_type=None))), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=timeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=date)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None))), label=None) call[timeVar.setCachedData, parameter[member[.varArray], literal[false]]] call[ncfile.addVariable, parameter[literal[null], member[.timeVar]]] local_variable[type[List], stationTime] call[stationTime.add, parameter[member[.station]]] call[stationTime.add, parameter[member[.times]]] local_variable[type[Structure], sfData] if[binary_operation[member[.sfData], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] call[sfData.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=COORDINATES, postfix_operators=[], prefix_operators=[], qualifier=CF, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="time SLAT SLON SELV")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] call[ncfile.addVariable, parameter[literal[null], member[.sfData]]] call[ncfile.addAttribute, parameter[literal[null], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CF:featureType"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=CF.FeatureType.timeSeries, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[buildStandardFile] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[GempakStation] operator[>] identifier[stations] operator[=] identifier[gemreader] operator[SEP] identifier[getStations] operator[SEP] operator[SEP] operator[SEP] identifier[Dimension] identifier[station] operator[=] Keyword[new] identifier[Dimension] operator[SEP] literal[String] , identifier[stations] operator[SEP] identifier[size] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addDimension] operator[SEP] Other[null] , identifier[station] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addDimension] operator[SEP] Other[null] , identifier[DIM_LEN8] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addDimension] operator[SEP] Other[null] , identifier[DIM_LEN4] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addDimension] operator[SEP] Other[null] , identifier[DIM_LEN2] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Variable] operator[>] identifier[stationVars] operator[=] identifier[makeStationVars] operator[SEP] identifier[stations] , identifier[station] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Variable] identifier[stnVar] operator[:] identifier[stationVars] operator[SEP] { identifier[ncfile] operator[SEP] identifier[addVariable] operator[SEP] Other[null] , identifier[stnVar] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[Date] operator[>] identifier[timeList] operator[=] identifier[gemreader] operator[SEP] identifier[getDates] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numTimes] operator[=] identifier[timeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[Dimension] identifier[times] operator[=] Keyword[new] identifier[Dimension] operator[SEP] identifier[TIME_VAR] , identifier[numTimes] , literal[boolean] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addDimension] operator[SEP] Other[null] , identifier[times] operator[SEP] operator[SEP] identifier[Array] identifier[varArray] operator[SEP] identifier[Variable] identifier[timeVar] operator[=] Keyword[new] identifier[Variable] operator[SEP] identifier[ncfile] , Other[null] , Other[null] , identifier[TIME_VAR] , identifier[DataType] operator[SEP] identifier[DOUBLE] , identifier[TIME_VAR] operator[SEP] operator[SEP] identifier[timeVar] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[UNITS] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[timeVar] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] literal[String] , identifier[TIME_VAR] operator[SEP] operator[SEP] operator[SEP] identifier[varArray] operator[=] Keyword[new] identifier[ArrayDouble] operator[SEP] identifier[D1] operator[SEP] identifier[numTimes] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Date] identifier[date] operator[:] identifier[timeList] operator[SEP] { operator[SEP] operator[SEP] identifier[ArrayDouble] operator[SEP] identifier[D1] operator[SEP] identifier[varArray] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[i] , identifier[date] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[/] literal[Float] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] } identifier[timeVar] operator[SEP] identifier[setCachedData] operator[SEP] identifier[varArray] , literal[boolean] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addVariable] operator[SEP] Other[null] , identifier[timeVar] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Dimension] operator[>] identifier[stationTime] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[stationTime] operator[SEP] identifier[add] operator[SEP] identifier[station] operator[SEP] operator[SEP] identifier[stationTime] operator[SEP] identifier[add] operator[SEP] identifier[times] operator[SEP] operator[SEP] identifier[Structure] identifier[sfData] operator[=] identifier[makeStructure] operator[SEP] identifier[GempakSurfaceFileReader] operator[SEP] identifier[SFDT] , identifier[stationTime] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sfData] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[sfData] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CF] operator[SEP] identifier[COORDINATES] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addVariable] operator[SEP] Other[null] , identifier[sfData] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addAttribute] operator[SEP] Other[null] , Keyword[new] identifier[Attribute] operator[SEP] literal[String] , identifier[CF] operator[SEP] identifier[FeatureType] operator[SEP] identifier[timeSeries] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static boolean containsAny(Collection<?> coll1, Collection<?> coll2) { if (isEmpty(coll1) || isEmpty(coll2)) { return false; } if (coll1.size() < coll2.size()) { for (Object object : coll1) { if (coll2.contains(object)) { return true; } } } else { for (Object object : coll2) { if (coll1.contains(object)) { return true; } } } return false; }
class class_name[name] begin[{] method[containsAny, return_type[type[boolean]], modifier[public static], parameter[coll1, coll2]] begin[{] if[binary_operation[call[.isEmpty, parameter[member[.coll1]]], ||, call[.isEmpty, parameter[member[.coll2]]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[call[coll1.size, parameter[]], <, call[coll2.size, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=coll2, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=coll1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) else begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=coll1, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=coll2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[containsAny] operator[SEP] identifier[Collection] operator[<] operator[?] operator[>] identifier[coll1] , identifier[Collection] operator[<] operator[?] operator[>] identifier[coll2] operator[SEP] { Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] identifier[coll1] operator[SEP] operator[||] identifier[isEmpty] operator[SEP] identifier[coll2] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[coll1] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[coll2] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Object] identifier[object] operator[:] identifier[coll1] operator[SEP] { Keyword[if] operator[SEP] identifier[coll2] operator[SEP] identifier[contains] operator[SEP] identifier[object] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[else] { Keyword[for] operator[SEP] identifier[Object] identifier[object] operator[:] identifier[coll2] operator[SEP] { Keyword[if] operator[SEP] identifier[coll1] operator[SEP] identifier[contains] operator[SEP] identifier[object] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
protected void start() { // if a periodic execution throws an exception, future executions are suspended, // this task wraps the call in a try-catch block to prevent that. Errors are still propagated. final Runnable resilientTask = () -> { try { run(); } catch (final Exception e) { logger.error("[{}] Error during timeout-initiated flush", name, e); } }; scheduler.scheduleAtFixedRate(resilientTask, 0, batchTimeout + salt, TimeUnit.MILLISECONDS); }
class class_name[name] begin[{] method[start, return_type[void], modifier[protected], parameter[]] begin[{] local_variable[type[Runnable], resilientTask] call[scheduler.scheduleAtFixedRate, parameter[member[.resilientTask], literal[0], binary_operation[member[.batchTimeout], +, member[.salt]], member[TimeUnit.MILLISECONDS]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[start] operator[SEP] operator[SEP] { Keyword[final] identifier[Runnable] identifier[resilientTask] operator[=] operator[SEP] operator[SEP] operator[->] { Keyword[try] { identifier[run] operator[SEP] 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] , identifier[name] , identifier[e] operator[SEP] operator[SEP] } } operator[SEP] identifier[scheduler] operator[SEP] identifier[scheduleAtFixedRate] operator[SEP] identifier[resilientTask] , Other[0] , identifier[batchTimeout] operator[+] identifier[salt] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] }
public void marshall(PhoneNumberOrder phoneNumberOrder, ProtocolMarshaller protocolMarshaller) { if (phoneNumberOrder == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(phoneNumberOrder.getPhoneNumberOrderId(), PHONENUMBERORDERID_BINDING); protocolMarshaller.marshall(phoneNumberOrder.getProductType(), PRODUCTTYPE_BINDING); protocolMarshaller.marshall(phoneNumberOrder.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(phoneNumberOrder.getOrderedPhoneNumbers(), ORDEREDPHONENUMBERS_BINDING); protocolMarshaller.marshall(phoneNumberOrder.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING); protocolMarshaller.marshall(phoneNumberOrder.getUpdatedTimestamp(), UPDATEDTIMESTAMP_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[phoneNumberOrder, protocolMarshaller]] begin[{] if[binary_operation[member[.phoneNumberOrder], ==, 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=getPhoneNumberOrderId, postfix_operators=[], prefix_operators=[], qualifier=phoneNumberOrder, selectors=[], type_arguments=None), MemberReference(member=PHONENUMBERORDERID_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=getProductType, postfix_operators=[], prefix_operators=[], qualifier=phoneNumberOrder, selectors=[], type_arguments=None), MemberReference(member=PRODUCTTYPE_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=getStatus, postfix_operators=[], prefix_operators=[], qualifier=phoneNumberOrder, selectors=[], type_arguments=None), MemberReference(member=STATUS_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=getOrderedPhoneNumbers, postfix_operators=[], prefix_operators=[], qualifier=phoneNumberOrder, selectors=[], type_arguments=None), MemberReference(member=ORDEREDPHONENUMBERS_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=getCreatedTimestamp, postfix_operators=[], prefix_operators=[], qualifier=phoneNumberOrder, selectors=[], type_arguments=None), MemberReference(member=CREATEDTIMESTAMP_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=getUpdatedTimestamp, postfix_operators=[], prefix_operators=[], qualifier=phoneNumberOrder, selectors=[], type_arguments=None), MemberReference(member=UPDATEDTIMESTAMP_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[PhoneNumberOrder] identifier[phoneNumberOrder] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[phoneNumberOrder] 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[phoneNumberOrder] operator[SEP] identifier[getPhoneNumberOrderId] operator[SEP] operator[SEP] , identifier[PHONENUMBERORDERID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[phoneNumberOrder] operator[SEP] identifier[getProductType] operator[SEP] operator[SEP] , identifier[PRODUCTTYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[phoneNumberOrder] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[phoneNumberOrder] operator[SEP] identifier[getOrderedPhoneNumbers] operator[SEP] operator[SEP] , identifier[ORDEREDPHONENUMBERS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[phoneNumberOrder] operator[SEP] identifier[getCreatedTimestamp] operator[SEP] operator[SEP] , identifier[CREATEDTIMESTAMP_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[phoneNumberOrder] operator[SEP] identifier[getUpdatedTimestamp] operator[SEP] operator[SEP] , identifier[UPDATEDTIMESTAMP_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static <T> List<T> merge(T pFirst, T... pRest) { List<T> result = new ArrayList<T>(1 + (pRest == null ? 0 : pRest.length)); result.add(pFirst); if (pRest != null) { result.addAll(Arrays.asList(pRest)); } return result; }
class class_name[name] begin[{] method[merge, return_type[type[List]], modifier[public static], parameter[pFirst, pRest]] begin[{] local_variable[type[List], result] call[result.add, parameter[member[.pFirst]]] if[binary_operation[member[.pRest], !=, literal[null]]] begin[{] call[result.addAll, parameter[call[Arrays.asList, parameter[member[.pRest]]]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[merge] operator[SEP] identifier[T] identifier[pFirst] , identifier[T] operator[...] identifier[pRest] operator[SEP] { identifier[List] operator[<] identifier[T] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[T] operator[>] operator[SEP] Other[1] operator[+] operator[SEP] identifier[pRest] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[pRest] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[pFirst] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pRest] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[pRest] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public static void resolveStageAlias( StageLibraryTask stageLibrary, StageConfiguration stageConf ) { String aliasKey = Joiner.on(",").join(stageConf.getLibrary(), stageConf.getStageName()); String aliasValue = Strings.nullToEmpty(stageLibrary.getStageNameAliases().get(aliasKey)); if (LOG.isTraceEnabled()) { for (String key : stageLibrary.getStageNameAliases().keySet()) { LOG.trace("Stage Lib Alias: {} => {}", key, stageLibrary.getStageNameAliases().get(key)); } LOG.trace("Looking for '{}' and found '{}'", aliasKey, aliasValue); } if (!aliasValue.isEmpty()) { List<String> alias = Splitter.on(",").splitToList(aliasValue); if (alias.size() == 2) { LOG.debug("Converting '{}' to '{}'", aliasKey, aliasValue); stageConf.setLibrary(alias.get(0)); stageConf.setStageName(alias.get(1)); } else { LOG.error("Malformed stage alias: '{}'", aliasValue); } } }
class class_name[name] begin[{] method[resolveStageAlias, return_type[void], modifier[public static], parameter[stageLibrary, stageConf]] begin[{] local_variable[type[String], aliasKey] local_variable[type[String], aliasValue] if[call[LOG.isTraceEnabled, parameter[]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Stage Lib Alias: {} => {}"), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getStageNameAliases, postfix_operators=[], prefix_operators=[], qualifier=stageLibrary, selectors=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getStageNameAliases, postfix_operators=[], prefix_operators=[], qualifier=stageLibrary, selectors=[MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[LOG.trace, parameter[literal["Looking for '{}' and found '{}'"], member[.aliasKey], member[.aliasValue]]] else begin[{] None end[}] if[call[aliasValue.isEmpty, parameter[]]] begin[{] local_variable[type[List], alias] if[binary_operation[call[alias.size, parameter[]], ==, literal[2]]] begin[{] call[LOG.debug, parameter[literal["Converting '{}' to '{}'"], member[.aliasKey], member[.aliasValue]]] call[stageConf.setLibrary, parameter[call[alias.get, parameter[literal[0]]]]] call[stageConf.setStageName, parameter[call[alias.get, parameter[literal[1]]]]] else begin[{] call[LOG.error, parameter[literal["Malformed stage alias: '{}'"], member[.aliasValue]]] end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[resolveStageAlias] operator[SEP] identifier[StageLibraryTask] identifier[stageLibrary] , identifier[StageConfiguration] identifier[stageConf] operator[SEP] { identifier[String] identifier[aliasKey] operator[=] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[stageConf] operator[SEP] identifier[getLibrary] operator[SEP] operator[SEP] , identifier[stageConf] operator[SEP] identifier[getStageName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[aliasValue] operator[=] identifier[Strings] operator[SEP] identifier[nullToEmpty] operator[SEP] identifier[stageLibrary] operator[SEP] identifier[getStageNameAliases] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[aliasKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[stageLibrary] operator[SEP] identifier[getStageNameAliases] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[key] , identifier[stageLibrary] operator[SEP] identifier[getStageNameAliases] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[aliasKey] , identifier[aliasValue] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[aliasValue] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[alias] operator[=] identifier[Splitter] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[splitToList] operator[SEP] identifier[aliasValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[alias] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[2] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[aliasKey] , identifier[aliasValue] operator[SEP] operator[SEP] identifier[stageConf] operator[SEP] identifier[setLibrary] operator[SEP] identifier[alias] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[stageConf] operator[SEP] identifier[setStageName] operator[SEP] identifier[alias] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[aliasValue] operator[SEP] operator[SEP] } } }
@Nullable public static ClientConnectionTimings get(RequestContext ctx) { requireNonNull(ctx, "ctx"); if (ctx.hasAttr(TIMINGS)) { return ctx.attr(TIMINGS).get(); } return null; }
class class_name[name] begin[{] method[get, return_type[type[ClientConnectionTimings]], modifier[public static], parameter[ctx]] begin[{] call[.requireNonNull, parameter[member[.ctx], literal["ctx"]]] if[call[ctx.hasAttr, parameter[member[.TIMINGS]]]] begin[{] return[call[ctx.attr, parameter[member[.TIMINGS]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[ClientConnectionTimings] identifier[get] operator[SEP] identifier[RequestContext] identifier[ctx] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[ctx] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ctx] operator[SEP] identifier[hasAttr] operator[SEP] identifier[TIMINGS] operator[SEP] operator[SEP] { Keyword[return] identifier[ctx] operator[SEP] identifier[attr] operator[SEP] identifier[TIMINGS] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@Override public Double getValue() { Double rslt = getUiValue(); if (rslt == null) return internVal; if (internVal == null) { Double min = getMin(); if (rslt == min || rslt != null && rslt.equals(min)) return null; } internVal = rslt; return rslt; }
class class_name[name] begin[{] method[getValue, return_type[type[Double]], modifier[public], parameter[]] begin[{] local_variable[type[Double], rslt] if[binary_operation[member[.rslt], ==, literal[null]]] begin[{] return[member[.internVal]] else begin[{] None end[}] if[binary_operation[member[.internVal], ==, literal[null]]] begin[{] local_variable[type[Double], min] if[binary_operation[binary_operation[member[.rslt], ==, member[.min]], ||, binary_operation[binary_operation[member[.rslt], !=, literal[null]], &&, call[rslt.equals, parameter[member[.min]]]]]] begin[{] return[literal[null]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.internVal], member[.rslt]] return[member[.rslt]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Double] identifier[getValue] operator[SEP] operator[SEP] { identifier[Double] identifier[rslt] operator[=] identifier[getUiValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rslt] operator[==] Other[null] operator[SEP] Keyword[return] identifier[internVal] operator[SEP] Keyword[if] operator[SEP] identifier[internVal] operator[==] Other[null] operator[SEP] { identifier[Double] identifier[min] operator[=] identifier[getMin] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rslt] operator[==] identifier[min] operator[||] identifier[rslt] operator[!=] Other[null] operator[&&] identifier[rslt] operator[SEP] identifier[equals] operator[SEP] identifier[min] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[internVal] operator[=] identifier[rslt] operator[SEP] Keyword[return] identifier[rslt] operator[SEP] }
@SuppressWarnings("unchecked") private static <T> T getCachedReference(Project project, String key, Supplier<T> supplier) { if (project == null) { throw new IllegalArgumentException("Gradle project reference cannot be null."); } Project rootProject = project.getRootProject(); ExtraPropertiesExtension ext = rootProject.getExtensions().getExtraProperties(); T value; if (ext.has(key)) { value = (T) ext.get(key); } else { value = supplier.get(); ext.set(key, value); } return value; }
class class_name[name] begin[{] method[getCachedReference, return_type[type[T]], modifier[private static], parameter[project, key, supplier]] begin[{] if[binary_operation[member[.project], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Gradle project reference cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Project], rootProject] local_variable[type[ExtraPropertiesExtension], ext] local_variable[type[T], value] if[call[ext.has, parameter[member[.key]]]] begin[{] assign[member[.value], Cast(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ext, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] else begin[{] assign[member[.value], call[supplier.get, parameter[]]] call[ext.set, parameter[member[.key], member[.value]]] end[}] return[member[.value]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[getCachedReference] operator[SEP] identifier[Project] identifier[project] , identifier[String] identifier[key] , identifier[Supplier] operator[<] identifier[T] operator[>] identifier[supplier] operator[SEP] { Keyword[if] operator[SEP] identifier[project] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Project] identifier[rootProject] operator[=] identifier[project] operator[SEP] identifier[getRootProject] operator[SEP] operator[SEP] operator[SEP] identifier[ExtraPropertiesExtension] identifier[ext] operator[=] identifier[rootProject] operator[SEP] identifier[getExtensions] operator[SEP] operator[SEP] operator[SEP] identifier[getExtraProperties] operator[SEP] operator[SEP] operator[SEP] identifier[T] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[ext] operator[SEP] identifier[has] operator[SEP] identifier[key] operator[SEP] operator[SEP] { identifier[value] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[ext] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] } Keyword[else] { identifier[value] operator[=] identifier[supplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[ext] operator[SEP] identifier[set] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[value] operator[SEP] }
public static Predicate paths(final String... paths) { final PathMatchPredicate[] predicates = new PathMatchPredicate[paths.length]; for (int i = 0; i < paths.length; ++i) { predicates[i] = new PathMatchPredicate(paths[i]); } return or(predicates); }
class class_name[name] begin[{] method[paths, return_type[type[Predicate]], modifier[public static], parameter[paths]] begin[{] local_variable[type[PathMatchPredicate], predicates] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=predicates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PathMatchPredicate, sub_type=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=paths, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[call[.or, parameter[member[.predicates]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Predicate] identifier[paths] operator[SEP] Keyword[final] identifier[String] operator[...] identifier[paths] operator[SEP] { Keyword[final] identifier[PathMatchPredicate] operator[SEP] operator[SEP] identifier[predicates] operator[=] Keyword[new] identifier[PathMatchPredicate] operator[SEP] identifier[paths] 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[paths] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[predicates] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[PathMatchPredicate] operator[SEP] identifier[paths] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[or] operator[SEP] identifier[predicates] operator[SEP] operator[SEP] }
static ClassInfoList getAllClasses(final Collection<ClassInfo> classes, final ScanSpec scanSpec) { return new ClassInfoList( ClassInfo.filterClassInfo(classes, scanSpec, /* strictWhitelist = */ true, ClassType.ALL), /* sortByName = */ true); }
class class_name[name] begin[{] method[getAllClasses, return_type[type[ClassInfoList]], modifier[static], parameter[classes, scanSpec]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=classes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scanSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=ALL, postfix_operators=[], prefix_operators=[], qualifier=ClassType, selectors=[])], member=filterClassInfo, postfix_operators=[], prefix_operators=[], qualifier=ClassInfo, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassInfoList, sub_type=None))] end[}] END[}]
Keyword[static] identifier[ClassInfoList] identifier[getAllClasses] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[ClassInfo] operator[>] identifier[classes] , Keyword[final] identifier[ScanSpec] identifier[scanSpec] operator[SEP] { Keyword[return] Keyword[new] identifier[ClassInfoList] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[filterClassInfo] operator[SEP] identifier[classes] , identifier[scanSpec] , literal[boolean] , identifier[ClassType] operator[SEP] identifier[ALL] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] }
public Date getDate(final Date min, final Date max) { return getDate(min.getTime(), max.getTime()); }
class class_name[name] begin[{] method[getDate, return_type[type[Date]], modifier[public], parameter[min, max]] begin[{] return[call[.getDate, parameter[call[min.getTime, parameter[]], call[max.getTime, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[Date] identifier[getDate] operator[SEP] Keyword[final] identifier[Date] identifier[min] , Keyword[final] identifier[Date] identifier[max] operator[SEP] { Keyword[return] identifier[getDate] operator[SEP] identifier[min] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] , identifier[max] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void notifyReceiveAllowed(boolean isAllowed) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "notifyReceiveAllowed", new Object[] { Boolean.valueOf(isAllowed), this }); this.lock(); try { try { checkReceiveAllowed(); } catch (SISessionUnavailableException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.notifyReceiveAllowed", "1:4287:1.22.5.1", this); SibTr.exception(tc, e); } catch (SIResourceException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.notifyReceiveAllowed", "1:4298:1.22.5.1", this); SibTr.exception(tc, e); } } finally { this.unlock(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "notifyReceiveAllowed"); }
class class_name[name] begin[{] method[notifyReceiveAllowed, return_type[void], modifier[public], parameter[isAllowed]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["notifyReceiveAllowed"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[MemberReference(member=isAllowed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] THIS[call[None.lock, parameter[]]] TryStatement(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=checkReceiveAllowed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.notifyReceiveAllowed"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:4287:1.22.5.1"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SISessionUnavailableException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.notifyReceiveAllowed"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:4298:1.22.5.1"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SIResourceException']))], finally_block=None, label=None, resources=None)], catches=None, finally_block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, resources=None) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["notifyReceiveAllowed"]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[notifyReceiveAllowed] operator[SEP] Keyword[boolean] identifier[isAllowed] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[isAllowed] operator[SEP] , Keyword[this] } operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[try] { identifier[checkReceiveAllowed] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SISessionUnavailableException] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SIResourceException] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] } } Keyword[finally] { Keyword[this] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
@Override public void onSuccess(final DMRResponse response) { ModelNode result = response.get(); if (!result.hasDefined(OUTCOME) || result.isFailure()) { onFailedOutcome(result); abort(); } else { onSuccess(result); proceed(); } }
class class_name[name] begin[{] method[onSuccess, return_type[void], modifier[public], parameter[response]] begin[{] local_variable[type[ModelNode], result] if[binary_operation[call[result.hasDefined, parameter[member[.OUTCOME]]], ||, call[result.isFailure, parameter[]]]] begin[{] call[.onFailedOutcome, parameter[member[.result]]] call[.abort, parameter[]] else begin[{] call[.onSuccess, parameter[member[.result]]] call[.proceed, parameter[]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] Keyword[final] identifier[DMRResponse] identifier[response] operator[SEP] { identifier[ModelNode] identifier[result] operator[=] identifier[response] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[result] operator[SEP] identifier[hasDefined] operator[SEP] identifier[OUTCOME] operator[SEP] operator[||] identifier[result] operator[SEP] identifier[isFailure] operator[SEP] operator[SEP] operator[SEP] { identifier[onFailedOutcome] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[abort] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[onSuccess] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[proceed] operator[SEP] operator[SEP] operator[SEP] } }
ServerRequest peekAt(int index) { ServerRequest req = null; synchronized (reqQueueLockObject) { try { req = queue.get(index); } catch (IndexOutOfBoundsException | NoSuchElementException ignored) { } } return req; }
class class_name[name] begin[{] method[peekAt, return_type[type[ServerRequest]], modifier[default], parameter[index]] begin[{] local_variable[type[ServerRequest], req] SYNCHRONIZED[member[.reqQueueLockObject]] BEGIN[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=queue, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['IndexOutOfBoundsException', 'NoSuchElementException']))], finally_block=None, label=None, resources=None) END[}] return[member[.req]] end[}] END[}]
identifier[ServerRequest] identifier[peekAt] operator[SEP] Keyword[int] identifier[index] operator[SEP] { identifier[ServerRequest] identifier[req] operator[=] Other[null] operator[SEP] Keyword[synchronized] operator[SEP] identifier[reqQueueLockObject] operator[SEP] { Keyword[try] { identifier[req] operator[=] identifier[queue] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IndexOutOfBoundsException] operator[|] identifier[NoSuchElementException] identifier[ignored] operator[SEP] { } } Keyword[return] identifier[req] operator[SEP] }
public M switchTo(K to, M msg) { doFork(to, msg); return doJoin(); }
class class_name[name] begin[{] method[switchTo, return_type[type[M]], modifier[public], parameter[to, msg]] begin[{] call[.doFork, parameter[member[.to], member[.msg]]] return[call[.doJoin, parameter[]]] end[}] END[}]
Keyword[public] identifier[M] identifier[switchTo] operator[SEP] identifier[K] identifier[to] , identifier[M] identifier[msg] operator[SEP] { identifier[doFork] operator[SEP] identifier[to] , identifier[msg] operator[SEP] operator[SEP] Keyword[return] identifier[doJoin] operator[SEP] operator[SEP] operator[SEP] }
public static VAlarm procedure(Trigger trigger, String path) { VAlarm alarm = new VAlarm(Action.procedure(), trigger); alarm.setDescription(path); return alarm; }
class class_name[name] begin[{] method[procedure, return_type[type[VAlarm]], modifier[public static], parameter[trigger, path]] begin[{] local_variable[type[VAlarm], alarm] call[alarm.setDescription, parameter[member[.path]]] return[member[.alarm]] end[}] END[}]
Keyword[public] Keyword[static] identifier[VAlarm] identifier[procedure] operator[SEP] identifier[Trigger] identifier[trigger] , identifier[String] identifier[path] operator[SEP] { identifier[VAlarm] identifier[alarm] operator[=] Keyword[new] identifier[VAlarm] operator[SEP] identifier[Action] operator[SEP] identifier[procedure] operator[SEP] operator[SEP] , identifier[trigger] operator[SEP] operator[SEP] identifier[alarm] operator[SEP] identifier[setDescription] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[return] identifier[alarm] operator[SEP] }
public Observable<ServiceResponse<Page<StampCapacityInner>>> listCapacitiesSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.listCapacities(resourceGroupName, name, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<StampCapacityInner>>>>() { @Override public Observable<ServiceResponse<Page<StampCapacityInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<StampCapacityInner>> result = listCapacitiesDelegate(response); return Observable.just(new ServiceResponse<Page<StampCapacityInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[listCapacitiesSinglePageAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, name]] begin[{] if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.name], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter name is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[service.listCapacities, parameter[member[.resourceGroupName], member[.name], THIS[member[None.client]call[None.subscriptionId, parameter[]]], THIS[member[None.client]call[None.apiVersion, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[StampCapacityInner] operator[>] operator[>] operator[>] identifier[listCapacitiesSinglePageAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[service] operator[SEP] identifier[listCapacities] operator[SEP] identifier[resourceGroupName] , identifier[name] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[StampCapacityInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[StampCapacityInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[PageImpl] operator[<] identifier[StampCapacityInner] operator[>] operator[>] identifier[result] operator[=] identifier[listCapacitiesDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] Keyword[new] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[StampCapacityInner] operator[>] operator[>] operator[SEP] identifier[result] operator[SEP] identifier[body] operator[SEP] operator[SEP] , identifier[result] operator[SEP] identifier[response] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
private void initializeUnknownCategoricalsPerColumn(GenModel model) { unknownCategoricalsPerColumn = new ConcurrentHashMap<>(); for (int i = 0; i < model.getNumCols(); i++) { String[] domainValues = model.getDomainValues(i); if (domainValues != null) { unknownCategoricalsPerColumn.put(model.getNames()[i], new AtomicLong()); } } unknownCategoricalsPerColumn = Collections.unmodifiableMap(unknownCategoricalsPerColumn); }
class class_name[name] begin[{] method[initializeUnknownCategoricalsPerColumn, return_type[void], modifier[private], parameter[model]] begin[{] assign[member[.unknownCategoricalsPerColumn], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ConcurrentHashMap, sub_type=None))] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDomainValues, postfix_operators=[], prefix_operators=[], qualifier=model, selectors=[], type_arguments=None), name=domainValues)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=domainValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNames, postfix_operators=[], prefix_operators=[], qualifier=model, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AtomicLong, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=unknownCategoricalsPerColumn, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumCols, postfix_operators=[], prefix_operators=[], qualifier=model, 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) assign[member[.unknownCategoricalsPerColumn], call[Collections.unmodifiableMap, parameter[member[.unknownCategoricalsPerColumn]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[initializeUnknownCategoricalsPerColumn] operator[SEP] identifier[GenModel] identifier[model] operator[SEP] { identifier[unknownCategoricalsPerColumn] operator[=] Keyword[new] identifier[ConcurrentHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[model] operator[SEP] identifier[getNumCols] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[domainValues] operator[=] identifier[model] operator[SEP] identifier[getDomainValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[domainValues] operator[!=] Other[null] operator[SEP] { identifier[unknownCategoricalsPerColumn] operator[SEP] identifier[put] operator[SEP] identifier[model] operator[SEP] identifier[getNames] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] , Keyword[new] identifier[AtomicLong] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[unknownCategoricalsPerColumn] operator[=] identifier[Collections] operator[SEP] identifier[unmodifiableMap] operator[SEP] identifier[unknownCategoricalsPerColumn] operator[SEP] operator[SEP] }
private Vector3d getReferenceAxisCylic() { if (rotationGroup.getPointGroup().equals("C2")) { Vector3d vr = new Vector3d(subunits.getOriginalCenters().get(0)); vr.sub(subunits.getCentroid()); vr.normalize(); return vr; } // get principal axis vector that is perpendicular to the principal // rotation vector Vector3d vmin = null; double dotMin = 1.0; for (Vector3d v: principalAxesOfInertia) { if (Math.abs(principalRotationVector.dot(v)) < dotMin) { dotMin = Math.abs(principalRotationVector.dot(v)); vmin = new Vector3d(v); } } if (principalRotationVector.dot(vmin) < 0) { vmin.negate(); } return vmin; }
class class_name[name] begin[{] method[getReferenceAxisCylic, return_type[type[Vector3d]], modifier[private], parameter[]] begin[{] if[call[rotationGroup.getPointGroup, parameter[]]] begin[{] local_variable[type[Vector3d], vr] call[vr.sub, parameter[call[subunits.getCentroid, parameter[]]]] call[vr.normalize, parameter[]] return[member[.vr]] else begin[{] None end[}] local_variable[type[Vector3d], vmin] local_variable[type[double], dotMin] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dot, postfix_operators=[], prefix_operators=[], qualifier=principalRotationVector, selectors=[], type_arguments=None)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=MemberReference(member=dotMin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dotMin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dot, postfix_operators=[], prefix_operators=[], qualifier=principalRotationVector, selectors=[], type_arguments=None)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=vmin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=v, 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=Vector3d, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=principalAxesOfInertia, 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=Vector3d, sub_type=None))), label=None) if[binary_operation[call[principalRotationVector.dot, parameter[member[.vmin]]], <, literal[0]]] begin[{] call[vmin.negate, parameter[]] else begin[{] None end[}] return[member[.vmin]] end[}] END[}]
Keyword[private] identifier[Vector3d] identifier[getReferenceAxisCylic] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[rotationGroup] operator[SEP] identifier[getPointGroup] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[Vector3d] identifier[vr] operator[=] Keyword[new] identifier[Vector3d] operator[SEP] identifier[subunits] operator[SEP] identifier[getOriginalCenters] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[vr] operator[SEP] identifier[sub] operator[SEP] identifier[subunits] operator[SEP] identifier[getCentroid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[vr] operator[SEP] identifier[normalize] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[vr] operator[SEP] } identifier[Vector3d] identifier[vmin] operator[=] Other[null] operator[SEP] Keyword[double] identifier[dotMin] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] identifier[Vector3d] identifier[v] operator[:] identifier[principalAxesOfInertia] operator[SEP] { Keyword[if] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[principalRotationVector] operator[SEP] identifier[dot] operator[SEP] identifier[v] operator[SEP] operator[SEP] operator[<] identifier[dotMin] operator[SEP] { identifier[dotMin] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[principalRotationVector] operator[SEP] identifier[dot] operator[SEP] identifier[v] operator[SEP] operator[SEP] operator[SEP] identifier[vmin] operator[=] Keyword[new] identifier[Vector3d] operator[SEP] identifier[v] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[principalRotationVector] operator[SEP] identifier[dot] operator[SEP] identifier[vmin] operator[SEP] operator[<] Other[0] operator[SEP] { identifier[vmin] operator[SEP] identifier[negate] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[vmin] operator[SEP] }
public void checkInactiveSession(Session session) { if (session == null) { return; } if (log.isDebugEnabled()) { log.debug("Checking for idle " + session.getId()); } try (Lock ignored = session.lock()) { if (getEvictionPolicy() > 0 && session.isIdleLongerThan(getEvictionPolicy()) && session.isValid() && session.isResident() && session.getRequests() <= 0) { // Be careful with saveOnInactiveEviction - you may be able to re-animate a session that was // being managed on another node and has expired. try { if (log.isDebugEnabled()) { log.debug("Evicting idle session " + session.getId()); } // save before evicting if (isSaveOnInactiveEviction() && sessionDataStore != null) { if (sessionDataStore.isPassivating()) { sessionHandler.willPassivate(session); } sessionDataStore.store(session.getId(), session.getSessionData()); } doDelete(session.getId()); // detach from this cache session.setResident(false); } catch (Exception e) { log.warn("Passivation of idle session" + session.getId() + " failed", e); session.updateInactivityTimer(); } } } }
class class_name[name] begin[{] method[checkInactiveSession, return_type[void], modifier[public], parameter[session]] begin[{] if[binary_operation[member[.session], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[binary_operation[literal["Checking for idle "], +, call[session.getId, parameter[]]]]] else begin[{] None end[}] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEvictionPolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEvictionPolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=isIdleLongerThan, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=isValid, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=isResident, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRequests, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Evicting idle session "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isSaveOnInactiveEviction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=sessionDataStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isPassivating, postfix_operators=[], prefix_operators=[], qualifier=sessionDataStore, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=willPassivate, postfix_operators=[], prefix_operators=[], qualifier=sessionHandler, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSessionData, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None)], member=store, postfix_operators=[], prefix_operators=[], qualifier=sessionDataStore, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None)], member=doDelete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setResident, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Passivation of idle session"), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" failed"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=updateInactivityTimer, postfix_operators=[], prefix_operators=[], qualifier=session, 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)]))], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=ignored, type=ReferenceType(arguments=None, dimensions=[], name=Lock, sub_type=None), value=MethodInvocation(arguments=[], member=lock, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None))]) end[}] END[}]
Keyword[public] Keyword[void] identifier[checkInactiveSession] operator[SEP] identifier[Session] identifier[session] operator[SEP] { Keyword[if] operator[SEP] identifier[session] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[session] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] operator[SEP] identifier[Lock] identifier[ignored] operator[=] identifier[session] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[getEvictionPolicy] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] identifier[session] operator[SEP] identifier[isIdleLongerThan] operator[SEP] identifier[getEvictionPolicy] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[session] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[&&] identifier[session] operator[SEP] identifier[isResident] operator[SEP] operator[SEP] operator[&&] identifier[session] operator[SEP] identifier[getRequests] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[session] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isSaveOnInactiveEviction] operator[SEP] operator[SEP] operator[&&] identifier[sessionDataStore] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[sessionDataStore] operator[SEP] identifier[isPassivating] operator[SEP] operator[SEP] operator[SEP] { identifier[sessionHandler] operator[SEP] identifier[willPassivate] operator[SEP] identifier[session] operator[SEP] operator[SEP] } identifier[sessionDataStore] operator[SEP] identifier[store] operator[SEP] identifier[session] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[session] operator[SEP] identifier[getSessionData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[doDelete] operator[SEP] identifier[session] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[setResident] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[session] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[updateInactivityTimer] operator[SEP] operator[SEP] operator[SEP] } } } }
public static DeviceBindLocationResult deviceBindLocation( String accessToken, DeviceBindLocation deviceBindLocation) { return deviceBindLocation(accessToken, JsonUtil.toJSONString(deviceBindLocation)); }
class class_name[name] begin[{] method[deviceBindLocation, return_type[type[DeviceBindLocationResult]], modifier[public static], parameter[accessToken, deviceBindLocation]] begin[{] return[call[.deviceBindLocation, parameter[member[.accessToken], call[JsonUtil.toJSONString, parameter[member[.deviceBindLocation]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DeviceBindLocationResult] identifier[deviceBindLocation] operator[SEP] identifier[String] identifier[accessToken] , identifier[DeviceBindLocation] identifier[deviceBindLocation] operator[SEP] { Keyword[return] identifier[deviceBindLocation] operator[SEP] identifier[accessToken] , identifier[JsonUtil] operator[SEP] identifier[toJSONString] operator[SEP] identifier[deviceBindLocation] operator[SEP] operator[SEP] operator[SEP] }
public static DataSource createDataSource(final File yamlFile) throws SQLException, IOException { YamlRootMasterSlaveConfiguration config = YamlEngine.unmarshal(yamlFile, YamlRootMasterSlaveConfiguration.class); return MasterSlaveDataSourceFactory.createDataSource(config.getDataSources(), new MasterSlaveRuleConfigurationYamlSwapper().swap(config.getMasterSlaveRule()), config.getProps()); }
class class_name[name] begin[{] method[createDataSource, return_type[type[DataSource]], modifier[public static], parameter[yamlFile]] begin[{] local_variable[type[YamlRootMasterSlaveConfiguration], config] return[call[MasterSlaveDataSourceFactory.createDataSource, parameter[call[config.getDataSources, parameter[]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMasterSlaveRule, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None)], member=swap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=MasterSlaveRuleConfigurationYamlSwapper, sub_type=None)), call[config.getProps, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DataSource] identifier[createDataSource] operator[SEP] Keyword[final] identifier[File] identifier[yamlFile] operator[SEP] Keyword[throws] identifier[SQLException] , identifier[IOException] { identifier[YamlRootMasterSlaveConfiguration] identifier[config] operator[=] identifier[YamlEngine] operator[SEP] identifier[unmarshal] operator[SEP] identifier[yamlFile] , identifier[YamlRootMasterSlaveConfiguration] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[MasterSlaveDataSourceFactory] operator[SEP] identifier[createDataSource] operator[SEP] identifier[config] operator[SEP] identifier[getDataSources] operator[SEP] operator[SEP] , Keyword[new] identifier[MasterSlaveRuleConfigurationYamlSwapper] operator[SEP] operator[SEP] operator[SEP] identifier[swap] operator[SEP] identifier[config] operator[SEP] identifier[getMasterSlaveRule] operator[SEP] operator[SEP] operator[SEP] , identifier[config] operator[SEP] identifier[getProps] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }