code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
private LanguageData findLanguage(final String locale) { for (final LanguageData languageData : languageDataDAO.getAll()) { if (languageData.getLanguageCode().equalsIgnoreCase(locale)) { return languageData; } } return null; }
class class_name[name] begin[{] method[findLanguage, return_type[type[LanguageData]], modifier[private], parameter[locale]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getLanguageCode, postfix_operators=[], prefix_operators=[], qualifier=languageData, selectors=[MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, 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=[ReturnStatement(expression=MemberReference(member=languageData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAll, postfix_operators=[], prefix_operators=[], qualifier=languageDataDAO, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=languageData)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=LanguageData, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[private] identifier[LanguageData] identifier[findLanguage] operator[SEP] Keyword[final] identifier[String] identifier[locale] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[LanguageData] identifier[languageData] operator[:] identifier[languageDataDAO] operator[SEP] identifier[getAll] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[languageData] operator[SEP] identifier[getLanguageCode] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[locale] operator[SEP] operator[SEP] { Keyword[return] identifier[languageData] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public boolean setColumnValue(int iColumnIndex, Object value, boolean bDisplay, int iMoveMode) { Convert fieldInfo = this.getFieldInfo(iColumnIndex); if (fieldInfo != null) { Object dataBefore = fieldInfo.getData(); if (!(value instanceof String)) fieldInfo.setData(value, bDisplay, iMoveMode); else fieldInfo.setString((String)value, bDisplay, iMoveMode); Object dataAfter = fieldInfo.getData(); if (dataBefore == null) return (dataAfter != null); else return (!dataBefore.equals(dataAfter)); } return false; }
class class_name[name] begin[{] method[setColumnValue, return_type[type[boolean]], modifier[public], parameter[iColumnIndex, value, bDisplay, iMoveMode]] begin[{] local_variable[type[Convert], fieldInfo] if[binary_operation[member[.fieldInfo], !=, literal[null]]] begin[{] local_variable[type[Object], dataBefore] if[binary_operation[member[.value], instanceof, type[String]]] begin[{] call[fieldInfo.setData, parameter[member[.value], member[.bDisplay], member[.iMoveMode]]] else begin[{] call[fieldInfo.setString, parameter[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), member[.bDisplay], member[.iMoveMode]]] end[}] local_variable[type[Object], dataAfter] if[binary_operation[member[.dataBefore], ==, literal[null]]] begin[{] return[binary_operation[member[.dataAfter], !=, literal[null]]] else begin[{] return[call[dataBefore.equals, parameter[member[.dataAfter]]]] end[}] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[setColumnValue] operator[SEP] Keyword[int] identifier[iColumnIndex] , identifier[Object] identifier[value] , Keyword[boolean] identifier[bDisplay] , Keyword[int] identifier[iMoveMode] operator[SEP] { identifier[Convert] identifier[fieldInfo] operator[=] Keyword[this] operator[SEP] identifier[getFieldInfo] operator[SEP] identifier[iColumnIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fieldInfo] operator[!=] Other[null] operator[SEP] { identifier[Object] identifier[dataBefore] operator[=] identifier[fieldInfo] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[value] Keyword[instanceof] identifier[String] operator[SEP] operator[SEP] identifier[fieldInfo] operator[SEP] identifier[setData] operator[SEP] identifier[value] , identifier[bDisplay] , identifier[iMoveMode] operator[SEP] operator[SEP] Keyword[else] identifier[fieldInfo] operator[SEP] identifier[setString] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[value] , identifier[bDisplay] , identifier[iMoveMode] operator[SEP] operator[SEP] identifier[Object] identifier[dataAfter] operator[=] identifier[fieldInfo] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dataBefore] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[dataAfter] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[else] Keyword[return] operator[SEP] operator[!] identifier[dataBefore] operator[SEP] identifier[equals] operator[SEP] identifier[dataAfter] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public ValueMap withBinarySet(String key, byte[] ... val) { super.put(key, new LinkedHashSet<byte[]>(Arrays.asList(val))); return this; }
class class_name[name] begin[{] method[withBinarySet, return_type[type[ValueMap]], modifier[public], parameter[key, val]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=val, 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=BasicType(dimensions=[None], name=byte))], dimensions=None, name=LinkedHashSet, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ValueMap] identifier[withBinarySet] operator[SEP] identifier[String] identifier[key] , Keyword[byte] operator[SEP] operator[SEP] operator[...] identifier[val] operator[SEP] { Keyword[super] operator[SEP] identifier[put] operator[SEP] identifier[key] , Keyword[new] identifier[LinkedHashSet] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[val] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public Message5WH_Builder setWhere(Object where, RecognitionException lineAndColumn){ if(where!=null && lineAndColumn!=null){ IsAntlrRuntimeObject iaro = IsAntlrRuntimeObject.create(lineAndColumn); this.setWhere(where, iaro.getLine(), iaro.getColumn()); } return this; }
class class_name[name] begin[{] method[setWhere, return_type[type[Message5WH_Builder]], modifier[public], parameter[where, lineAndColumn]] begin[{] if[binary_operation[binary_operation[member[.where], !=, literal[null]], &&, binary_operation[member[.lineAndColumn], !=, literal[null]]]] begin[{] local_variable[type[IsAntlrRuntimeObject], iaro] THIS[call[None.setWhere, parameter[member[.where], call[iaro.getLine, parameter[]], call[iaro.getColumn, parameter[]]]]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Message5WH_Builder] identifier[setWhere] operator[SEP] identifier[Object] identifier[where] , identifier[RecognitionException] identifier[lineAndColumn] operator[SEP] { Keyword[if] operator[SEP] identifier[where] operator[!=] Other[null] operator[&&] identifier[lineAndColumn] operator[!=] Other[null] operator[SEP] { identifier[IsAntlrRuntimeObject] identifier[iaro] operator[=] identifier[IsAntlrRuntimeObject] operator[SEP] identifier[create] operator[SEP] identifier[lineAndColumn] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setWhere] operator[SEP] identifier[where] , identifier[iaro] operator[SEP] identifier[getLine] operator[SEP] operator[SEP] , identifier[iaro] operator[SEP] identifier[getColumn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
protected void handleStream() { inboundStreamHandler.handle(new ISignalWriteStream() { boolean streamFinished = false; @Override public void write(IApimanBuffer buffer) { if (streamFinished) { throw new IllegalStateException("Attempted write after #end() was called."); //$NON-NLS-1$ } requestChain.write(buffer); } @Override public void end() { requestChain.end(); streamFinished = true; } /** * @see io.apiman.gateway.engine.io.IAbortable#abort() */ @Override public void abort(Throwable t) { // If this is called, it means that something went wrong on the inbound // side of things - so we need to make sure we abort and cleanup the // api connector resources. We'll also call handle() on the result // handler so that the caller knows something went wrong. streamFinished = true; apiConnection.abort(t); resultHandler.handle(AsyncResultImpl.<IEngineResult>create(new RequestAbortedException(t))); } @Override public boolean isFinished() { return streamFinished; } @Override public void drainHandler(IAsyncHandler<Void> drainHandler) { apiConnection.drainHandler(drainHandler); } @Override public boolean isFull() { return apiConnection.isFull(); } }); }
class class_name[name] begin[{] method[handleStream, return_type[void], modifier[protected], parameter[]] begin[{] call[inboundStreamHandler.handle, parameter[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=streamFinished)], documentation=None, modifiers=set(), type=BasicType(dimensions=[], name=boolean)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=MemberReference(member=streamFinished, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attempted write after #end() was called.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=requestChain, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=write, parameters=[FormalParameter(annotations=[], modifiers=set(), name=buffer, type=ReferenceType(arguments=None, dimensions=[], name=IApimanBuffer, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=end, postfix_operators=[], prefix_operators=[], qualifier=requestChain, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=streamFinished, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], documentation=None, modifiers={'public'}, name=end, parameters=[], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=streamFinished, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=abort, postfix_operators=[], prefix_operators=[], qualifier=apiConnection, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=t, 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=RequestAbortedException, sub_type=None))], member=AsyncResultImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IEngineResult, sub_type=None))])], member=handle, postfix_operators=[], prefix_operators=[], qualifier=resultHandler, selectors=[], type_arguments=None), label=None)], documentation=/** * @see io.apiman.gateway.engine.io.IAbortable#abort() */, modifiers={'public'}, name=abort, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=streamFinished, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=isFinished, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=drainHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=drainHandler, postfix_operators=[], prefix_operators=[], qualifier=apiConnection, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=drainHandler, parameters=[FormalParameter(annotations=[], modifiers=set(), name=drainHandler, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=[], name=IAsyncHandler, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isFull, postfix_operators=[], prefix_operators=[], qualifier=apiConnection, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=isFull, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ISignalWriteStream, sub_type=None))]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[handleStream] operator[SEP] operator[SEP] { identifier[inboundStreamHandler] operator[SEP] identifier[handle] operator[SEP] Keyword[new] identifier[ISignalWriteStream] operator[SEP] operator[SEP] { Keyword[boolean] identifier[streamFinished] operator[=] literal[boolean] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[IApimanBuffer] identifier[buffer] operator[SEP] { Keyword[if] operator[SEP] identifier[streamFinished] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[requestChain] operator[SEP] identifier[write] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[end] operator[SEP] operator[SEP] { identifier[requestChain] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] identifier[streamFinished] operator[=] literal[boolean] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[abort] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[streamFinished] operator[=] literal[boolean] operator[SEP] identifier[apiConnection] operator[SEP] identifier[abort] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[resultHandler] operator[SEP] identifier[handle] operator[SEP] identifier[AsyncResultImpl] operator[SEP] operator[<] identifier[IEngineResult] operator[>] identifier[create] operator[SEP] Keyword[new] identifier[RequestAbortedException] operator[SEP] identifier[t] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isFinished] operator[SEP] operator[SEP] { Keyword[return] identifier[streamFinished] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[drainHandler] operator[SEP] identifier[IAsyncHandler] operator[<] identifier[Void] operator[>] identifier[drainHandler] operator[SEP] { identifier[apiConnection] operator[SEP] identifier[drainHandler] operator[SEP] identifier[drainHandler] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isFull] operator[SEP] operator[SEP] { Keyword[return] identifier[apiConnection] operator[SEP] identifier[isFull] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
@Override public void indexInsert(int index, KType key, VType value) { assert index < 0 : "The index must not point at an existing key."; index = ~index; if (Intrinsics.<KType> isEmpty(key)) { assert index == mask + 1; values[index] = value; hasEmptyKey = true; } else { assert Intrinsics.<KType> isEmpty(keys[index]); if (assigned == resizeAt) { allocateThenInsertThenRehash(index, key, value); } else { keys[index] = key; values[index] = value; } assigned++; } }
class class_name[name] begin[{] method[indexInsert, return_type[void], modifier[public], parameter[index, key, value]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The index must not point at an existing key.")) assign[member[.index], member[.index]] if[call[.Intrinsics, parameter[member[.key]]]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=mask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator===), label=None, value=None) assign[member[.values], member[.value]] assign[member[.hasEmptyKey], literal[true]] else begin[{] AssertStatement(condition=MethodInvocation(arguments=[MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=Intrinsics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=KType, sub_type=None))]), label=None, value=None) if[binary_operation[member[.assigned], ==, member[.resizeAt]]] begin[{] call[.allocateThenInsertThenRehash, parameter[member[.index], member[.key], member[.value]]] else begin[{] assign[member[.keys], member[.key]] assign[member[.values], member[.value]] end[}] member[.assigned] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[indexInsert] operator[SEP] Keyword[int] identifier[index] , identifier[KType] identifier[key] , identifier[VType] identifier[value] operator[SEP] { Keyword[assert] identifier[index] operator[<] Other[0] operator[:] literal[String] operator[SEP] identifier[index] operator[=] operator[~] identifier[index] operator[SEP] Keyword[if] operator[SEP] identifier[Intrinsics] operator[SEP] operator[<] identifier[KType] operator[>] identifier[isEmpty] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[assert] identifier[index] operator[==] identifier[mask] operator[+] Other[1] operator[SEP] identifier[values] operator[SEP] identifier[index] operator[SEP] operator[=] identifier[value] operator[SEP] identifier[hasEmptyKey] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[assert] identifier[Intrinsics] operator[SEP] operator[<] identifier[KType] operator[>] identifier[isEmpty] operator[SEP] identifier[keys] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[assigned] operator[==] identifier[resizeAt] operator[SEP] { identifier[allocateThenInsertThenRehash] operator[SEP] identifier[index] , identifier[key] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] { identifier[keys] operator[SEP] identifier[index] operator[SEP] operator[=] identifier[key] operator[SEP] identifier[values] operator[SEP] identifier[index] operator[SEP] operator[=] identifier[value] operator[SEP] } identifier[assigned] operator[++] operator[SEP] } }
public static String getTableNameForAppid(String appIdentifier) { if (StringUtils.isBlank(appIdentifier)) { return null; } else { if (isSharedAppid(appIdentifier)) { // app is sharing a table with other apps appIdentifier = SHARED_TABLE; } return (App.isRoot(appIdentifier) || appIdentifier.startsWith(Config.PARA.concat("-"))) ? appIdentifier : Config.PARA + "-" + appIdentifier; } }
class class_name[name] begin[{] method[getTableNameForAppid, return_type[type[String]], modifier[public static], parameter[appIdentifier]] begin[{] if[call[StringUtils.isBlank, parameter[member[.appIdentifier]]]] begin[{] return[literal[null]] else begin[{] if[call[.isSharedAppid, parameter[member[.appIdentifier]]]] begin[{] assign[member[.appIdentifier], member[.SHARED_TABLE]] else begin[{] None end[}] return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=appIdentifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isRoot, postfix_operators=[], prefix_operators=[], qualifier=App, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=concat, postfix_operators=[], prefix_operators=[], qualifier=Config.PARA, selectors=[], type_arguments=None)], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=appIdentifier, selectors=[], type_arguments=None), operator=||), if_false=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PARA, postfix_operators=[], prefix_operators=[], qualifier=Config, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), operator=+), operandr=MemberReference(member=appIdentifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), if_true=MemberReference(member=appIdentifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getTableNameForAppid] operator[SEP] identifier[String] identifier[appIdentifier] operator[SEP] { Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[appIdentifier] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[isSharedAppid] operator[SEP] identifier[appIdentifier] operator[SEP] operator[SEP] { identifier[appIdentifier] operator[=] identifier[SHARED_TABLE] operator[SEP] } Keyword[return] operator[SEP] identifier[App] operator[SEP] identifier[isRoot] operator[SEP] identifier[appIdentifier] operator[SEP] operator[||] identifier[appIdentifier] operator[SEP] identifier[startsWith] operator[SEP] identifier[Config] operator[SEP] identifier[PARA] operator[SEP] identifier[concat] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[appIdentifier] operator[:] identifier[Config] operator[SEP] identifier[PARA] operator[+] literal[String] operator[+] identifier[appIdentifier] operator[SEP] } }
public static double matthewsCorrelation(long tp, long fp, long fn, long tn) { double numerator = ((double) tp) * tn - ((double) fp) * fn; double denominator = Math.sqrt(((double) tp + fp) * (tp + fn) * (tn + fp) * (tn + fn)); return numerator / denominator; }
class class_name[name] begin[{] method[matthewsCorrelation, return_type[type[double]], modifier[public static], parameter[tp, fp, fn, tn]] begin[{] local_variable[type[double], numerator] local_variable[type[double], denominator] return[binary_operation[member[.numerator], /, member[.denominator]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[matthewsCorrelation] operator[SEP] Keyword[long] identifier[tp] , Keyword[long] identifier[fp] , Keyword[long] identifier[fn] , Keyword[long] identifier[tn] operator[SEP] { Keyword[double] identifier[numerator] operator[=] operator[SEP] operator[SEP] Keyword[double] operator[SEP] identifier[tp] operator[SEP] operator[*] identifier[tn] operator[-] operator[SEP] operator[SEP] Keyword[double] operator[SEP] identifier[fp] operator[SEP] operator[*] identifier[fn] operator[SEP] Keyword[double] identifier[denominator] operator[=] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] identifier[tp] operator[+] identifier[fp] operator[SEP] operator[*] operator[SEP] identifier[tp] operator[+] identifier[fn] operator[SEP] operator[*] operator[SEP] identifier[tn] operator[+] identifier[fp] operator[SEP] operator[*] operator[SEP] identifier[tn] operator[+] identifier[fn] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[numerator] operator[/] identifier[denominator] operator[SEP] }
public Order startInstanceById(String id, String operator) { return startInstanceById(id, operator, null); }
class class_name[name] begin[{] method[startInstanceById, return_type[type[Order]], modifier[public], parameter[id, operator]] begin[{] return[call[.startInstanceById, parameter[member[.id], member[.operator], literal[null]]]] end[}] END[}]
Keyword[public] identifier[Order] identifier[startInstanceById] operator[SEP] identifier[String] identifier[id] , identifier[String] identifier[operator] operator[SEP] { Keyword[return] identifier[startInstanceById] operator[SEP] identifier[id] , identifier[operator] , Other[null] operator[SEP] operator[SEP] }
public static <I, O> ListenableFuture<O> transform(ListenableFuture<I> input, AsyncFunction<? super I, ? extends O> function) { ChainingListenableFuture<I, O> output = new ChainingListenableFuture<I, O>(function, input); input.addListener(output, directExecutor()); return output; }
class class_name[name] begin[{] method[transform, return_type[type[ListenableFuture]], modifier[public static], parameter[input, function]] begin[{] local_variable[type[ChainingListenableFuture], output] call[input.addListener, parameter[member[.output], call[.directExecutor, parameter[]]]] return[member[.output]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[I] , identifier[O] operator[>] identifier[ListenableFuture] operator[<] identifier[O] operator[>] identifier[transform] operator[SEP] identifier[ListenableFuture] operator[<] identifier[I] operator[>] identifier[input] , identifier[AsyncFunction] operator[<] operator[?] Keyword[super] identifier[I] , operator[?] Keyword[extends] identifier[O] operator[>] identifier[function] operator[SEP] { identifier[ChainingListenableFuture] operator[<] identifier[I] , identifier[O] operator[>] identifier[output] operator[=] Keyword[new] identifier[ChainingListenableFuture] operator[<] identifier[I] , identifier[O] operator[>] operator[SEP] identifier[function] , identifier[input] operator[SEP] operator[SEP] identifier[input] operator[SEP] identifier[addListener] operator[SEP] identifier[output] , identifier[directExecutor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[output] operator[SEP] }
public String apply(String word) { Matcher matcher = pattern.matcher(word); if (!matcher.matches()) { throw new IllegalArgumentException("Word '" + word + "' does not match regex: " + pattern.pattern()); } return replace(matcher); }
class class_name[name] begin[{] method[apply, return_type[type[String]], modifier[public], parameter[word]] begin[{] local_variable[type[Matcher], matcher] if[call[matcher.matches, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Word '"), operandr=MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' does not match regex: "), operator=+), operandr=MethodInvocation(arguments=[], member=pattern, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[.replace, parameter[member[.matcher]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[apply] operator[SEP] identifier[String] identifier[word] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[pattern] operator[SEP] identifier[matcher] operator[SEP] identifier[word] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[word] operator[+] literal[String] operator[+] identifier[pattern] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[replace] operator[SEP] identifier[matcher] operator[SEP] operator[SEP] }
public void setDialogTitle(String singleKey) { // generate title using the resource name as parameter for the key String resourceName = CmsStringUtil.formatResourceName(getParamResource(), 50); setParamTitle(key(singleKey, new Object[] {resourceName})); }
class class_name[name] begin[{] method[setDialogTitle, return_type[void], modifier[public], parameter[singleKey]] begin[{] local_variable[type[String], resourceName] call[.setParamTitle, parameter[call[.key, parameter[member[.singleKey], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDialogTitle] operator[SEP] identifier[String] identifier[singleKey] operator[SEP] { identifier[String] identifier[resourceName] operator[=] identifier[CmsStringUtil] operator[SEP] identifier[formatResourceName] operator[SEP] identifier[getParamResource] operator[SEP] operator[SEP] , Other[50] operator[SEP] operator[SEP] identifier[setParamTitle] operator[SEP] identifier[key] operator[SEP] identifier[singleKey] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[resourceName] } operator[SEP] operator[SEP] operator[SEP] }
public void allowX11Forwarding(String display, File f) throws SshException { if (remoteforwardings.containsKey(X11_KEY)) throw new SshException("X11 forwarding is already in use!", SshException.FORWARDING_ERROR); if (!incomingtunnels.containsKey(X11_KEY)) { incomingtunnels.put(X11_KEY, new Vector<ActiveTunnel>()); } ssh.getContext().setX11Display(display); ssh.getContext().setX11RequestListener(forwardinglistener); try { // Find the users real cookie if (f.exists()) { String hostname = ""; int screen = 0; int idx = display.indexOf(':'); if (idx != -1) { hostname = display.substring(0, idx); screen = Integer.parseInt(display.substring(idx + 1)); } FileInputStream in = new FileInputStream(f); ByteArrayOutputStream out = new ByteArrayOutputStream(); int read; while ((read = in.read()) != -1) out.write(read); in.close(); byte[] tmp = out.toByteArray(); ByteArrayReader bar = new ByteArrayReader(tmp); try { while (bar.available() > 0) { short family = bar.readShort(); short len = bar.readShort(); byte[] address = new byte[len]; bar.read(address); len = bar.readShort(); byte[] number = new byte[len]; bar.read(number); len = bar.readShort(); byte[] name = new byte[len]; bar.read(name); len = bar.readShort(); byte[] data = new byte[len]; bar.read(data); String n = new String(number); int d = Integer.parseInt(n); String protocol = new String(name); if (protocol.equals("MIT-MAGIC-COOKIE-1")) { if (family == 0) { // We cannot use InetAddress.getByAddress since // it // was only introduced in 1.4 :( // So we're going to do this really crude // formating // of the IP Address and get by name // which works just as well! String ip = (address[0] & 0xFF) + "." + (address[1] & 0xFF) + "." + (address[2] & 0xFF) + "." + (address[3] & 0xFF); InetAddress addr = java.net.InetAddress .getByName(ip); if (addr.getHostAddress().equals(hostname) || addr.getHostName().equals(hostname)) { if (screen == d) { ssh.getContext().setX11RealCookie(data); break; } } } else if (family == 256) { String h = new String(address); if (h.equals(hostname)) { if (screen == d) { ssh.getContext().setX11RealCookie(data); break; } } } } } } finally { bar.close(); } } String hostname = "localhost"; int screen = 0; int idx = display.indexOf(':'); if (idx != -1) { hostname = display.substring(0, idx); display = display.substring(idx + 1); } if ((idx = display.indexOf('.')) > -1) { screen = Integer.parseInt(display.substring(idx + 1)); } for (int i = 0; i < clientlisteners.size(); i++) { ((ForwardingClientListener) clientlisteners.elementAt(i)) .forwardingStarted( ForwardingClientListener.X11_FORWARDING, X11_KEY, hostname, screen); } isXForwarding = true; } catch (IOException ioe) { throw new SshException(ioe.getMessage(), SshException.FORWARDING_ERROR); } }
class class_name[name] begin[{] method[allowX11Forwarding, return_type[void], modifier[public], parameter[display, f]] begin[{] if[call[remoteforwardings.containsKey, parameter[member[.X11_KEY]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="X11 forwarding is already in use!"), MemberReference(member=FORWARDING_ERROR, postfix_operators=[], prefix_operators=[], qualifier=SshException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SshException, sub_type=None)), label=None) else begin[{] None end[}] if[call[incomingtunnels.containsKey, parameter[member[.X11_KEY]]]] begin[{] call[incomingtunnels.put, parameter[member[.X11_KEY], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ActiveTunnel, sub_type=None))], dimensions=None, name=Vector, sub_type=None))]] else begin[{] None end[}] call[ssh.getContext, parameter[]] call[ssh.getContext, parameter[]] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=hostname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=screen)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=display, selectors=[], type_arguments=None), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hostname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=display, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=screen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=display, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None)), name=in)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None)), name=out)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=read)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), name=tmp)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=tmp, 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=ByteArrayReader, sub_type=None)), name=bar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayReader, sub_type=None)), TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readShort, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None), name=family)], modifiers=set(), type=BasicType(dimensions=[], name=short)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readShort, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None), name=len)], modifiers=set(), type=BasicType(dimensions=[], name=short)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=address)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readShort, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=number)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readShort, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=name)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readShort, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=data)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=n)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=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=String, sub_type=None)), name=protocol)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MIT-MAGIC-COOKIE-1")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=protocol, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=family, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=family, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=h)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=hostname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=h, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=screen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getContext, postfix_operators=[], prefix_operators=[], qualifier=ssh, selectors=[MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setX11RealCookie, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))]))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), operator=+), name=ip)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByName, postfix_operators=[], prefix_operators=[], qualifier=java.net.InetAddress, selectors=[], type_arguments=None), name=addr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InetAddress, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHostAddress, postfix_operators=[], prefix_operators=[], qualifier=addr, selectors=[MethodInvocation(arguments=[MemberReference(member=hostname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getHostName, postfix_operators=[], prefix_operators=[], qualifier=addr, selectors=[MethodInvocation(arguments=[MemberReference(member=hostname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=screen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getContext, postfix_operators=[], prefix_operators=[], qualifier=ssh, selectors=[MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setX11RealCookie, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))]))]))]))]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=available, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=bar, selectors=[], type_arguments=None), label=None)], label=None, resources=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="localhost"), name=hostname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=screen)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=display, selectors=[], type_arguments=None), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hostname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=display, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=display, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=display, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=display, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=screen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=display, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAt, postfix_operators=[], prefix_operators=[], qualifier=clientlisteners, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ForwardingClientListener, sub_type=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=clientlisteners, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isXForwarding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ioe, selectors=[], type_arguments=None), MemberReference(member=FORWARDING_ERROR, postfix_operators=[], prefix_operators=[], qualifier=SshException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SshException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[allowX11Forwarding] operator[SEP] identifier[String] identifier[display] , identifier[File] identifier[f] operator[SEP] Keyword[throws] identifier[SshException] { Keyword[if] operator[SEP] identifier[remoteforwardings] operator[SEP] identifier[containsKey] operator[SEP] identifier[X11_KEY] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SshException] operator[SEP] literal[String] , identifier[SshException] operator[SEP] identifier[FORWARDING_ERROR] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[incomingtunnels] operator[SEP] identifier[containsKey] operator[SEP] identifier[X11_KEY] operator[SEP] operator[SEP] { identifier[incomingtunnels] operator[SEP] identifier[put] operator[SEP] identifier[X11_KEY] , Keyword[new] identifier[Vector] operator[<] identifier[ActiveTunnel] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ssh] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[setX11Display] operator[SEP] identifier[display] operator[SEP] operator[SEP] identifier[ssh] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[setX11RequestListener] operator[SEP] identifier[forwardinglistener] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[hostname] operator[=] literal[String] operator[SEP] Keyword[int] identifier[screen] operator[=] Other[0] operator[SEP] Keyword[int] identifier[idx] operator[=] identifier[display] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[idx] operator[!=] operator[-] Other[1] operator[SEP] { identifier[hostname] operator[=] identifier[display] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[idx] operator[SEP] operator[SEP] identifier[screen] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[display] operator[SEP] identifier[substring] operator[SEP] identifier[idx] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] } identifier[FileInputStream] identifier[in] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[f] operator[SEP] operator[SEP] identifier[ByteArrayOutputStream] identifier[out] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[read] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[read] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[read] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[tmp] operator[=] identifier[out] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] identifier[ByteArrayReader] identifier[bar] operator[=] Keyword[new] identifier[ByteArrayReader] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] Keyword[try] { Keyword[while] operator[SEP] identifier[bar] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[short] identifier[family] operator[=] identifier[bar] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] Keyword[short] identifier[len] operator[=] identifier[bar] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[address] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[len] operator[SEP] operator[SEP] identifier[bar] operator[SEP] identifier[read] operator[SEP] identifier[address] operator[SEP] operator[SEP] identifier[len] operator[=] identifier[bar] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[number] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[len] operator[SEP] operator[SEP] identifier[bar] operator[SEP] identifier[read] operator[SEP] identifier[number] operator[SEP] operator[SEP] identifier[len] operator[=] identifier[bar] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[name] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[len] operator[SEP] operator[SEP] identifier[bar] operator[SEP] identifier[read] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[len] operator[=] identifier[bar] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[len] operator[SEP] operator[SEP] identifier[bar] operator[SEP] identifier[read] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[String] identifier[n] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[number] operator[SEP] operator[SEP] Keyword[int] identifier[d] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[n] operator[SEP] operator[SEP] identifier[String] identifier[protocol] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[protocol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[family] operator[==] Other[0] operator[SEP] { identifier[String] identifier[ip] operator[=] operator[SEP] identifier[address] operator[SEP] Other[0] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[address] operator[SEP] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[address] operator[SEP] Other[2] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[address] operator[SEP] Other[3] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[InetAddress] identifier[addr] operator[=] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[InetAddress] operator[SEP] identifier[getByName] operator[SEP] identifier[ip] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[addr] operator[SEP] identifier[getHostAddress] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[hostname] operator[SEP] operator[||] identifier[addr] operator[SEP] identifier[getHostName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[hostname] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[screen] operator[==] identifier[d] operator[SEP] { identifier[ssh] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[setX11RealCookie] operator[SEP] identifier[data] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[family] operator[==] Other[256] operator[SEP] { identifier[String] identifier[h] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[address] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[h] operator[SEP] identifier[equals] operator[SEP] identifier[hostname] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[screen] operator[==] identifier[d] operator[SEP] { identifier[ssh] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[setX11RealCookie] operator[SEP] identifier[data] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } } } } } Keyword[finally] { identifier[bar] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } identifier[String] identifier[hostname] operator[=] literal[String] operator[SEP] Keyword[int] identifier[screen] operator[=] Other[0] operator[SEP] Keyword[int] identifier[idx] operator[=] identifier[display] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[idx] operator[!=] operator[-] Other[1] operator[SEP] { identifier[hostname] operator[=] identifier[display] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[idx] operator[SEP] operator[SEP] identifier[display] operator[=] identifier[display] operator[SEP] identifier[substring] operator[SEP] identifier[idx] operator[+] Other[1] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[idx] operator[=] identifier[display] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[>] operator[-] Other[1] operator[SEP] { identifier[screen] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[display] operator[SEP] identifier[substring] operator[SEP] identifier[idx] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[clientlisteners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { operator[SEP] operator[SEP] identifier[ForwardingClientListener] operator[SEP] identifier[clientlisteners] operator[SEP] identifier[elementAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[forwardingStarted] operator[SEP] identifier[ForwardingClientListener] operator[SEP] identifier[X11_FORWARDING] , identifier[X11_KEY] , identifier[hostname] , identifier[screen] operator[SEP] operator[SEP] } identifier[isXForwarding] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { Keyword[throw] Keyword[new] identifier[SshException] operator[SEP] identifier[ioe] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[SshException] operator[SEP] identifier[FORWARDING_ERROR] operator[SEP] operator[SEP] } }
public Event getEvent(String sherdogUrl) throws IOException, ParseException, SherdogParserException { return new EventParser(zoneId).parse(sherdogUrl); }
class class_name[name] begin[{] method[getEvent, return_type[type[Event]], modifier[public], parameter[sherdogUrl]] begin[{] return[ClassCreator(arguments=[MemberReference(member=zoneId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=sherdogUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=EventParser, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Event] identifier[getEvent] operator[SEP] identifier[String] identifier[sherdogUrl] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ParseException] , identifier[SherdogParserException] { Keyword[return] Keyword[new] identifier[EventParser] operator[SEP] identifier[zoneId] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[sherdogUrl] operator[SEP] operator[SEP] }
protected void createIndexesOnColumns(EntityMetadata m, String tableName, List<Column> columns, Class columnType) { Object pooledConnection = null; try { Cassandra.Client api = null; pooledConnection = getConnection(); api = (org.apache.cassandra.thrift.Cassandra.Client) getConnection(pooledConnection); KsDef ksDef = api.describe_keyspace(m.getSchema()); List<CfDef> cfDefs = ksDef.getCf_defs(); // Column family definition on which secondary index creation is // required CfDef columnFamilyDefToUpdate = null; boolean isUpdatable = false; for (CfDef cfDef : cfDefs) { if (cfDef.getName().equals(tableName)) { columnFamilyDefToUpdate = cfDef; break; } } if (columnFamilyDefToUpdate == null) { log.error("Join table {} not available.", tableName); throw new PersistenceException("table" + tableName + " not found!"); } // create a column family, in case it is not already available. // Get list of indexes already created List<ColumnDef> columnMetadataList = columnFamilyDefToUpdate.getColumn_metadata(); List<String> indexList = new ArrayList<String>(); if (columnMetadataList != null) { for (ColumnDef columnDef : columnMetadataList) { indexList.add(new StringAccessor().fromBytes(String.class, columnDef.getName())); } // need to set them to null else it is giving problem on update // column family and trying to add again existing indexes. // columnFamilyDefToUpdate.column_metadata = null; } // Iterate over all columns for creating secondary index on them for (Column column : columns) { ColumnDef columnDef = new ColumnDef(); columnDef.setName(column.getName()); columnDef.setValidation_class(CassandraValidationClassMapper.getValidationClass(columnType, false)); columnDef.setIndex_type(IndexType.KEYS); // Add secondary index only if it's not already created // (if already created, it would be there in column family // definition) if (!indexList.contains(new StringAccessor().fromBytes(String.class, column.getName()))) { isUpdatable = true; columnFamilyDefToUpdate.addToColumn_metadata(columnDef); } } // Finally, update column family with modified column family // definition if (isUpdatable) { columnFamilyDefToUpdate.setKey_validation_class(CassandraValidationClassMapper .getValidationClass(m.getIdAttribute().getJavaType(), isCql3Enabled(m))); api.system_update_column_family(columnFamilyDefToUpdate); } } catch (Exception e) { log.warn("Could not create secondary index on column family {}, Caused by: . ", tableName, e); } finally { releaseConnection(pooledConnection); } }
class class_name[name] begin[{] method[createIndexesOnColumns, return_type[void], modifier[protected], parameter[m, tableName, columns, columnType]] begin[{] local_variable[type[Object], pooledConnection] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=api)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cassandra, sub_type=ReferenceType(arguments=None, dimensions=None, name=Client, sub_type=None))), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pooledConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=api, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=pooledConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=apache, sub_type=ReferenceType(arguments=None, dimensions=None, name=cassandra, sub_type=ReferenceType(arguments=None, dimensions=None, name=thrift, sub_type=ReferenceType(arguments=None, dimensions=None, name=Cassandra, sub_type=ReferenceType(arguments=None, dimensions=None, name=Client, sub_type=None)))))))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSchema, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=describe_keyspace, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[], type_arguments=None), name=ksDef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KsDef, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCf_defs, postfix_operators=[], prefix_operators=[], qualifier=ksDef, selectors=[], type_arguments=None), name=cfDefs)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CfDef, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=columnFamilyDefToUpdate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CfDef, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=isUpdatable)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=cfDef, selectors=[MethodInvocation(arguments=[MemberReference(member=tableName, 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=Assignment(expressionl=MemberReference(member=columnFamilyDefToUpdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=cfDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=cfDefs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cfDef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CfDef, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=columnFamilyDefToUpdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Join table {} not available."), MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="table"), operandr=MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not found!"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PersistenceException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getColumn_metadata, postfix_operators=[], prefix_operators=[], qualifier=columnFamilyDefToUpdate, selectors=[], type_arguments=None), name=columnMetadataList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ColumnDef, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=indexList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=columnMetadataList, 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=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=columnDef, selectors=[], type_arguments=None)], member=fromBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringAccessor, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=indexList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=columnMetadataList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=columnDef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColumnDef, sub_type=None))), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ColumnDef, sub_type=None)), name=columnDef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColumnDef, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=columnDef, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=columnType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getValidationClass, postfix_operators=[], prefix_operators=[], qualifier=CassandraValidationClassMapper, selectors=[], type_arguments=None)], member=setValidation_class, postfix_operators=[], prefix_operators=[], qualifier=columnDef, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=KEYS, postfix_operators=[], prefix_operators=[], qualifier=IndexType, selectors=[])], member=setIndex_type, postfix_operators=[], prefix_operators=[], qualifier=columnDef, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None)], member=fromBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringAccessor, sub_type=None))], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=indexList, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isUpdatable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=columnDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addToColumn_metadata, postfix_operators=[], prefix_operators=[], qualifier=columnFamilyDefToUpdate, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=column)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Column, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=isUpdatable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIdAttribute, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=getJavaType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isCql3Enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getValidationClass, postfix_operators=[], prefix_operators=[], qualifier=CassandraValidationClassMapper, selectors=[], type_arguments=None)], member=setKey_validation_class, postfix_operators=[], prefix_operators=[], qualifier=columnFamilyDefToUpdate, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=columnFamilyDefToUpdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=system_update_column_family, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not create secondary index on column family {}, Caused by: . "), MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pooledConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=releaseConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[createIndexesOnColumns] operator[SEP] identifier[EntityMetadata] identifier[m] , identifier[String] identifier[tableName] , identifier[List] operator[<] identifier[Column] operator[>] identifier[columns] , identifier[Class] identifier[columnType] operator[SEP] { identifier[Object] identifier[pooledConnection] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[Cassandra] operator[SEP] identifier[Client] identifier[api] operator[=] Other[null] operator[SEP] identifier[pooledConnection] operator[=] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[api] operator[=] operator[SEP] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[cassandra] operator[SEP] identifier[thrift] operator[SEP] identifier[Cassandra] operator[SEP] identifier[Client] operator[SEP] identifier[getConnection] operator[SEP] identifier[pooledConnection] operator[SEP] operator[SEP] identifier[KsDef] identifier[ksDef] operator[=] identifier[api] operator[SEP] identifier[describe_keyspace] operator[SEP] identifier[m] operator[SEP] identifier[getSchema] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CfDef] operator[>] identifier[cfDefs] operator[=] identifier[ksDef] operator[SEP] identifier[getCf_defs] operator[SEP] operator[SEP] operator[SEP] identifier[CfDef] identifier[columnFamilyDefToUpdate] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[isUpdatable] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[CfDef] identifier[cfDef] operator[:] identifier[cfDefs] operator[SEP] { Keyword[if] operator[SEP] identifier[cfDef] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[tableName] operator[SEP] operator[SEP] { identifier[columnFamilyDefToUpdate] operator[=] identifier[cfDef] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[columnFamilyDefToUpdate] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[tableName] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[PersistenceException] operator[SEP] literal[String] operator[+] identifier[tableName] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[ColumnDef] operator[>] identifier[columnMetadataList] operator[=] identifier[columnFamilyDefToUpdate] operator[SEP] identifier[getColumn_metadata] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[indexList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[columnMetadataList] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[ColumnDef] identifier[columnDef] operator[:] identifier[columnMetadataList] operator[SEP] { identifier[indexList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[StringAccessor] operator[SEP] operator[SEP] operator[SEP] identifier[fromBytes] operator[SEP] identifier[String] operator[SEP] Keyword[class] , identifier[columnDef] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[Column] identifier[column] operator[:] identifier[columns] operator[SEP] { identifier[ColumnDef] identifier[columnDef] operator[=] Keyword[new] identifier[ColumnDef] operator[SEP] operator[SEP] operator[SEP] identifier[columnDef] operator[SEP] identifier[setName] operator[SEP] identifier[column] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[columnDef] operator[SEP] identifier[setValidation_class] operator[SEP] identifier[CassandraValidationClassMapper] operator[SEP] identifier[getValidationClass] operator[SEP] identifier[columnType] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[columnDef] operator[SEP] identifier[setIndex_type] operator[SEP] identifier[IndexType] operator[SEP] identifier[KEYS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[indexList] operator[SEP] identifier[contains] operator[SEP] Keyword[new] identifier[StringAccessor] operator[SEP] operator[SEP] operator[SEP] identifier[fromBytes] operator[SEP] identifier[String] operator[SEP] Keyword[class] , identifier[column] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[isUpdatable] operator[=] literal[boolean] operator[SEP] identifier[columnFamilyDefToUpdate] operator[SEP] identifier[addToColumn_metadata] operator[SEP] identifier[columnDef] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[isUpdatable] operator[SEP] { identifier[columnFamilyDefToUpdate] operator[SEP] identifier[setKey_validation_class] operator[SEP] identifier[CassandraValidationClassMapper] operator[SEP] identifier[getValidationClass] operator[SEP] identifier[m] operator[SEP] identifier[getIdAttribute] operator[SEP] operator[SEP] operator[SEP] identifier[getJavaType] operator[SEP] operator[SEP] , identifier[isCql3Enabled] operator[SEP] identifier[m] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[api] operator[SEP] identifier[system_update_column_family] operator[SEP] identifier[columnFamilyDefToUpdate] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[tableName] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[releaseConnection] operator[SEP] identifier[pooledConnection] operator[SEP] operator[SEP] } }
public void listClusters() { System.out.println("\nListing Clusters"); // [START bigtable_get_clusters] try { List<Cluster> clusters = adminClient.listClusters(instanceId); for (Cluster cluster : clusters) { System.out.println(cluster.getId()); } } catch (NotFoundException e) { System.err.println("Failed to list clusters from a non-existent instance: " + e.getMessage()); } // [END bigtable_get_clusters] }
class class_name[name] begin[{] method[listClusters, return_type[void], modifier[public], parameter[]] begin[{] call[System.out.println, parameter[literal["\nListing Clusters"]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=instanceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listClusters, postfix_operators=[], prefix_operators=[], qualifier=adminClient, selectors=[], type_arguments=None), name=clusters)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Cluster, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=clusters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cluster)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cluster, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to list clusters from a non-existent instance: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NotFoundException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[listClusters] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[List] operator[<] identifier[Cluster] operator[>] identifier[clusters] operator[=] identifier[adminClient] operator[SEP] identifier[listClusters] operator[SEP] identifier[instanceId] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Cluster] identifier[cluster] operator[:] identifier[clusters] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[cluster] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NotFoundException] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public void check(Connection conn, String scName, Collection<String> tbNames) throws IllegalMetaDataException { if (scName == null) { throw new IllegalArgumentException("[Check MetaData Failed] parameter 'scName' can't be null"); } if (tbNames == null || tbNames.isEmpty()) { throw new IllegalArgumentException("[Check MetaData Failed] parameter 'tbNames' can't be empty"); } try { Set<String> set = getAllTables(conn, scName); if (set == null || set.isEmpty()) { throw new IllegalMetaDataException( "[Check MetaData Failed] Schema:'" + scName + "' has nothing tables. but in your configuration it requires table:" + DDRJSONUtils.toJSONString(tbNames)); } for (String tbName : tbNames) { if (!set.contains(tbName)) { throw new IllegalMetaDataException("[Check MetaData Failed] Schema:'" + scName + "' only has tables:" + DDRJSONUtils.toJSONString(set) + ", but in your configuration it requires table:" + tbName); } } } catch (SQLException e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[check, return_type[void], modifier[public], parameter[conn, scName, tbNames]] begin[{] if[binary_operation[member[.scName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[Check MetaData Failed] parameter 'scName' can't 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[binary_operation[member[.tbNames], ==, literal[null]], ||, call[tbNames.isEmpty, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[Check MetaData Failed] parameter 'tbNames' can't be empty")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAllTables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=set)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[Check MetaData Failed] Schema:'"), operandr=MemberReference(member=scName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' has nothing tables. but in your configuration it requires table:"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=tbNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toJSONString, postfix_operators=[], prefix_operators=[], qualifier=DDRJSONUtils, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalMetaDataException, sub_type=None)), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tbName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=set, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[Check MetaData Failed] Schema:'"), operandr=MemberReference(member=scName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' only has tables:"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toJSONString, postfix_operators=[], prefix_operators=[], qualifier=DDRJSONUtils, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", but in your configuration it requires table:"), operator=+), operandr=MemberReference(member=tbName, 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=IllegalMetaDataException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=tbNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tbName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[check] operator[SEP] identifier[Connection] identifier[conn] , identifier[String] identifier[scName] , identifier[Collection] operator[<] identifier[String] operator[>] identifier[tbNames] operator[SEP] Keyword[throws] identifier[IllegalMetaDataException] { Keyword[if] operator[SEP] identifier[scName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tbNames] operator[==] Other[null] operator[||] identifier[tbNames] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[Set] operator[<] identifier[String] operator[>] identifier[set] operator[=] identifier[getAllTables] operator[SEP] identifier[conn] , identifier[scName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[set] operator[==] Other[null] operator[||] identifier[set] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalMetaDataException] operator[SEP] literal[String] operator[+] identifier[scName] operator[+] literal[String] operator[+] identifier[DDRJSONUtils] operator[SEP] identifier[toJSONString] operator[SEP] identifier[tbNames] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[tbName] operator[:] identifier[tbNames] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[set] operator[SEP] identifier[contains] operator[SEP] identifier[tbName] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalMetaDataException] operator[SEP] literal[String] operator[+] identifier[scName] operator[+] literal[String] operator[+] identifier[DDRJSONUtils] operator[SEP] identifier[toJSONString] operator[SEP] identifier[set] operator[SEP] operator[+] literal[String] operator[+] identifier[tbName] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public boolean validateModcaString(String modcaString, DiagnosticChain diagnostics, Map<Object, Object> context) { return true; }
class class_name[name] begin[{] method[validateModcaString, return_type[type[boolean]], modifier[public], parameter[modcaString, diagnostics, context]] begin[{] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[validateModcaString] operator[SEP] identifier[String] identifier[modcaString] , identifier[DiagnosticChain] identifier[diagnostics] , identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[context] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] }
public Card update(CardUpdateOnCustomerParams params, RequestOptions options) throws StripeException { String url; if (this.getCustomer() != null) { url = String.format( "%s%s", Stripe.getApiBase(), String.format( "/v1/customers/%s/sources/%s", ApiResource.urlEncodeId(this.getCustomer()), ApiResource.urlEncodeId(this.getId()))); } else { throw new InvalidRequestException( "Unable to construct url because [customer] field(s) are all null", null, null, null, 0, null); } return request(ApiResource.RequestMethod.POST, url, params, Card.class, options); }
class class_name[name] begin[{] method[update, return_type[type[Card]], modifier[public], parameter[params, options]] begin[{] local_variable[type[String], url] if[binary_operation[THIS[call[None.getCustomer, parameter[]]], !=, literal[null]]] begin[{] assign[member[.url], call[String.format, parameter[literal["%s%s"], call[Stripe.getApiBase, parameter[]], call[String.format, parameter[literal["/v1/customers/%s/sources/%s"], call[ApiResource.urlEncodeId, parameter[THIS[call[None.getCustomer, parameter[]]]]], call[ApiResource.urlEncodeId, parameter[THIS[call[None.getId, parameter[]]]]]]]]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to construct url because [customer] field(s) are all null"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), 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=InvalidRequestException, sub_type=None)), label=None) end[}] return[call[.request, parameter[member[ApiResource.RequestMethod.POST], member[.url], member[.params], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Card, sub_type=None)), member[.options]]]] end[}] END[}]
Keyword[public] identifier[Card] identifier[update] operator[SEP] identifier[CardUpdateOnCustomerParams] identifier[params] , identifier[RequestOptions] identifier[options] operator[SEP] Keyword[throws] identifier[StripeException] { identifier[String] identifier[url] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getCustomer] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[url] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[Stripe] operator[SEP] identifier[getApiBase] operator[SEP] operator[SEP] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[ApiResource] operator[SEP] identifier[urlEncodeId] operator[SEP] Keyword[this] operator[SEP] identifier[getCustomer] operator[SEP] operator[SEP] operator[SEP] , identifier[ApiResource] operator[SEP] identifier[urlEncodeId] operator[SEP] Keyword[this] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[InvalidRequestException] operator[SEP] literal[String] , Other[null] , Other[null] , Other[null] , Other[0] , Other[null] operator[SEP] operator[SEP] } Keyword[return] identifier[request] operator[SEP] identifier[ApiResource] operator[SEP] identifier[RequestMethod] operator[SEP] identifier[POST] , identifier[url] , identifier[params] , identifier[Card] operator[SEP] Keyword[class] , identifier[options] operator[SEP] operator[SEP] }
public static <T1, T2, T3> TriPredicate<T1, T2, T3> predicate(TriFunction<T1, T2, T3, Boolean> function) { dbc.precondition(function != null, "cannot adapt a null function"); return function::apply; }
class class_name[name] begin[{] method[predicate, return_type[type[TriPredicate]], modifier[public static], parameter[function]] begin[{] call[dbc.precondition, parameter[binary_operation[member[.function], !=, literal[null]], literal["cannot adapt a null function"]]] return[MethodReference(expression=MemberReference(member=function, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=apply, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T1] , identifier[T2] , identifier[T3] operator[>] identifier[TriPredicate] operator[<] identifier[T1] , identifier[T2] , identifier[T3] operator[>] identifier[predicate] operator[SEP] identifier[TriFunction] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[Boolean] operator[>] identifier[function] operator[SEP] { identifier[dbc] operator[SEP] identifier[precondition] operator[SEP] identifier[function] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[function] operator[::] identifier[apply] operator[SEP] }
public ArrayList<String> license_windows_serviceName_upgrade_GET(String serviceName, OvhWindowsSqlVersionEnum sqlVersion, OvhWindowsOsVersionEnum version) throws IOException { String qPath = "/order/license/windows/{serviceName}/upgrade"; StringBuilder sb = path(qPath, serviceName); query(sb, "sqlVersion", sqlVersion); query(sb, "version", version); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t1); }
class class_name[name] begin[{] method[license_windows_serviceName_upgrade_GET, return_type[type[ArrayList]], modifier[public], parameter[serviceName, sqlVersion, version]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] call[.query, parameter[member[.sb], literal["sqlVersion"], member[.sqlVersion]]] call[.query, parameter[member[.sb], literal["version"], member[.version]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], member[.t1]]]] end[}] END[}]
Keyword[public] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[license_windows_serviceName_upgrade_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[OvhWindowsSqlVersionEnum] identifier[sqlVersion] , identifier[OvhWindowsOsVersionEnum] identifier[version] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[sqlVersion] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[version] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[t1] operator[SEP] operator[SEP] }
public ValueMap putValue(String key, Object value) { delegate.put(key, value); return this; }
class class_name[name] begin[{] method[putValue, return_type[type[ValueMap]], modifier[public], parameter[key, value]] begin[{] call[delegate.put, parameter[member[.key], member[.value]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ValueMap] identifier[putValue] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] { identifier[delegate] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static final Object removeList(Object bean, String property) { return doFor( bean, property, null, (Object a, int i)->{throw new UnsupportedOperationException("not supported");}, (List l, int i)->{return l.remove(i);}, (Object b, Class c, String p)->{throw new UnsupportedOperationException("not supported");}, (Object b, Method m)->{throw new UnsupportedOperationException("not supported");} ); }
class class_name[name] begin[{] method[removeList, return_type[type[Object]], modifier[final public static], parameter[bean, property]] begin[{] return[call[.doFor, parameter[member[.bean], member[.property], literal[null], LambdaExpression(body=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not supported")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], parameters=[FormalParameter(annotations=[], modifiers=set(), name=a, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=i, type=BasicType(dimensions=[], name=int), varargs=False)]), LambdaExpression(body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None)], parameters=[FormalParameter(annotations=[], modifiers=set(), name=l, type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=i, type=BasicType(dimensions=[], name=int), varargs=False)]), LambdaExpression(body=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not supported")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], parameters=[FormalParameter(annotations=[], modifiers=set(), name=b, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=c, type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=p, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)]), LambdaExpression(body=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not supported")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], parameters=[FormalParameter(annotations=[], modifiers=set(), name=b, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=m, type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None), varargs=False)])]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] identifier[Object] identifier[removeList] operator[SEP] identifier[Object] identifier[bean] , identifier[String] identifier[property] operator[SEP] { Keyword[return] identifier[doFor] operator[SEP] identifier[bean] , identifier[property] , Other[null] , operator[SEP] identifier[Object] identifier[a] , Keyword[int] identifier[i] operator[SEP] operator[->] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } , operator[SEP] identifier[List] identifier[l] , Keyword[int] identifier[i] operator[SEP] operator[->] { Keyword[return] identifier[l] operator[SEP] identifier[remove] operator[SEP] identifier[i] operator[SEP] operator[SEP] } , operator[SEP] identifier[Object] identifier[b] , identifier[Class] identifier[c] , identifier[String] identifier[p] operator[SEP] operator[->] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } , operator[SEP] identifier[Object] identifier[b] , identifier[Method] identifier[m] operator[SEP] operator[->] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] }
public ServiceFuture<TagValueInner> createOrUpdateValueAsync(String tagName, String tagValue, final ServiceCallback<TagValueInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateValueWithServiceResponseAsync(tagName, tagValue), serviceCallback); }
class class_name[name] begin[{] method[createOrUpdateValueAsync, return_type[type[ServiceFuture]], modifier[public], parameter[tagName, tagValue, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.createOrUpdateValueWithServiceResponseAsync, parameter[member[.tagName], member[.tagValue]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[TagValueInner] operator[>] identifier[createOrUpdateValueAsync] operator[SEP] identifier[String] identifier[tagName] , identifier[String] identifier[tagValue] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[TagValueInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[createOrUpdateValueWithServiceResponseAsync] operator[SEP] identifier[tagName] , identifier[tagValue] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public Pipeline withReprocessingSummaries(ReprocessingSummary... reprocessingSummaries) { if (this.reprocessingSummaries == null) { setReprocessingSummaries(new java.util.ArrayList<ReprocessingSummary>(reprocessingSummaries.length)); } for (ReprocessingSummary ele : reprocessingSummaries) { this.reprocessingSummaries.add(ele); } return this; }
class class_name[name] begin[{] method[withReprocessingSummaries, return_type[type[Pipeline]], modifier[public], parameter[reprocessingSummaries]] begin[{] if[binary_operation[THIS[member[None.reprocessingSummaries]], ==, literal[null]]] begin[{] call[.setReprocessingSummaries, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=reprocessingSummaries, 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=ReprocessingSummary, 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=reprocessingSummaries, 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=reprocessingSummaries, 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=ReprocessingSummary, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[Pipeline] identifier[withReprocessingSummaries] operator[SEP] identifier[ReprocessingSummary] operator[...] identifier[reprocessingSummaries] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[reprocessingSummaries] operator[==] Other[null] operator[SEP] { identifier[setReprocessingSummaries] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ReprocessingSummary] operator[>] operator[SEP] identifier[reprocessingSummaries] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ReprocessingSummary] identifier[ele] operator[:] identifier[reprocessingSummaries] operator[SEP] { Keyword[this] operator[SEP] identifier[reprocessingSummaries] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override public Set<URI> listOperations(URI serviceUri) { if (serviceUri == null || !serviceUri.isAbsolute()) { log.warn("The Service URI is either absent or relative. Provide an absolute URI"); return ImmutableSet.of(); } URI graphUri; try { graphUri = getGraphUriForElement(serviceUri); } catch (URISyntaxException e) { log.warn("The namespace of the URI of the service is incorrect.", e); return ImmutableSet.of(); } if (graphUri == null) { log.warn("Could not obtain a graph URI for the element. The URI may not be managed by the server - " + serviceUri); return ImmutableSet.of(); } String queryStr = new StringBuilder() .append("SELECT DISTINCT ?op WHERE { \n") .append(" GRAPH <").append(graphUri.toASCIIString()).append("> { \n") .append(" <").append(serviceUri.toASCIIString()).append("> ").append("<").append(MSM.hasOperation.getURI()).append(">").append(" ?op . ") .append(" ?op ").append("<").append(RDF.type.getURI()).append(">").append(" ").append("<").append(MSM.Operation.getURI()).append("> . \n") .append(" } \n ") .append("} \n ") .toString(); return this.graphStoreManager.listResourcesByQuery(queryStr, "op"); }
class class_name[name] begin[{] method[listOperations, return_type[type[Set]], modifier[public], parameter[serviceUri]] begin[{] if[binary_operation[binary_operation[member[.serviceUri], ==, literal[null]], ||, call[serviceUri.isAbsolute, parameter[]]]] begin[{] call[log.warn, parameter[literal["The Service URI is either absent or relative. Provide an absolute URI"]]] return[call[ImmutableSet.of, parameter[]]] else begin[{] None end[}] local_variable[type[URI], graphUri] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=graphUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=serviceUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGraphUriForElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The namespace of the URI of the service is incorrect."), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=of, postfix_operators=[], prefix_operators=[], qualifier=ImmutableSet, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.graphUri], ==, literal[null]]] begin[{] call[log.warn, parameter[binary_operation[literal["Could not obtain a graph URI for the element. The URI may not be managed by the server - "], +, member[.serviceUri]]]] return[call[ImmutableSet.of, parameter[]]] else begin[{] None end[}] local_variable[type[String], queryStr] return[THIS[member[None.graphStoreManager]call[None.listResourcesByQuery, parameter[member[.queryStr], literal["op"]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[URI] operator[>] identifier[listOperations] operator[SEP] identifier[URI] identifier[serviceUri] operator[SEP] { Keyword[if] operator[SEP] identifier[serviceUri] operator[==] Other[null] operator[||] operator[!] identifier[serviceUri] operator[SEP] identifier[isAbsolute] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[ImmutableSet] operator[SEP] identifier[of] operator[SEP] operator[SEP] operator[SEP] } identifier[URI] identifier[graphUri] operator[SEP] Keyword[try] { identifier[graphUri] operator[=] identifier[getGraphUriForElement] operator[SEP] identifier[serviceUri] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] identifier[ImmutableSet] operator[SEP] identifier[of] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[graphUri] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[serviceUri] operator[SEP] operator[SEP] Keyword[return] identifier[ImmutableSet] operator[SEP] identifier[of] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[queryStr] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[graphUri] operator[SEP] identifier[toASCIIString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[serviceUri] operator[SEP] identifier[toASCIIString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[MSM] operator[SEP] identifier[hasOperation] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[RDF] operator[SEP] identifier[type] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[MSM] operator[SEP] identifier[Operation] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[graphStoreManager] operator[SEP] identifier[listResourcesByQuery] operator[SEP] identifier[queryStr] , literal[String] operator[SEP] operator[SEP] }
public JsDestinationAddress getRoutingDestination() { String name = (String)jmo.getField(ControlAccess.ROUTINGDESTINATION_VALUE_NAME); /* If the name is null, the RoutingDestination has never been set. */ if (name != null) { byte[] b = (byte[])jmo.getField(ControlAccess.ROUTINGDESTINATION_VALUE_MEID); return new JsDestinationAddressImpl(name ,false ,(b == null) ? null : new SIBUuid8(b) ,(String)jmo.getField(ControlAccess.ROUTINGDESTINATION_VALUE_BUSNAME) ); } else { return null; } }
class class_name[name] begin[{] method[getRoutingDestination, return_type[type[JsDestinationAddress]], modifier[public], parameter[]] begin[{] local_variable[type[String], name] if[binary_operation[member[.name], !=, literal[null]]] begin[{] local_variable[type[byte], b] return[ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=ClassCreator(arguments=[MemberReference(member=b, 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=SIBUuid8, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), Cast(expression=MethodInvocation(arguments=[MemberReference(member=ROUTINGDESTINATION_VALUE_BUSNAME, postfix_operators=[], prefix_operators=[], qualifier=ControlAccess, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=jmo, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsDestinationAddressImpl, sub_type=None))] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] identifier[JsDestinationAddress] identifier[getRoutingDestination] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[jmo] operator[SEP] identifier[getField] operator[SEP] identifier[ControlAccess] operator[SEP] identifier[ROUTINGDESTINATION_VALUE_NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[!=] Other[null] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[jmo] operator[SEP] identifier[getField] operator[SEP] identifier[ControlAccess] operator[SEP] identifier[ROUTINGDESTINATION_VALUE_MEID] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[JsDestinationAddressImpl] operator[SEP] identifier[name] , literal[boolean] , operator[SEP] identifier[b] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] Keyword[new] identifier[SIBUuid8] operator[SEP] identifier[b] operator[SEP] , operator[SEP] identifier[String] operator[SEP] identifier[jmo] operator[SEP] identifier[getField] operator[SEP] identifier[ControlAccess] operator[SEP] identifier[ROUTINGDESTINATION_VALUE_BUSNAME] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
public ServiceFuture<ListLabsResponseInner> listLabsAsync(String userName, final ServiceCallback<ListLabsResponseInner> serviceCallback) { return ServiceFuture.fromResponse(listLabsWithServiceResponseAsync(userName), serviceCallback); }
class class_name[name] begin[{] method[listLabsAsync, return_type[type[ServiceFuture]], modifier[public], parameter[userName, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.listLabsWithServiceResponseAsync, parameter[member[.userName]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[ListLabsResponseInner] operator[>] identifier[listLabsAsync] operator[SEP] identifier[String] identifier[userName] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[ListLabsResponseInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[listLabsWithServiceResponseAsync] operator[SEP] identifier[userName] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException { Entry<Collection<? extends Callable<T>>, TaskLifeCycleCallback[]> entry = createCallbacks(tasks); tasks = entry.getKey(); TaskLifeCycleCallback[] callbacks = entry.getValue(); // Policy executor can optimize the last task in the list to run on the current thread if we submit under the same executor, PolicyExecutor executor = callbacks.length > 0 ? callbacks[callbacks.length - 1].policyExecutor : policyExecutor; return (List) executor.invokeAll(tasks, callbacks); }
class class_name[name] begin[{] method[invokeAll, return_type[type[List]], modifier[public], parameter[tasks]] begin[{] local_variable[type[Entry], entry] assign[member[.tasks], call[entry.getKey, parameter[]]] local_variable[type[TaskLifeCycleCallback], callbacks] local_variable[type[PolicyExecutor], executor] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=tasks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callbacks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invokeAll, postfix_operators=[], prefix_operators=[], qualifier=executor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[Future] operator[<] identifier[T] operator[>] operator[>] identifier[invokeAll] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[Callable] operator[<] identifier[T] operator[>] operator[>] identifier[tasks] operator[SEP] Keyword[throws] identifier[InterruptedException] { identifier[Entry] operator[<] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[Callable] operator[<] identifier[T] operator[>] operator[>] , identifier[TaskLifeCycleCallback] operator[SEP] operator[SEP] operator[>] identifier[entry] operator[=] identifier[createCallbacks] operator[SEP] identifier[tasks] operator[SEP] operator[SEP] identifier[tasks] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[TaskLifeCycleCallback] operator[SEP] operator[SEP] identifier[callbacks] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[PolicyExecutor] identifier[executor] operator[=] identifier[callbacks] operator[SEP] identifier[length] operator[>] Other[0] operator[?] identifier[callbacks] operator[SEP] identifier[callbacks] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[policyExecutor] operator[:] identifier[policyExecutor] operator[SEP] Keyword[return] operator[SEP] identifier[List] operator[SEP] identifier[executor] operator[SEP] identifier[invokeAll] operator[SEP] identifier[tasks] , identifier[callbacks] operator[SEP] operator[SEP] }
@Deprecated public String encryptStr(String data, KeyType keyType) { return encryptBcd(data, keyType, CharsetUtil.CHARSET_UTF_8); }
class class_name[name] begin[{] method[encryptStr, return_type[type[String]], modifier[public], parameter[data, keyType]] begin[{] return[call[.encryptBcd, parameter[member[.data], member[.keyType], member[CharsetUtil.CHARSET_UTF_8]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] identifier[String] identifier[encryptStr] operator[SEP] identifier[String] identifier[data] , identifier[KeyType] identifier[keyType] operator[SEP] { Keyword[return] identifier[encryptBcd] operator[SEP] identifier[data] , identifier[keyType] , identifier[CharsetUtil] operator[SEP] identifier[CHARSET_UTF_8] operator[SEP] operator[SEP] }
public void setReplicationGroup(java.util.Collection<ReplicaDescription> replicationGroup) { if (replicationGroup == null) { this.replicationGroup = null; return; } this.replicationGroup = new java.util.ArrayList<ReplicaDescription>(replicationGroup); }
class class_name[name] begin[{] method[setReplicationGroup, return_type[void], modifier[public], parameter[replicationGroup]] begin[{] if[binary_operation[member[.replicationGroup], ==, literal[null]]] begin[{] assign[THIS[member[None.replicationGroup]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.replicationGroup]], ClassCreator(arguments=[MemberReference(member=replicationGroup, 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=ReplicaDescription, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setReplicationGroup] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[ReplicaDescription] operator[>] identifier[replicationGroup] operator[SEP] { Keyword[if] operator[SEP] identifier[replicationGroup] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[replicationGroup] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[replicationGroup] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ReplicaDescription] operator[>] operator[SEP] identifier[replicationGroup] operator[SEP] operator[SEP] }
public void setMobileApplicationTargeting(com.google.api.ads.admanager.axis.v201811.MobileApplicationTargeting mobileApplicationTargeting) { this.mobileApplicationTargeting = mobileApplicationTargeting; }
class class_name[name] begin[{] method[setMobileApplicationTargeting, return_type[void], modifier[public], parameter[mobileApplicationTargeting]] begin[{] assign[THIS[member[None.mobileApplicationTargeting]], member[.mobileApplicationTargeting]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setMobileApplicationTargeting] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201811] operator[SEP] identifier[MobileApplicationTargeting] identifier[mobileApplicationTargeting] operator[SEP] { Keyword[this] operator[SEP] identifier[mobileApplicationTargeting] operator[=] identifier[mobileApplicationTargeting] operator[SEP] }
public static short optionalShortAttribute( final XMLStreamReader reader, final String namespace, final String localName, final short defaultValue) { final String value = reader.getAttributeValue(namespace, localName); if (value != null) { return Short.parseShort(value); } return defaultValue; }
class class_name[name] begin[{] method[optionalShortAttribute, return_type[type[short]], modifier[public static], parameter[reader, namespace, localName, defaultValue]] begin[{] local_variable[type[String], value] if[binary_operation[member[.value], !=, literal[null]]] begin[{] return[call[Short.parseShort, parameter[member[.value]]]] else begin[{] None end[}] return[member[.defaultValue]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[short] identifier[optionalShortAttribute] operator[SEP] Keyword[final] identifier[XMLStreamReader] identifier[reader] , Keyword[final] identifier[String] identifier[namespace] , Keyword[final] identifier[String] identifier[localName] , Keyword[final] Keyword[short] identifier[defaultValue] operator[SEP] { Keyword[final] identifier[String] identifier[value] operator[=] identifier[reader] operator[SEP] identifier[getAttributeValue] operator[SEP] identifier[namespace] , identifier[localName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[Short] operator[SEP] identifier[parseShort] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[defaultValue] operator[SEP] }
private VideoFormat getLargestVideoFormat() { Format[] formats = device.getFormats(); VideoFormat format = null; int area = 0; // find the largest picture format for (Format f : formats) { if (!(f instanceof VideoFormat) || !"RGB".equalsIgnoreCase(f.getEncoding())) { continue; } VideoFormat vf = (VideoFormat) f; Dimension dim = vf.getSize(); int a = dim.width * dim.height; if (a > area) { area = a; format = vf; } } return format; }
class class_name[name] begin[{] method[getLargestVideoFormat, return_type[type[VideoFormat]], modifier[private], parameter[]] begin[{] local_variable[type[Format], formats] local_variable[type[VideoFormat], format] local_variable[type[int], area] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=VideoFormat, sub_type=None), operator=instanceof), operandr=Literal(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEncoding, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="RGB"), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=VideoFormat, sub_type=None)), name=vf)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VideoFormat, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSize, postfix_operators=[], prefix_operators=[], qualifier=vf, selectors=[], type_arguments=None), name=dim)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Dimension, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=dim, selectors=[]), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=dim, selectors=[]), operator=*), name=a)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=area, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=area, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=vf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=formats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Format, sub_type=None))), label=None) return[member[.format]] end[}] END[}]
Keyword[private] identifier[VideoFormat] identifier[getLargestVideoFormat] operator[SEP] operator[SEP] { identifier[Format] operator[SEP] operator[SEP] identifier[formats] operator[=] identifier[device] operator[SEP] identifier[getFormats] operator[SEP] operator[SEP] operator[SEP] identifier[VideoFormat] identifier[format] operator[=] Other[null] operator[SEP] Keyword[int] identifier[area] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Format] identifier[f] operator[:] identifier[formats] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[f] Keyword[instanceof] identifier[VideoFormat] operator[SEP] operator[||] operator[!] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[f] operator[SEP] identifier[getEncoding] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[VideoFormat] identifier[vf] operator[=] operator[SEP] identifier[VideoFormat] operator[SEP] identifier[f] operator[SEP] identifier[Dimension] identifier[dim] operator[=] identifier[vf] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[a] operator[=] identifier[dim] operator[SEP] identifier[width] operator[*] identifier[dim] operator[SEP] identifier[height] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[>] identifier[area] operator[SEP] { identifier[area] operator[=] identifier[a] operator[SEP] identifier[format] operator[=] identifier[vf] operator[SEP] } } Keyword[return] identifier[format] operator[SEP] }
protected void checkForOldRestStyleError(JsonNode node) { JsonNode errorCode = node.get("error_code"); if (errorCode != null) { int code = errorCode.intValue(); String msg = node.path("error_msg").asText(); this.throwCodeAndMessage(code, msg); } }
class class_name[name] begin[{] method[checkForOldRestStyleError, return_type[void], modifier[protected], parameter[node]] begin[{] local_variable[type[JsonNode], errorCode] if[binary_operation[member[.errorCode], !=, literal[null]]] begin[{] local_variable[type[int], code] local_variable[type[String], msg] THIS[call[None.throwCodeAndMessage, parameter[member[.code], member[.msg]]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[checkForOldRestStyleError] operator[SEP] identifier[JsonNode] identifier[node] operator[SEP] { identifier[JsonNode] identifier[errorCode] operator[=] identifier[node] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[errorCode] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[code] operator[=] identifier[errorCode] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[msg] operator[=] identifier[node] operator[SEP] identifier[path] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[asText] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[throwCodeAndMessage] operator[SEP] identifier[code] , identifier[msg] operator[SEP] operator[SEP] } }
public ServiceFuture<EventsResults> getAsync(String appId, EventType eventType, String eventId, String timespan, final ServiceCallback<EventsResults> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(appId, eventType, eventId, timespan), serviceCallback); }
class class_name[name] begin[{] method[getAsync, return_type[type[ServiceFuture]], modifier[public], parameter[appId, eventType, eventId, timespan, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.getWithServiceResponseAsync, parameter[member[.appId], member[.eventType], member[.eventId], member[.timespan]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[EventsResults] operator[>] identifier[getAsync] operator[SEP] identifier[String] identifier[appId] , identifier[EventType] identifier[eventType] , identifier[String] identifier[eventId] , identifier[String] identifier[timespan] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[EventsResults] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[getWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[eventType] , identifier[eventId] , identifier[timespan] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public Observable<ServiceResponse<Page<RoleAssignmentInner>>> listForResourceWithServiceResponseAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) { return listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter) .concatMap(new Func1<ServiceResponse<Page<RoleAssignmentInner>>, Observable<ServiceResponse<Page<RoleAssignmentInner>>>>() { @Override public Observable<ServiceResponse<Page<RoleAssignmentInner>>> call(ServiceResponse<Page<RoleAssignmentInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listForResourceNextWithServiceResponseAsync(nextPageLink)); } }); }
class class_name[name] begin[{] method[listForResourceWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter]] begin[{] return[call[.listForResourceSinglePageAsync, parameter[member[.resourceGroupName], member[.resourceProviderNamespace], member[.parentResourcePath], member[.resourceType], member[.resourceName], member[.filter]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RoleAssignmentInner] operator[>] operator[>] operator[>] identifier[listForResourceWithServiceResponseAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[String] identifier[resourceProviderNamespace] , Keyword[final] identifier[String] identifier[parentResourcePath] , Keyword[final] identifier[String] identifier[resourceType] , Keyword[final] identifier[String] identifier[resourceName] , Keyword[final] identifier[String] identifier[filter] operator[SEP] { Keyword[return] identifier[listForResourceSinglePageAsync] operator[SEP] identifier[resourceGroupName] , identifier[resourceProviderNamespace] , identifier[parentResourcePath] , identifier[resourceType] , identifier[resourceName] , identifier[filter] operator[SEP] operator[SEP] identifier[concatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RoleAssignmentInner] operator[>] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RoleAssignmentInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RoleAssignmentInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RoleAssignmentInner] operator[>] operator[>] identifier[page] operator[SEP] { identifier[String] identifier[nextPageLink] operator[=] identifier[page] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextPageLink] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP] } Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP] identifier[concatWith] operator[SEP] identifier[listForResourceNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
private byte readChunk() throws IOException { try { return readChunkImpl(); } catch (SocketException ex) { // Some stream implementations may throw SocketException and not EOFException when socket is // terminated by // application // By common agreement, rethrow it as EOFException and let an upstream handler take care. synchronized (orchestratorEvent) { if (shutdown) { EOFException newException = new EOFException("NGCommunicator is shutting down"); newException.initCause(ex); throw newException; } } throw ex; } }
class class_name[name] begin[{] method[readChunk, return_type[type[byte]], modifier[private], parameter[]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=readChunkImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[SynchronizedStatement(block=[IfStatement(condition=MemberReference(member=shutdown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NGCommunicator is shutting down")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EOFException, sub_type=None)), name=newException)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EOFException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=newException, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=newException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], label=None, lock=MemberReference(member=orchestratorEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ThrowStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SocketException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[byte] identifier[readChunk] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { Keyword[return] identifier[readChunkImpl] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SocketException] identifier[ex] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[orchestratorEvent] operator[SEP] { Keyword[if] operator[SEP] identifier[shutdown] operator[SEP] { identifier[EOFException] identifier[newException] operator[=] Keyword[new] identifier[EOFException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[newException] operator[SEP] identifier[initCause] operator[SEP] identifier[ex] operator[SEP] operator[SEP] Keyword[throw] identifier[newException] operator[SEP] } } Keyword[throw] identifier[ex] operator[SEP] } }
public static Set<Region> getAvailable(RegionType type) { loadRegionData(); return Collections.unmodifiableSet(availableRegions.get(type.ordinal())); }
class class_name[name] begin[{] method[getAvailable, return_type[type[Set]], modifier[public static], parameter[type]] begin[{] call[.loadRegionData, parameter[]] return[call[Collections.unmodifiableSet, parameter[call[availableRegions.get, parameter[call[type.ordinal, parameter[]]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[Region] operator[>] identifier[getAvailable] operator[SEP] identifier[RegionType] identifier[type] operator[SEP] { identifier[loadRegionData] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableSet] operator[SEP] identifier[availableRegions] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void setAce_class(String v) { if (Entity_Type.featOkTst && ((Entity_Type)jcasType).casFeat_ace_class == null) jcasType.jcas.throwFeatMissing("ace_class", "de.julielab.jules.types.ace.Entity"); jcasType.ll_cas.ll_setStringValue(addr, ((Entity_Type)jcasType).casFeatCode_ace_class, v);}
class class_name[name] begin[{] method[setAce_class, return_type[void], modifier[public], parameter[v]] begin[{] if[binary_operation[member[Entity_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Entity_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["ace_class"], literal["de.julielab.jules.types.ace.Entity"]]] else begin[{] None end[}] call[jcasType.ll_cas.ll_setStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Entity_Type, sub_type=None)), member[.v]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setAce_class] operator[SEP] identifier[String] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[Entity_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[Entity_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_ace_class] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[Entity_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_ace_class] , identifier[v] operator[SEP] operator[SEP] }
private void appendBranched(int startOffset, int pastEnd) { // Main tricky thing here is just replacing of linefeeds... if (mConvertLFs) { char[] inBuf = mBuffer; /* this will also unshare() and ensure there's room for at * least one more char */ char[] outBuf = mBranchBuffer.getCurrentSegment(); int outPtr = mBranchBuffer.getCurrentSegmentSize(); // Pending \n to skip? if (mGotCR) { if (inBuf[startOffset] == '\n') { ++startOffset; } } while (startOffset < pastEnd) { char c = inBuf[startOffset++]; if (c == '\r') { if (startOffset < pastEnd) { if (inBuf[startOffset] == '\n') { ++startOffset; } } else { mGotCR = true; } c = '\n'; } // Ok, let's add char to output: outBuf[outPtr++] = c; // Need more room? if (outPtr >= outBuf.length) { outBuf = mBranchBuffer.finishCurrentSegment(); outPtr = 0; } } mBranchBuffer.setCurrentLength(outPtr); } else { mBranchBuffer.append(mBuffer, startOffset, pastEnd-startOffset); } }
class class_name[name] begin[{] method[appendBranched, return_type[void], modifier[private], parameter[startOffset, pastEnd]] begin[{] if[member[.mConvertLFs]] begin[{] local_variable[type[char], inBuf] local_variable[type[char], outBuf] local_variable[type[int], outPtr] if[member[.mGotCR]] begin[{] if[binary_operation[member[.inBuf], ==, literal['\n']]] begin[{] member[.startOffset] else begin[{] None end[}] else begin[{] None end[}] while[binary_operation[member[.startOffset], <, member[.pastEnd]]] begin[{] local_variable[type[char], c] if[binary_operation[member[.c], ==, literal['\r']]] begin[{] if[binary_operation[member[.startOffset], <, member[.pastEnd]]] begin[{] if[binary_operation[member[.inBuf], ==, literal['\n']]] begin[{] member[.startOffset] else begin[{] None end[}] else begin[{] assign[member[.mGotCR], literal[true]] end[}] assign[member[.c], literal['\n']] else begin[{] None end[}] assign[member[.outBuf], member[.c]] if[binary_operation[member[.outPtr], >=, member[outBuf.length]]] begin[{] assign[member[.outBuf], call[mBranchBuffer.finishCurrentSegment, parameter[]]] assign[member[.outPtr], literal[0]] else begin[{] None end[}] end[}] call[mBranchBuffer.setCurrentLength, parameter[member[.outPtr]]] else begin[{] call[mBranchBuffer.append, parameter[member[.mBuffer], member[.startOffset], binary_operation[member[.pastEnd], -, member[.startOffset]]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[appendBranched] operator[SEP] Keyword[int] identifier[startOffset] , Keyword[int] identifier[pastEnd] operator[SEP] { Keyword[if] operator[SEP] identifier[mConvertLFs] operator[SEP] { Keyword[char] operator[SEP] operator[SEP] identifier[inBuf] operator[=] identifier[mBuffer] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[outBuf] operator[=] identifier[mBranchBuffer] operator[SEP] identifier[getCurrentSegment] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[outPtr] operator[=] identifier[mBranchBuffer] operator[SEP] identifier[getCurrentSegmentSize] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mGotCR] operator[SEP] { Keyword[if] operator[SEP] identifier[inBuf] operator[SEP] identifier[startOffset] operator[SEP] operator[==] literal[String] operator[SEP] { operator[++] identifier[startOffset] operator[SEP] } } Keyword[while] operator[SEP] identifier[startOffset] operator[<] identifier[pastEnd] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[inBuf] operator[SEP] identifier[startOffset] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[startOffset] operator[<] identifier[pastEnd] operator[SEP] { Keyword[if] operator[SEP] identifier[inBuf] operator[SEP] identifier[startOffset] operator[SEP] operator[==] literal[String] operator[SEP] { operator[++] identifier[startOffset] operator[SEP] } } Keyword[else] { identifier[mGotCR] operator[=] literal[boolean] operator[SEP] } identifier[c] operator[=] literal[String] operator[SEP] } identifier[outBuf] operator[SEP] identifier[outPtr] operator[++] operator[SEP] operator[=] identifier[c] operator[SEP] Keyword[if] operator[SEP] identifier[outPtr] operator[>=] identifier[outBuf] operator[SEP] identifier[length] operator[SEP] { identifier[outBuf] operator[=] identifier[mBranchBuffer] operator[SEP] identifier[finishCurrentSegment] operator[SEP] operator[SEP] operator[SEP] identifier[outPtr] operator[=] Other[0] operator[SEP] } } identifier[mBranchBuffer] operator[SEP] identifier[setCurrentLength] operator[SEP] identifier[outPtr] operator[SEP] operator[SEP] } Keyword[else] { identifier[mBranchBuffer] operator[SEP] identifier[append] operator[SEP] identifier[mBuffer] , identifier[startOffset] , identifier[pastEnd] operator[-] identifier[startOffset] operator[SEP] operator[SEP] } }
public static List<String> complementaryPyCcLib() throws IOException { if (complementaryLibs == null) { complementaryLibs = new LinkedList<String>(); InputStream inputStream = API.class.getClassLoader().getResourceAsStream(FILE); PropertyResourceBundle labels = new PropertyResourceBundle(inputStream); Enumeration<String> bundleKeys = labels.getKeys(); while (bundleKeys.hasMoreElements()) { String key; if (KEY.equals(key = bundleKeys.nextElement())) { String value = labels.getString(key); if (value != null && !value.isEmpty()) { String[] values = value.split(","); for (String v : values) { complementaryLibs.add(v.trim()); } } } } } return complementaryLibs; }
class class_name[name] begin[{] method[complementaryPyCcLib, return_type[type[List]], modifier[public static], parameter[]] begin[{] if[binary_operation[member[.complementaryLibs], ==, literal[null]]] begin[{] assign[member[.complementaryLibs], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))] local_variable[type[InputStream], inputStream] local_variable[type[PropertyResourceBundle], labels] local_variable[type[Enumeration], bundleKeys] while[call[bundleKeys.hasMoreElements, parameter[]]] begin[{] local_variable[type[String], key] if[call[KEY.equals, parameter[assign[member[.key], call[bundleKeys.nextElement, parameter[]]]]]] begin[{] local_variable[type[String], value] if[binary_operation[binary_operation[member[.value], !=, literal[null]], &&, call[value.isEmpty, parameter[]]]] begin[{] local_variable[type[String], values] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=complementaryLibs, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] else begin[{] None end[}] end[}] else begin[{] None end[}] return[member[.complementaryLibs]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[complementaryPyCcLib] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[complementaryLibs] operator[==] Other[null] operator[SEP] { identifier[complementaryLibs] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[InputStream] identifier[inputStream] operator[=] identifier[API] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[FILE] operator[SEP] operator[SEP] identifier[PropertyResourceBundle] identifier[labels] operator[=] Keyword[new] identifier[PropertyResourceBundle] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] identifier[Enumeration] operator[<] identifier[String] operator[>] identifier[bundleKeys] operator[=] identifier[labels] operator[SEP] identifier[getKeys] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[bundleKeys] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[key] operator[SEP] Keyword[if] operator[SEP] identifier[KEY] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[=] identifier[bundleKeys] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[value] operator[=] identifier[labels] operator[SEP] identifier[getString] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[&&] operator[!] identifier[value] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[value] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[v] operator[:] identifier[values] operator[SEP] { identifier[complementaryLibs] operator[SEP] identifier[add] operator[SEP] identifier[v] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } } Keyword[return] identifier[complementaryLibs] operator[SEP] }
public void marshall(DeleteAuthorizerRequest deleteAuthorizerRequest, ProtocolMarshaller protocolMarshaller) { if (deleteAuthorizerRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteAuthorizerRequest.getApiId(), APIID_BINDING); protocolMarshaller.marshall(deleteAuthorizerRequest.getAuthorizerId(), AUTHORIZERID_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[deleteAuthorizerRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.deleteAuthorizerRequest], ==, 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=getApiId, postfix_operators=[], prefix_operators=[], qualifier=deleteAuthorizerRequest, selectors=[], type_arguments=None), MemberReference(member=APIID_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=getAuthorizerId, postfix_operators=[], prefix_operators=[], qualifier=deleteAuthorizerRequest, selectors=[], type_arguments=None), MemberReference(member=AUTHORIZERID_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[DeleteAuthorizerRequest] identifier[deleteAuthorizerRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[deleteAuthorizerRequest] 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[deleteAuthorizerRequest] operator[SEP] identifier[getApiId] operator[SEP] operator[SEP] , identifier[APIID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteAuthorizerRequest] operator[SEP] identifier[getAuthorizerId] operator[SEP] operator[SEP] , identifier[AUTHORIZERID_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 writeAccessControlEntry(CmsRequestContext context, CmsResource resource, CmsAccessControlEntry ace) throws CmsException, CmsSecurityException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { checkOfflineProject(dbc); checkPermissions(dbc, resource, CmsPermissionSet.ACCESS_CONTROL, true, CmsResourceFilter.ALL); if (ace.getPrincipal().equals(CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID)) { // only vfs managers can set the overwrite all ACE checkRoleForResource(dbc, CmsRole.VFS_MANAGER, resource); } m_driverManager.writeAccessControlEntry(dbc, resource, ace); } catch (Exception e) { dbc.report( null, Messages.get().container(Messages.ERR_WRITE_ACL_ENTRY_1, context.getSitePath(resource)), e); } finally { dbc.clear(); } }
class class_name[name] begin[{] method[writeAccessControlEntry, return_type[void], modifier[public], parameter[context, resource, ace]] begin[{] local_variable[type[CmsDbContext], dbc] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkOfflineProject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ACCESS_CONTROL, postfix_operators=[], prefix_operators=[], qualifier=CmsPermissionSet, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=ALL, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[])], member=checkPermissions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getPrincipal, postfix_operators=[], prefix_operators=[], qualifier=ace, selectors=[MethodInvocation(arguments=[MemberReference(member=PRINCIPAL_OVERWRITE_ALL_ID, postfix_operators=[], prefix_operators=[], qualifier=CmsAccessControlEntry, 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=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=VFS_MANAGER, postfix_operators=[], prefix_operators=[], qualifier=CmsRole, selectors=[]), MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkRoleForResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeAccessControlEntry, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_WRITE_ACL_ENTRY_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSitePath, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=report, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[writeAccessControlEntry] operator[SEP] identifier[CmsRequestContext] identifier[context] , identifier[CmsResource] identifier[resource] , identifier[CmsAccessControlEntry] identifier[ace] operator[SEP] Keyword[throws] identifier[CmsException] , identifier[CmsSecurityException] { identifier[CmsDbContext] identifier[dbc] operator[=] identifier[m_dbContextFactory] operator[SEP] identifier[getDbContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[try] { identifier[checkOfflineProject] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[checkPermissions] operator[SEP] identifier[dbc] , identifier[resource] , identifier[CmsPermissionSet] operator[SEP] identifier[ACCESS_CONTROL] , literal[boolean] , identifier[CmsResourceFilter] operator[SEP] identifier[ALL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ace] operator[SEP] identifier[getPrincipal] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[CmsAccessControlEntry] operator[SEP] identifier[PRINCIPAL_OVERWRITE_ALL_ID] operator[SEP] operator[SEP] { identifier[checkRoleForResource] operator[SEP] identifier[dbc] , identifier[CmsRole] operator[SEP] identifier[VFS_MANAGER] , identifier[resource] operator[SEP] operator[SEP] } identifier[m_driverManager] operator[SEP] identifier[writeAccessControlEntry] operator[SEP] identifier[dbc] , identifier[resource] , identifier[ace] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[dbc] operator[SEP] identifier[report] operator[SEP] Other[null] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_WRITE_ACL_ENTRY_1] , identifier[context] operator[SEP] identifier[getSitePath] operator[SEP] identifier[resource] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[dbc] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } }
@Override public DeleteBrokerResult deleteBroker(DeleteBrokerRequest request) { request = beforeClientExecution(request); return executeDeleteBroker(request); }
class class_name[name] begin[{] method[deleteBroker, return_type[type[DeleteBrokerResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDeleteBroker, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DeleteBrokerResult] identifier[deleteBroker] operator[SEP] identifier[DeleteBrokerRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDeleteBroker] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
@SuppressWarnings("static-method") protected void _toJavaStatement(SarlBreakExpression breakExpression, ITreeAppendable appendable, boolean isReferenced) { appendable.newLine().append("break;"); //$NON-NLS-1$ }
class class_name[name] begin[{] method[_toJavaStatement, return_type[void], modifier[protected], parameter[breakExpression, appendable, isReferenced]] begin[{] call[appendable.newLine, parameter[]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[protected] Keyword[void] identifier[_toJavaStatement] operator[SEP] identifier[SarlBreakExpression] identifier[breakExpression] , identifier[ITreeAppendable] identifier[appendable] , Keyword[boolean] identifier[isReferenced] operator[SEP] { identifier[appendable] operator[SEP] identifier[newLine] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public boolean selectionChanged(Object source, int iStartRow, int iEndRow, int iSelectType) { int iOldSelection = m_iSelectedRow; if (m_iSelectedRow == iEndRow) m_iSelectedRow = iStartRow; else m_iSelectedRow = iEndRow; if (source instanceof JTable) m_iSelectedRow = ((JTable)source).getSelectedRow(); try { this.updateIfNewRow(m_iSelectedRow); } catch (Exception ex) { if (!(source instanceof Component)) source = null; // Never if (!this.displayError(ex, (Component)source)) ex.printStackTrace(); } return (iOldSelection != m_iSelectedRow); }
class class_name[name] begin[{] method[selectionChanged, return_type[type[boolean]], modifier[public], parameter[source, iStartRow, iEndRow, iSelectType]] begin[{] local_variable[type[int], iOldSelection] if[binary_operation[member[.m_iSelectedRow], ==, member[.iEndRow]]] begin[{] assign[member[.m_iSelectedRow], member[.iStartRow]] else begin[{] assign[member[.m_iSelectedRow], member[.iEndRow]] end[}] if[binary_operation[member[.source], instanceof, type[JTable]]] begin[{] assign[member[.m_iSelectedRow], Cast(expression=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JTable, sub_type=None))] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=m_iSelectedRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateIfNewRow, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Component, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)), IfStatement(condition=This(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Component, sub_type=None))], member=displayError, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=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=['Exception']))], finally_block=None, label=None, resources=None) return[binary_operation[member[.iOldSelection], !=, member[.m_iSelectedRow]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[selectionChanged] operator[SEP] identifier[Object] identifier[source] , Keyword[int] identifier[iStartRow] , Keyword[int] identifier[iEndRow] , Keyword[int] identifier[iSelectType] operator[SEP] { Keyword[int] identifier[iOldSelection] operator[=] identifier[m_iSelectedRow] operator[SEP] Keyword[if] operator[SEP] identifier[m_iSelectedRow] operator[==] identifier[iEndRow] operator[SEP] identifier[m_iSelectedRow] operator[=] identifier[iStartRow] operator[SEP] Keyword[else] identifier[m_iSelectedRow] operator[=] identifier[iEndRow] operator[SEP] Keyword[if] operator[SEP] identifier[source] Keyword[instanceof] identifier[JTable] operator[SEP] identifier[m_iSelectedRow] operator[=] operator[SEP] operator[SEP] identifier[JTable] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[getSelectedRow] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[this] operator[SEP] identifier[updateIfNewRow] operator[SEP] identifier[m_iSelectedRow] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[source] Keyword[instanceof] identifier[Component] operator[SEP] operator[SEP] identifier[source] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[displayError] operator[SEP] identifier[ex] , operator[SEP] identifier[Component] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[iOldSelection] operator[!=] identifier[m_iSelectedRow] operator[SEP] operator[SEP] }
public final void innerCreator() throws RecognitionException { try { // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:615:5: ({...}? => ID classCreatorRest ) // src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:615:7: {...}? => ID classCreatorRest { if ( !((!(helper.validateIdentifierKey(DroolsSoftKeywords.INSTANCEOF)))) ) { if (state.backtracking>0) {state.failed=true; return;} throw new FailedPredicateException(input, "innerCreator", "!(helper.validateIdentifierKey(DroolsSoftKeywords.INSTANCEOF))"); } match(input,ID,FOLLOW_ID_in_innerCreator3530); if (state.failed) return; pushFollow(FOLLOW_classCreatorRest_in_innerCreator3532); classCreatorRest(); state._fsp--; if (state.failed) return; } } catch (RecognitionException re) { throw re; } finally { // do for sure before leaving } }
class class_name[name] begin[{] method[innerCreator, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=INSTANCEOF, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=['!'], qualifier=helper, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, 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=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), ReturnStatement(expression=None, label=None)])), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="innerCreator"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="!(helper.validateIdentifierKey(DroolsSoftKeywords.INSTANCEOF))")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FailedPredicateException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_ID_in_innerCreator3530, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_classCreatorRest_in_innerCreator3532, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=classCreatorRest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))])], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[innerCreator] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { { Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] operator[!] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[INSTANCEOF] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[>] Other[0] operator[SEP] { identifier[state] operator[SEP] identifier[failed] operator[=] literal[boolean] operator[SEP] Keyword[return] operator[SEP] } Keyword[throw] Keyword[new] identifier[FailedPredicateException] operator[SEP] identifier[input] , literal[String] , literal[String] operator[SEP] operator[SEP] } identifier[match] operator[SEP] identifier[input] , identifier[ID] , identifier[FOLLOW_ID_in_innerCreator3530] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FOLLOW_classCreatorRest_in_innerCreator3532] operator[SEP] operator[SEP] identifier[classCreatorRest] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { Keyword[throw] identifier[re] operator[SEP] } Keyword[finally] { } }
public static String toBase64(final PublicKey publicKey) { final byte[] encoded = publicKey.getEncoded(); return Base64.encodeBase64String(encoded); }
class class_name[name] begin[{] method[toBase64, return_type[type[String]], modifier[public static], parameter[publicKey]] begin[{] local_variable[type[byte], encoded] return[call[Base64.encodeBase64String, parameter[member[.encoded]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[toBase64] operator[SEP] Keyword[final] identifier[PublicKey] identifier[publicKey] operator[SEP] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[encoded] operator[=] identifier[publicKey] operator[SEP] identifier[getEncoded] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Base64] operator[SEP] identifier[encodeBase64String] operator[SEP] identifier[encoded] operator[SEP] operator[SEP] }
@Override public boolean hasNext() { switch (state) { case INITIAL: return (slice.getFirst() < slice.getStop()); case STARTED: return (this.index < slice.getLast()); case DONE: } return false; }
class class_name[name] begin[{] method[hasNext, return_type[type[boolean]], modifier[public], parameter[]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['INITIAL'], statements=[ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFirst, postfix_operators=[], prefix_operators=[], qualifier=slice, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getStop, postfix_operators=[], prefix_operators=[], qualifier=slice, selectors=[], type_arguments=None), operator=<), label=None)]), SwitchStatementCase(case=['STARTED'], statements=[ReturnStatement(expression=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=index, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MethodInvocation(arguments=[], member=getLast, postfix_operators=[], prefix_operators=[], qualifier=slice, selectors=[], type_arguments=None), operator=<), label=None)]), SwitchStatementCase(case=['DONE'], statements=[])], expression=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[literal[false]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[switch] operator[SEP] identifier[state] operator[SEP] { Keyword[case] identifier[INITIAL] operator[:] Keyword[return] operator[SEP] identifier[slice] operator[SEP] identifier[getFirst] operator[SEP] operator[SEP] operator[<] identifier[slice] operator[SEP] identifier[getStop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[STARTED] operator[:] Keyword[return] operator[SEP] Keyword[this] operator[SEP] identifier[index] operator[<] identifier[slice] operator[SEP] identifier[getLast] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[DONE] operator[:] } Keyword[return] literal[boolean] operator[SEP] }
public void reportServiceException(UniformInterfaceException ex, boolean showNotification) { QueryPanel qp = searchView.getControlPanel().getQueryPanel(); String caption = null; String description = null; if(!AnnisBaseUI.handleCommonError(ex, "execute query")) { switch (ex.getResponse().getStatus()) { case 400: List<AqlParseError> errors = ex.getResponse().getEntity( new GenericType<List<AqlParseError>>() { }); caption = "Parsing error"; description = Joiner.on("\n").join(errors); qp.setStatus(description); qp.setErrors(errors); break; case 504: caption = "Timeout"; description = "Query execution took too long."; qp.setStatus(caption + ": " + description); break; case 403: if(Helper.getUser() == null) { // not logged in qp.setStatus("You don't have the access rights to query this corpus. " + "You might want to login to access more corpora."); searchView.getMainToolbar().showLoginWindow(true); } else { // logged in but wrong user caption = "You don't have the access rights to query this corpus. " + "You might want to login as another user to access more corpora."; qp.setStatus(caption); } break; default: log.error( "Exception when communicating with service", ex); qp.setStatus("Unexpected exception: " + ex.getMessage()); ExceptionDialog.show(ex, "Exception when communicating with service."); break; } if (showNotification && caption != null) { Notification.show(caption, description, Notification.Type.WARNING_MESSAGE); } } }
class class_name[name] begin[{] method[reportServiceException, return_type[void], modifier[public], parameter[ex, showNotification]] begin[{] local_variable[type[QueryPanel], qp] local_variable[type[String], caption] local_variable[type[String], description] if[call[AnnisBaseUI.handleCommonError, parameter[member[.ex], literal["execute query"]]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=400)], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[], body=[], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AqlParseError, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=GenericType, sub_type=None))], member=getEntity, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=errors)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AqlParseError, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=caption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parsing error")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=on, postfix_operators=[], prefix_operators=[], qualifier=Joiner, selectors=[MethodInvocation(arguments=[MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=qp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setErrors, postfix_operators=[], prefix_operators=[], qualifier=qp, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=504)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=caption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Timeout")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Query execution took too long.")), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=caption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=qp, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=403)], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getUser, postfix_operators=[], prefix_operators=[], qualifier=Helper, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=caption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You don't have the access rights to query this corpus. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You might want to login as another user to access more corpora."), operator=+)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=caption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=qp, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You don't have the access rights to query this corpus. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You might want to login to access more corpora."), operator=+)], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=qp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getMainToolbar, postfix_operators=[], prefix_operators=[], qualifier=searchView, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=showLoginWindow, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception when communicating with service"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected exception: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), operator=+)], member=setStatus, postfix_operators=[], prefix_operators=[], qualifier=qp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception when communicating with service.")], member=show, postfix_operators=[], prefix_operators=[], qualifier=ExceptionDialog, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[MethodInvocation(arguments=[], member=getStatus, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None) if[binary_operation[member[.showNotification], &&, binary_operation[member[.caption], !=, literal[null]]]] begin[{] call[Notification.show, parameter[member[.caption], member[.description], member[Notification.Type.WARNING_MESSAGE]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[reportServiceException] operator[SEP] identifier[UniformInterfaceException] identifier[ex] , Keyword[boolean] identifier[showNotification] operator[SEP] { identifier[QueryPanel] identifier[qp] operator[=] identifier[searchView] operator[SEP] identifier[getControlPanel] operator[SEP] operator[SEP] operator[SEP] identifier[getQueryPanel] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[caption] operator[=] Other[null] operator[SEP] identifier[String] identifier[description] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[AnnisBaseUI] operator[SEP] identifier[handleCommonError] operator[SEP] identifier[ex] , literal[String] operator[SEP] operator[SEP] { Keyword[switch] operator[SEP] identifier[ex] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] Other[400] operator[:] identifier[List] operator[<] identifier[AqlParseError] operator[>] identifier[errors] operator[=] identifier[ex] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] operator[SEP] identifier[getEntity] operator[SEP] Keyword[new] identifier[GenericType] operator[<] identifier[List] operator[<] identifier[AqlParseError] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] identifier[caption] operator[=] literal[String] operator[SEP] identifier[description] operator[=] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[errors] operator[SEP] operator[SEP] identifier[qp] operator[SEP] identifier[setStatus] operator[SEP] identifier[description] operator[SEP] operator[SEP] identifier[qp] operator[SEP] identifier[setErrors] operator[SEP] identifier[errors] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[504] operator[:] identifier[caption] operator[=] literal[String] operator[SEP] identifier[description] operator[=] literal[String] operator[SEP] identifier[qp] operator[SEP] identifier[setStatus] operator[SEP] identifier[caption] operator[+] literal[String] operator[+] identifier[description] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[403] operator[:] Keyword[if] operator[SEP] identifier[Helper] operator[SEP] identifier[getUser] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[qp] operator[SEP] identifier[setStatus] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[searchView] operator[SEP] identifier[getMainToolbar] operator[SEP] operator[SEP] operator[SEP] identifier[showLoginWindow] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[caption] operator[=] literal[String] operator[+] literal[String] operator[SEP] identifier[qp] operator[SEP] identifier[setStatus] operator[SEP] identifier[caption] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] identifier[qp] operator[SEP] identifier[setStatus] operator[SEP] literal[String] operator[+] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ExceptionDialog] operator[SEP] identifier[show] operator[SEP] identifier[ex] , literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[if] operator[SEP] identifier[showNotification] operator[&&] identifier[caption] operator[!=] Other[null] operator[SEP] { identifier[Notification] operator[SEP] identifier[show] operator[SEP] identifier[caption] , identifier[description] , identifier[Notification] operator[SEP] identifier[Type] operator[SEP] identifier[WARNING_MESSAGE] operator[SEP] operator[SEP] } } }
public void addUniqueAttribute(String qName, String value, int flags) throws SAXException { addAttribute(qName, value); }
class class_name[name] begin[{] method[addUniqueAttribute, return_type[void], modifier[public], parameter[qName, value, flags]] begin[{] call[.addAttribute, parameter[member[.qName], member[.value]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addUniqueAttribute] operator[SEP] identifier[String] identifier[qName] , identifier[String] identifier[value] , Keyword[int] identifier[flags] operator[SEP] Keyword[throws] identifier[SAXException] { identifier[addAttribute] operator[SEP] identifier[qName] , identifier[value] operator[SEP] operator[SEP] }
public void clean() { if (getGraphHopperLocation().isEmpty()) throw new IllegalStateException("Cannot clean GraphHopper without specified graphHopperLocation"); File folder = new File(getGraphHopperLocation()); removeDir(folder); }
class class_name[name] begin[{] method[clean, return_type[void], modifier[public], parameter[]] begin[{] if[call[.getGraphHopperLocation, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot clean GraphHopper without specified graphHopperLocation")], 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[File], folder] call[.removeDir, parameter[member[.folder]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[clean] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[getGraphHopperLocation] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[File] identifier[folder] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[getGraphHopperLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[removeDir] operator[SEP] identifier[folder] operator[SEP] operator[SEP] }
public static void setupProperties(String propertyAndValue, String separator) { String[] tokens = propertyAndValue.split(separator, 2); if (tokens.length == 2) { String name = MonitoringViewProperties.PARFAIT + "." + tokens[0]; String value = tokens[1]; System.setProperty(name, value); } }
class class_name[name] begin[{] method[setupProperties, return_type[void], modifier[public static], parameter[propertyAndValue, separator]] begin[{] local_variable[type[String], tokens] if[binary_operation[member[tokens.length], ==, literal[2]]] begin[{] local_variable[type[String], name] local_variable[type[String], value] call[System.setProperty, parameter[member[.name], member[.value]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setupProperties] operator[SEP] identifier[String] identifier[propertyAndValue] , identifier[String] identifier[separator] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[tokens] operator[=] identifier[propertyAndValue] operator[SEP] identifier[split] operator[SEP] identifier[separator] , Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[MonitoringViewProperties] operator[SEP] identifier[PARFAIT] operator[+] literal[String] operator[+] identifier[tokens] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] identifier[tokens] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } }
private void checkPropertyOnExplicitThis(PropertyExpression pe) { if (!currentScope.isInStaticContext()) return; Expression object = pe.getObjectExpression(); if (!(object instanceof VariableExpression)) return; VariableExpression ve = (VariableExpression) object; if (!ve.getName().equals("this")) return; String name = pe.getPropertyAsString(); if (name == null || name.equals("class")) return; Variable member = findClassMember(currentClass, name); if (member == null) return; checkVariableContextAccess(member, pe); }
class class_name[name] begin[{] method[checkPropertyOnExplicitThis, return_type[void], modifier[private], parameter[pe]] begin[{] if[call[currentScope.isInStaticContext, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Expression], object] if[binary_operation[member[.object], instanceof, type[VariableExpression]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[VariableExpression], ve] if[call[ve.getName, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[String], name] if[binary_operation[binary_operation[member[.name], ==, literal[null]], ||, call[name.equals, parameter[literal["class"]]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Variable], member] if[binary_operation[member[.member], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] call[.checkVariableContextAccess, parameter[member[.member], member[.pe]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkPropertyOnExplicitThis] operator[SEP] identifier[PropertyExpression] identifier[pe] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[currentScope] operator[SEP] identifier[isInStaticContext] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Expression] identifier[object] operator[=] identifier[pe] operator[SEP] identifier[getObjectExpression] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[object] Keyword[instanceof] identifier[VariableExpression] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[VariableExpression] identifier[ve] operator[=] operator[SEP] identifier[VariableExpression] operator[SEP] identifier[object] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ve] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[String] identifier[name] operator[=] identifier[pe] operator[SEP] identifier[getPropertyAsString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[||] identifier[name] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Variable] identifier[member] operator[=] identifier[findClassMember] operator[SEP] identifier[currentClass] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[member] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[checkVariableContextAccess] operator[SEP] identifier[member] , identifier[pe] operator[SEP] operator[SEP] }
public TrainingJob withFinalMetricDataList(MetricData... finalMetricDataList) { if (this.finalMetricDataList == null) { setFinalMetricDataList(new java.util.ArrayList<MetricData>(finalMetricDataList.length)); } for (MetricData ele : finalMetricDataList) { this.finalMetricDataList.add(ele); } return this; }
class class_name[name] begin[{] method[withFinalMetricDataList, return_type[type[TrainingJob]], modifier[public], parameter[finalMetricDataList]] begin[{] if[binary_operation[THIS[member[None.finalMetricDataList]], ==, literal[null]]] begin[{] call[.setFinalMetricDataList, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=finalMetricDataList, 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=MetricData, 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=finalMetricDataList, 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=finalMetricDataList, 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=MetricData, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[TrainingJob] identifier[withFinalMetricDataList] operator[SEP] identifier[MetricData] operator[...] identifier[finalMetricDataList] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[finalMetricDataList] operator[==] Other[null] operator[SEP] { identifier[setFinalMetricDataList] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[MetricData] operator[>] operator[SEP] identifier[finalMetricDataList] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[MetricData] identifier[ele] operator[:] identifier[finalMetricDataList] operator[SEP] { Keyword[this] operator[SEP] identifier[finalMetricDataList] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public final void mLPARAN() throws RecognitionException { try { int _type = LPARAN; int _channel = DEFAULT_TOKEN_CHANNEL; // druidG.g:573:8: ( '(' ) // druidG.g:573:11: '(' { match('('); } state.type = _type; state.channel = _channel; } finally { // do for sure before leaving } }
class class_name[name] begin[{] method[mLPARAN, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=LPARAN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_TOKEN_CHANNEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_channel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='(')], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[mLPARAN] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { Keyword[int] identifier[_type] operator[=] identifier[LPARAN] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] { identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[state] operator[SEP] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[state] operator[SEP] identifier[channel] operator[=] identifier[_channel] operator[SEP] } Keyword[finally] { } }
public void initBackground() { final int backgroundId; if (mSize == SIZE_MINI) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { backgroundId = R.drawable.com_shamanland_fab_circle_mini; } else { backgroundId = R.drawable.com_shamanland_fab_mini; } } else { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { backgroundId = R.drawable.com_shamanland_fab_circle_normal; } else { backgroundId = R.drawable.com_shamanland_fab_normal; } } updateBackground(getResources().getDrawable(backgroundId)); }
class class_name[name] begin[{] method[initBackground, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[int], backgroundId] if[binary_operation[member[.mSize], ==, member[.SIZE_MINI]]] begin[{] if[binary_operation[member[Build.VERSION.SDK_INT], >=, member[Build.VERSION_CODES.LOLLIPOP]]] begin[{] assign[member[.backgroundId], member[R.drawable.com_shamanland_fab_circle_mini]] else begin[{] assign[member[.backgroundId], member[R.drawable.com_shamanland_fab_mini]] end[}] else begin[{] if[binary_operation[member[Build.VERSION.SDK_INT], >=, member[Build.VERSION_CODES.LOLLIPOP]]] begin[{] assign[member[.backgroundId], member[R.drawable.com_shamanland_fab_circle_normal]] else begin[{] assign[member[.backgroundId], member[R.drawable.com_shamanland_fab_normal]] end[}] end[}] call[.updateBackground, parameter[call[.getResources, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[initBackground] operator[SEP] operator[SEP] { Keyword[final] Keyword[int] identifier[backgroundId] operator[SEP] Keyword[if] operator[SEP] identifier[mSize] operator[==] identifier[SIZE_MINI] operator[SEP] { Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[LOLLIPOP] operator[SEP] { identifier[backgroundId] operator[=] identifier[R] operator[SEP] identifier[drawable] operator[SEP] identifier[com_shamanland_fab_circle_mini] operator[SEP] } Keyword[else] { identifier[backgroundId] operator[=] identifier[R] operator[SEP] identifier[drawable] operator[SEP] identifier[com_shamanland_fab_mini] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[LOLLIPOP] operator[SEP] { identifier[backgroundId] operator[=] identifier[R] operator[SEP] identifier[drawable] operator[SEP] identifier[com_shamanland_fab_circle_normal] operator[SEP] } Keyword[else] { identifier[backgroundId] operator[=] identifier[R] operator[SEP] identifier[drawable] operator[SEP] identifier[com_shamanland_fab_normal] operator[SEP] } } identifier[updateBackground] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[getDrawable] operator[SEP] identifier[backgroundId] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("PMD.DataflowAnomalyAnalysis") public void invoke(EventBase<?> event) throws Throwable { // ADAPT VERBOSEHANDLERREFERENCE TO ANY CHANGES MADE HERE switch (method.type().parameterCount()) { case 0: // No parameters method.invoke(); break; case 1: // Event parameter method.invoke(event); break; case 2: // Event and channel Class<?> channelParam = method.type().parameterType(1); for (Channel channel : event.channels()) { if (channelParam.isAssignableFrom(channel.getClass())) { method.invoke(event, channel); } } break; default: throw new IllegalStateException("Handle not usable"); } }
class class_name[name] begin[{] method[invoke, return_type[void], modifier[public], parameter[event]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=parameterType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=channelParam)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=channelParam, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=channels, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=channel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Channel, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Handle not usable")], 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)])], expression=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[MethodInvocation(arguments=[], member=parameterCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[invoke] operator[SEP] identifier[EventBase] operator[<] operator[?] operator[>] identifier[event] operator[SEP] Keyword[throws] identifier[Throwable] { Keyword[switch] operator[SEP] identifier[method] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[parameterCount] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] Other[0] operator[:] identifier[method] operator[SEP] identifier[invoke] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[1] operator[:] identifier[method] operator[SEP] identifier[invoke] operator[SEP] identifier[event] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] identifier[Class] operator[<] operator[?] operator[>] identifier[channelParam] operator[=] identifier[method] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[parameterType] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Channel] identifier[channel] operator[:] identifier[event] operator[SEP] identifier[channels] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[channelParam] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[channel] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[method] operator[SEP] identifier[invoke] operator[SEP] identifier[event] , identifier[channel] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
private void insertNewLease(String recoveryIdentity, String recoveryGroup, Connection conn) throws SQLException { if (tc.isEntryEnabled()) Tr.entry(tc, "insertNewLease", this); short serviceId = (short) 1; String insertString = "INSERT INTO " + _leaseTableName + " (SERVER_IDENTITY, RECOVERY_GROUP, LEASE_OWNER, LEASE_TIME)" + " VALUES (?,?,?,?)"; PreparedStatement specStatement = null; long fir1 = System.currentTimeMillis(); Tr.audit(tc, "WTRN0108I: Insert New Lease for server with recovery identity " + recoveryIdentity); try { if (tc.isDebugEnabled()) Tr.debug(tc, "Need to setup new row using - " + insertString + ", and time: " + fir1); specStatement = conn.prepareStatement(insertString); specStatement.setString(1, recoveryIdentity); specStatement.setString(2, recoveryGroup); specStatement.setString(3, recoveryIdentity); specStatement.setLong(4, fir1); int ret = specStatement.executeUpdate(); if (tc.isDebugEnabled()) Tr.debug(tc, "Have inserted Server row with return: " + ret); } finally { if (specStatement != null && !specStatement.isClosed()) specStatement.close(); } if (tc.isEntryEnabled()) Tr.exit(tc, "insertNewLease"); }
class class_name[name] begin[{] method[insertNewLease, return_type[void], modifier[private], parameter[recoveryIdentity, recoveryGroup, conn]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["insertNewLease"], THIS[]]] else begin[{] None end[}] local_variable[type[short], serviceId] local_variable[type[String], insertString] local_variable[type[PreparedStatement], specStatement] local_variable[type[long], fir1] call[Tr.audit, parameter[member[.tc], binary_operation[literal["WTRN0108I: Insert New Lease for server with recovery identity "], +, member[.recoveryIdentity]]]] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Need to setup new row using - "), operandr=MemberReference(member=insertString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", and time: "), operator=+), operandr=MemberReference(member=fir1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=specStatement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=insertString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=recoveryIdentity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=[], prefix_operators=[], qualifier=specStatement, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), MemberReference(member=recoveryGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=[], prefix_operators=[], qualifier=specStatement, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=recoveryIdentity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=[], prefix_operators=[], qualifier=specStatement, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), MemberReference(member=fir1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setLong, postfix_operators=[], prefix_operators=[], qualifier=specStatement, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=executeUpdate, postfix_operators=[], prefix_operators=[], qualifier=specStatement, selectors=[], type_arguments=None), name=ret)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Have inserted Server row with return: "), operandr=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None))], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=specStatement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isClosed, postfix_operators=[], prefix_operators=['!'], qualifier=specStatement, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=specStatement, selectors=[], type_arguments=None), label=None))], label=None, resources=None) if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["insertNewLease"]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[insertNewLease] operator[SEP] identifier[String] identifier[recoveryIdentity] , identifier[String] identifier[recoveryGroup] , identifier[Connection] identifier[conn] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[short] identifier[serviceId] operator[=] operator[SEP] Keyword[short] operator[SEP] Other[1] operator[SEP] identifier[String] identifier[insertString] operator[=] literal[String] operator[+] identifier[_leaseTableName] operator[+] literal[String] operator[+] literal[String] operator[SEP] identifier[PreparedStatement] identifier[specStatement] operator[=] Other[null] operator[SEP] Keyword[long] identifier[fir1] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[audit] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[recoveryIdentity] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[insertString] operator[+] literal[String] operator[+] identifier[fir1] operator[SEP] operator[SEP] identifier[specStatement] operator[=] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[insertString] operator[SEP] operator[SEP] identifier[specStatement] operator[SEP] identifier[setString] operator[SEP] Other[1] , identifier[recoveryIdentity] operator[SEP] operator[SEP] identifier[specStatement] operator[SEP] identifier[setString] operator[SEP] Other[2] , identifier[recoveryGroup] operator[SEP] operator[SEP] identifier[specStatement] operator[SEP] identifier[setString] operator[SEP] Other[3] , identifier[recoveryIdentity] operator[SEP] operator[SEP] identifier[specStatement] operator[SEP] identifier[setLong] operator[SEP] Other[4] , identifier[fir1] operator[SEP] operator[SEP] Keyword[int] identifier[ret] operator[=] identifier[specStatement] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[ret] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[specStatement] operator[!=] Other[null] operator[&&] operator[!] identifier[specStatement] operator[SEP] identifier[isClosed] operator[SEP] operator[SEP] operator[SEP] identifier[specStatement] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public String stripUnnecessaryComments(String javaContent, AntlrOptions options) { if (!options.isOptimizeCodeQuality()) { return javaContent; } javaContent = stripMachineDependentPaths(javaContent); if (options.isStripAllComments()) { javaContent = stripAllComments(javaContent); } return javaContent; }
class class_name[name] begin[{] method[stripUnnecessaryComments, return_type[type[String]], modifier[public], parameter[javaContent, options]] begin[{] if[call[options.isOptimizeCodeQuality, parameter[]]] begin[{] return[member[.javaContent]] else begin[{] None end[}] assign[member[.javaContent], call[.stripMachineDependentPaths, parameter[member[.javaContent]]]] if[call[options.isStripAllComments, parameter[]]] begin[{] assign[member[.javaContent], call[.stripAllComments, parameter[member[.javaContent]]]] else begin[{] None end[}] return[member[.javaContent]] end[}] END[}]
Keyword[public] identifier[String] identifier[stripUnnecessaryComments] operator[SEP] identifier[String] identifier[javaContent] , identifier[AntlrOptions] identifier[options] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[options] operator[SEP] identifier[isOptimizeCodeQuality] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[javaContent] operator[SEP] } identifier[javaContent] operator[=] identifier[stripMachineDependentPaths] operator[SEP] identifier[javaContent] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[isStripAllComments] operator[SEP] operator[SEP] operator[SEP] { identifier[javaContent] operator[=] identifier[stripAllComments] operator[SEP] identifier[javaContent] operator[SEP] operator[SEP] } Keyword[return] identifier[javaContent] operator[SEP] }
@Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case XtextPackage.CHARACTER_RANGE__LEFT: return basicSetLeft(null, msgs); case XtextPackage.CHARACTER_RANGE__RIGHT: return basicSetRight(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); }
class class_name[name] begin[{] method[eInverseRemove, return_type[type[NotificationChain]], modifier[public], parameter[otherEnd, featureID, msgs]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=CHARACTER_RANGE__LEFT, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=msgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=basicSetLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=CHARACTER_RANGE__RIGHT, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=msgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=basicSetRight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=otherEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=msgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eInverseRemove, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[NotificationChain] identifier[eInverseRemove] operator[SEP] identifier[InternalEObject] identifier[otherEnd] , Keyword[int] identifier[featureID] , identifier[NotificationChain] identifier[msgs] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[XtextPackage] operator[SEP] identifier[CHARACTER_RANGE__LEFT] operator[:] Keyword[return] identifier[basicSetLeft] operator[SEP] Other[null] , identifier[msgs] operator[SEP] operator[SEP] Keyword[case] identifier[XtextPackage] operator[SEP] identifier[CHARACTER_RANGE__RIGHT] operator[:] Keyword[return] identifier[basicSetRight] operator[SEP] Other[null] , identifier[msgs] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eInverseRemove] operator[SEP] identifier[otherEnd] , identifier[featureID] , identifier[msgs] operator[SEP] operator[SEP] }
public static Node newUndefinedNode(Node srcReferenceNode) { Node node = IR.voidNode(IR.number(0)); if (srcReferenceNode != null) { node.useSourceInfoFromForTree(srcReferenceNode); } return node; }
class class_name[name] begin[{] method[newUndefinedNode, return_type[type[Node]], modifier[public static], parameter[srcReferenceNode]] begin[{] local_variable[type[Node], node] if[binary_operation[member[.srcReferenceNode], !=, literal[null]]] begin[{] call[node.useSourceInfoFromForTree, parameter[member[.srcReferenceNode]]] else begin[{] None end[}] return[member[.node]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Node] identifier[newUndefinedNode] operator[SEP] identifier[Node] identifier[srcReferenceNode] operator[SEP] { identifier[Node] identifier[node] operator[=] identifier[IR] operator[SEP] identifier[voidNode] operator[SEP] identifier[IR] operator[SEP] identifier[number] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[srcReferenceNode] operator[!=] Other[null] operator[SEP] { identifier[node] operator[SEP] identifier[useSourceInfoFromForTree] operator[SEP] identifier[srcReferenceNode] operator[SEP] operator[SEP] } Keyword[return] identifier[node] operator[SEP] }
public static boolean booleanValue(String key, boolean defaultValue) { String value = System.getProperty(key); boolean booleanValue = defaultValue; if (value != null) { booleanValue = Boolean.parseBoolean(value); } return booleanValue; }
class class_name[name] begin[{] method[booleanValue, return_type[type[boolean]], modifier[public static], parameter[key, defaultValue]] begin[{] local_variable[type[String], value] local_variable[type[boolean], booleanValue] if[binary_operation[member[.value], !=, literal[null]]] begin[{] assign[member[.booleanValue], call[Boolean.parseBoolean, parameter[member[.value]]]] else begin[{] None end[}] return[member[.booleanValue]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[booleanValue] operator[SEP] identifier[String] identifier[key] , Keyword[boolean] identifier[defaultValue] operator[SEP] { identifier[String] identifier[value] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[boolean] identifier[booleanValue] operator[=] identifier[defaultValue] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { identifier[booleanValue] operator[=] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[booleanValue] operator[SEP] }
@Override public ChronoPeriod plus(TemporalAmount amountToAdd) { if (amountToAdd instanceof ChronoPeriodImpl) { ChronoPeriodImpl amount = (ChronoPeriodImpl) amountToAdd; if (amount.getChronology().equals(getChronology())) { return new ChronoPeriodImpl( chronology, Jdk8Methods.safeAdd(years, amount.years), Jdk8Methods.safeAdd(months, amount.months), Jdk8Methods.safeAdd(days, amount.days)); } } throw new DateTimeException("Unable to add amount: " + amountToAdd); }
class class_name[name] begin[{] method[plus, return_type[type[ChronoPeriod]], modifier[public], parameter[amountToAdd]] begin[{] if[binary_operation[member[.amountToAdd], instanceof, type[ChronoPeriodImpl]]] begin[{] local_variable[type[ChronoPeriodImpl], amount] if[call[amount.getChronology, parameter[]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=chronology, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=years, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=years, postfix_operators=[], prefix_operators=[], qualifier=amount, selectors=[])], member=safeAdd, postfix_operators=[], prefix_operators=[], qualifier=Jdk8Methods, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=months, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=months, postfix_operators=[], prefix_operators=[], qualifier=amount, selectors=[])], member=safeAdd, postfix_operators=[], prefix_operators=[], qualifier=Jdk8Methods, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=days, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=days, postfix_operators=[], prefix_operators=[], qualifier=amount, selectors=[])], member=safeAdd, postfix_operators=[], prefix_operators=[], qualifier=Jdk8Methods, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChronoPeriodImpl, sub_type=None))] else begin[{] None end[}] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to add amount: "), operandr=MemberReference(member=amountToAdd, 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=DateTimeException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ChronoPeriod] identifier[plus] operator[SEP] identifier[TemporalAmount] identifier[amountToAdd] operator[SEP] { Keyword[if] operator[SEP] identifier[amountToAdd] Keyword[instanceof] identifier[ChronoPeriodImpl] operator[SEP] { identifier[ChronoPeriodImpl] identifier[amount] operator[=] operator[SEP] identifier[ChronoPeriodImpl] operator[SEP] identifier[amountToAdd] operator[SEP] Keyword[if] operator[SEP] identifier[amount] operator[SEP] identifier[getChronology] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[getChronology] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[ChronoPeriodImpl] operator[SEP] identifier[chronology] , identifier[Jdk8Methods] operator[SEP] identifier[safeAdd] operator[SEP] identifier[years] , identifier[amount] operator[SEP] identifier[years] operator[SEP] , identifier[Jdk8Methods] operator[SEP] identifier[safeAdd] operator[SEP] identifier[months] , identifier[amount] operator[SEP] identifier[months] operator[SEP] , identifier[Jdk8Methods] operator[SEP] identifier[safeAdd] operator[SEP] identifier[days] , identifier[amount] operator[SEP] identifier[days] operator[SEP] operator[SEP] operator[SEP] } } Keyword[throw] Keyword[new] identifier[DateTimeException] operator[SEP] literal[String] operator[+] identifier[amountToAdd] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.LLE__LNK_TYPE: setLnkType((Integer)newValue); return; case AfplibPackage.LLE__RG: getRG().clear(); getRG().addAll((Collection<? extends LLERG>)newValue); return; } super.eSet(featureID, newValue); }
class class_name[name] begin[{] method[eSet, return_type[void], modifier[public], parameter[featureID, newValue]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=LLE__LNK_TYPE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setLnkType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=LLE__RG, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getRG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getRG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=LLERG, sub_type=None))], dimensions=[], name=Collection, sub_type=None))], member=addAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eSet] operator[SEP] Keyword[int] identifier[featureID] , identifier[Object] identifier[newValue] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[LLE__LNK_TYPE] operator[:] identifier[setLnkType] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[LLE__RG] operator[:] identifier[getRG] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[getRG] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[LLERG] operator[>] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[eSet] operator[SEP] identifier[featureID] , identifier[newValue] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") @Override public void sink(FlowProcess<? extends Configuration> flowProcess, SinkCall<Corc, OutputCollector> sinkCall) throws IOException { Corc corc = sinkCall.getContext(); TupleEntry tupleEntry = sinkCall.getOutgoingEntry(); for (Comparable<?> fieldName : tupleEntry.getFields()) { corc.set(fieldName.toString(), tupleEntry.getObject(fieldName)); } sinkCall.getOutput().collect(null, corc); }
class class_name[name] begin[{] method[sink, return_type[void], modifier[public], parameter[flowProcess, sinkCall]] begin[{] local_variable[type[Corc], corc] local_variable[type[TupleEntry], tupleEntry] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=fieldName, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=tupleEntry, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=corc, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getFields, postfix_operators=[], prefix_operators=[], qualifier=tupleEntry, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fieldName)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Comparable, sub_type=None))), label=None) call[sinkCall.getOutput, parameter[]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[sink] operator[SEP] identifier[FlowProcess] operator[<] operator[?] Keyword[extends] identifier[Configuration] operator[>] identifier[flowProcess] , identifier[SinkCall] operator[<] identifier[Corc] , identifier[OutputCollector] operator[>] identifier[sinkCall] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Corc] identifier[corc] operator[=] identifier[sinkCall] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[TupleEntry] identifier[tupleEntry] operator[=] identifier[sinkCall] operator[SEP] identifier[getOutgoingEntry] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Comparable] operator[<] operator[?] operator[>] identifier[fieldName] operator[:] identifier[tupleEntry] operator[SEP] identifier[getFields] operator[SEP] operator[SEP] operator[SEP] { identifier[corc] operator[SEP] identifier[set] operator[SEP] identifier[fieldName] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[tupleEntry] operator[SEP] identifier[getObject] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] operator[SEP] } identifier[sinkCall] operator[SEP] identifier[getOutput] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] Other[null] , identifier[corc] operator[SEP] operator[SEP] }
public int getReturnCode() { long returnCode = this.stagingByteBuffer.getLong(RETURN_CODE_INDEX * 8); if (returnCode > Integer.MAX_VALUE) { AsyncException ae = new AsyncException("Return code value invalid"); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Invalid value returned for return code, exception: " + ae.getMessage()); } FFDCFilter.processException(ae, getClass().getName(), "227", this); return Integer.MAX_VALUE; } return (int) returnCode; }
class class_name[name] begin[{] method[getReturnCode, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[long], returnCode] if[binary_operation[member[.returnCode], >, member[Integer.MAX_VALUE]]] begin[{] local_variable[type[AsyncException], ae] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[literal["Invalid value returned for return code, exception: "], +, call[ae.getMessage, parameter[]]]]] else begin[{] None end[}] call[FFDCFilter.processException, parameter[member[.ae], call[.getClass, parameter[]], literal["227"], THIS[]]] return[member[Integer.MAX_VALUE]] else begin[{] None end[}] return[Cast(expression=MemberReference(member=returnCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))] end[}] END[}]
Keyword[public] Keyword[int] identifier[getReturnCode] operator[SEP] operator[SEP] { Keyword[long] identifier[returnCode] operator[=] Keyword[this] operator[SEP] identifier[stagingByteBuffer] operator[SEP] identifier[getLong] operator[SEP] identifier[RETURN_CODE_INDEX] operator[*] Other[8] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[returnCode] operator[>] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] { identifier[AsyncException] identifier[ae] operator[=] Keyword[new] identifier[AsyncException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[ae] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[ae] , identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] } Keyword[return] operator[SEP] Keyword[int] operator[SEP] identifier[returnCode] operator[SEP] }
public static String getRepositoryName(String repository, String vfspath, boolean online) { StringBuffer result = new StringBuffer(64); result.append(repository); result.append(online ? CmsFlexCache.REPOSITORY_ONLINE : CmsFlexCache.REPOSITORY_OFFLINE); result.append(vfspath); return result.toString(); }
class class_name[name] begin[{] method[getRepositoryName, return_type[type[String]], modifier[public static], parameter[repository, vfspath, online]] begin[{] local_variable[type[StringBuffer], result] call[result.append, parameter[member[.repository]]] call[result.append, parameter[TernaryExpression(condition=MemberReference(member=online, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=REPOSITORY_OFFLINE, postfix_operators=[], prefix_operators=[], qualifier=CmsFlexCache, selectors=[]), if_true=MemberReference(member=REPOSITORY_ONLINE, postfix_operators=[], prefix_operators=[], qualifier=CmsFlexCache, selectors=[]))]] call[result.append, parameter[member[.vfspath]]] return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getRepositoryName] operator[SEP] identifier[String] identifier[repository] , identifier[String] identifier[vfspath] , Keyword[boolean] identifier[online] operator[SEP] { identifier[StringBuffer] identifier[result] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[64] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[repository] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[online] operator[?] identifier[CmsFlexCache] operator[SEP] identifier[REPOSITORY_ONLINE] operator[:] identifier[CmsFlexCache] operator[SEP] identifier[REPOSITORY_OFFLINE] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[vfspath] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(UserPoolClientType userPoolClientType, ProtocolMarshaller protocolMarshaller) { if (userPoolClientType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(userPoolClientType.getUserPoolId(), USERPOOLID_BINDING); protocolMarshaller.marshall(userPoolClientType.getClientName(), CLIENTNAME_BINDING); protocolMarshaller.marshall(userPoolClientType.getClientId(), CLIENTID_BINDING); protocolMarshaller.marshall(userPoolClientType.getClientSecret(), CLIENTSECRET_BINDING); protocolMarshaller.marshall(userPoolClientType.getLastModifiedDate(), LASTMODIFIEDDATE_BINDING); protocolMarshaller.marshall(userPoolClientType.getCreationDate(), CREATIONDATE_BINDING); protocolMarshaller.marshall(userPoolClientType.getRefreshTokenValidity(), REFRESHTOKENVALIDITY_BINDING); protocolMarshaller.marshall(userPoolClientType.getReadAttributes(), READATTRIBUTES_BINDING); protocolMarshaller.marshall(userPoolClientType.getWriteAttributes(), WRITEATTRIBUTES_BINDING); protocolMarshaller.marshall(userPoolClientType.getExplicitAuthFlows(), EXPLICITAUTHFLOWS_BINDING); protocolMarshaller.marshall(userPoolClientType.getSupportedIdentityProviders(), SUPPORTEDIDENTITYPROVIDERS_BINDING); protocolMarshaller.marshall(userPoolClientType.getCallbackURLs(), CALLBACKURLS_BINDING); protocolMarshaller.marshall(userPoolClientType.getLogoutURLs(), LOGOUTURLS_BINDING); protocolMarshaller.marshall(userPoolClientType.getDefaultRedirectURI(), DEFAULTREDIRECTURI_BINDING); protocolMarshaller.marshall(userPoolClientType.getAllowedOAuthFlows(), ALLOWEDOAUTHFLOWS_BINDING); protocolMarshaller.marshall(userPoolClientType.getAllowedOAuthScopes(), ALLOWEDOAUTHSCOPES_BINDING); protocolMarshaller.marshall(userPoolClientType.getAllowedOAuthFlowsUserPoolClient(), ALLOWEDOAUTHFLOWSUSERPOOLCLIENT_BINDING); protocolMarshaller.marshall(userPoolClientType.getAnalyticsConfiguration(), ANALYTICSCONFIGURATION_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[userPoolClientType, protocolMarshaller]] begin[{] if[binary_operation[member[.userPoolClientType], ==, 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=getUserPoolId, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=USERPOOLID_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=getClientName, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=CLIENTNAME_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=getClientId, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=CLIENTID_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=getClientSecret, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=CLIENTSECRET_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=getLastModifiedDate, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=LASTMODIFIEDDATE_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=getCreationDate, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=CREATIONDATE_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=getRefreshTokenValidity, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=REFRESHTOKENVALIDITY_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=getReadAttributes, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=READATTRIBUTES_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=getWriteAttributes, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=WRITEATTRIBUTES_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=getExplicitAuthFlows, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=EXPLICITAUTHFLOWS_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=getSupportedIdentityProviders, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=SUPPORTEDIDENTITYPROVIDERS_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=getCallbackURLs, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=CALLBACKURLS_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=getLogoutURLs, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=LOGOUTURLS_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=getDefaultRedirectURI, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=DEFAULTREDIRECTURI_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=getAllowedOAuthFlows, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=ALLOWEDOAUTHFLOWS_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=getAllowedOAuthScopes, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=ALLOWEDOAUTHSCOPES_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=getAllowedOAuthFlowsUserPoolClient, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=ALLOWEDOAUTHFLOWSUSERPOOLCLIENT_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=getAnalyticsConfiguration, postfix_operators=[], prefix_operators=[], qualifier=userPoolClientType, selectors=[], type_arguments=None), MemberReference(member=ANALYTICSCONFIGURATION_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[UserPoolClientType] identifier[userPoolClientType] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[userPoolClientType] 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[userPoolClientType] operator[SEP] identifier[getUserPoolId] operator[SEP] operator[SEP] , identifier[USERPOOLID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getClientName] operator[SEP] operator[SEP] , identifier[CLIENTNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getClientId] operator[SEP] operator[SEP] , identifier[CLIENTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getClientSecret] operator[SEP] operator[SEP] , identifier[CLIENTSECRET_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getLastModifiedDate] operator[SEP] operator[SEP] , identifier[LASTMODIFIEDDATE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getCreationDate] operator[SEP] operator[SEP] , identifier[CREATIONDATE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getRefreshTokenValidity] operator[SEP] operator[SEP] , identifier[REFRESHTOKENVALIDITY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getReadAttributes] operator[SEP] operator[SEP] , identifier[READATTRIBUTES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getWriteAttributes] operator[SEP] operator[SEP] , identifier[WRITEATTRIBUTES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getExplicitAuthFlows] operator[SEP] operator[SEP] , identifier[EXPLICITAUTHFLOWS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getSupportedIdentityProviders] operator[SEP] operator[SEP] , identifier[SUPPORTEDIDENTITYPROVIDERS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getCallbackURLs] operator[SEP] operator[SEP] , identifier[CALLBACKURLS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getLogoutURLs] operator[SEP] operator[SEP] , identifier[LOGOUTURLS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getDefaultRedirectURI] operator[SEP] operator[SEP] , identifier[DEFAULTREDIRECTURI_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getAllowedOAuthFlows] operator[SEP] operator[SEP] , identifier[ALLOWEDOAUTHFLOWS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getAllowedOAuthScopes] operator[SEP] operator[SEP] , identifier[ALLOWEDOAUTHSCOPES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getAllowedOAuthFlowsUserPoolClient] operator[SEP] operator[SEP] , identifier[ALLOWEDOAUTHFLOWSUSERPOOLCLIENT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[userPoolClientType] operator[SEP] identifier[getAnalyticsConfiguration] operator[SEP] operator[SEP] , identifier[ANALYTICSCONFIGURATION_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Override @Transactional(enabled = false) public CPDefinitionInventory createCPDefinitionInventory( long CPDefinitionInventoryId) { return cpDefinitionInventoryPersistence.create(CPDefinitionInventoryId); }
class class_name[name] begin[{] method[createCPDefinitionInventory, return_type[type[CPDefinitionInventory]], modifier[public], parameter[CPDefinitionInventoryId]] begin[{] return[call[cpDefinitionInventoryPersistence.create, parameter[member[.CPDefinitionInventoryId]]]] end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[Transactional] operator[SEP] identifier[enabled] operator[=] literal[boolean] operator[SEP] Keyword[public] identifier[CPDefinitionInventory] identifier[createCPDefinitionInventory] operator[SEP] Keyword[long] identifier[CPDefinitionInventoryId] operator[SEP] { Keyword[return] identifier[cpDefinitionInventoryPersistence] operator[SEP] identifier[create] operator[SEP] identifier[CPDefinitionInventoryId] operator[SEP] operator[SEP] }
public void marshall(ResetServiceSettingRequest resetServiceSettingRequest, ProtocolMarshaller protocolMarshaller) { if (resetServiceSettingRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(resetServiceSettingRequest.getSettingId(), SETTINGID_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[resetServiceSettingRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.resetServiceSettingRequest], ==, 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=getSettingId, postfix_operators=[], prefix_operators=[], qualifier=resetServiceSettingRequest, selectors=[], type_arguments=None), MemberReference(member=SETTINGID_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[ResetServiceSettingRequest] identifier[resetServiceSettingRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[resetServiceSettingRequest] 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[resetServiceSettingRequest] operator[SEP] identifier[getSettingId] operator[SEP] operator[SEP] , identifier[SETTINGID_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 boolean checkCommentNodes(Node node, String str) { // Get nodes of node and go through them NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); NodeList childChildren = child.getChildNodes(); if (childChildren.getLength() > 0) { // Recurse for all children boolean okDownThere = checkCommentNodes(child, str); if (okDownThere == true) { return true; } } // Investigate comments if (child.getNodeType() == Node.COMMENT_NODE) { // If we got a comment that contains the string we are happy Comment comment = (Comment) child; if (comment.getNodeValue().contains(str)) { return true; } } } return false; }
class class_name[name] begin[{] method[checkCommentNodes, return_type[type[boolean]], modifier[public static], parameter[node, str]] begin[{] local_variable[type[NodeList], children] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getChildNodes, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), name=childChildren)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeList, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=childChildren, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkCommentNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=okDownThere)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=okDownThere, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), operator===), 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)]))])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNodeType, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), operandr=MemberReference(member=COMMENT_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Comment, sub_type=None)), name=comment)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Comment, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getNodeValue, postfix_operators=[], prefix_operators=[], qualifier=comment, selectors=[MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[checkCommentNodes] operator[SEP] identifier[Node] identifier[node] , identifier[String] identifier[str] operator[SEP] { identifier[NodeList] identifier[children] operator[=] identifier[node] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[children] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Node] identifier[child] operator[=] identifier[children] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[NodeList] identifier[childChildren] operator[=] identifier[child] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[childChildren] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[boolean] identifier[okDownThere] operator[=] identifier[checkCommentNodes] operator[SEP] identifier[child] , identifier[str] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[okDownThere] operator[==] literal[boolean] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[child] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[COMMENT_NODE] operator[SEP] { identifier[Comment] identifier[comment] operator[=] operator[SEP] identifier[Comment] operator[SEP] identifier[child] operator[SEP] Keyword[if] operator[SEP] identifier[comment] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[str] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
@Override public DecodedJWT verify(DecodedJWT jwt) throws JWTVerificationException { verifyAlgorithm(jwt, algorithm); algorithm.verify(jwt); verifyClaims(jwt, claims); return jwt; }
class class_name[name] begin[{] method[verify, return_type[type[DecodedJWT]], modifier[public], parameter[jwt]] begin[{] call[.verifyAlgorithm, parameter[member[.jwt], member[.algorithm]]] call[algorithm.verify, parameter[member[.jwt]]] call[.verifyClaims, parameter[member[.jwt], member[.claims]]] return[member[.jwt]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DecodedJWT] identifier[verify] operator[SEP] identifier[DecodedJWT] identifier[jwt] operator[SEP] Keyword[throws] identifier[JWTVerificationException] { identifier[verifyAlgorithm] operator[SEP] identifier[jwt] , identifier[algorithm] operator[SEP] operator[SEP] identifier[algorithm] operator[SEP] identifier[verify] operator[SEP] identifier[jwt] operator[SEP] operator[SEP] identifier[verifyClaims] operator[SEP] identifier[jwt] , identifier[claims] operator[SEP] operator[SEP] Keyword[return] identifier[jwt] operator[SEP] }
public ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance) throws PicoRegistrationException { if (componentInstance instanceof MutablePicoContainer) { MutablePicoContainer pc = (MutablePicoContainer) componentInstance; Object contrivedKey = new Object(); String contrivedComp = ""; pc.registerComponentInstance(contrivedKey, contrivedComp); try { if (this.getComponentInstance(contrivedKey) != null) { throw new PicoRegistrationException("Cannot register a container to itself. The container is already implicitly registered."); } } finally { pc.unregisterComponent(contrivedKey); } } ComponentAdapter componentAdapter = new InstanceComponentAdapter(componentKey, componentInstance); registerComponent(componentAdapter); return componentAdapter; }
class class_name[name] begin[{] method[registerComponentInstance, return_type[type[ComponentAdapter]], modifier[public], parameter[componentKey, componentInstance]] begin[{] if[binary_operation[member[.componentInstance], instanceof, type[MutablePicoContainer]]] begin[{] local_variable[type[MutablePicoContainer], pc] local_variable[type[Object], contrivedKey] local_variable[type[String], contrivedComp] call[pc.registerComponentInstance, parameter[member[.contrivedKey], member[.contrivedComp]]] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=contrivedKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getComponentInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, 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=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot register a container to itself. The container is already implicitly registered.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PicoRegistrationException, sub_type=None)), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=contrivedKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unregisterComponent, postfix_operators=[], prefix_operators=[], qualifier=pc, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] local_variable[type[ComponentAdapter], componentAdapter] call[.registerComponent, parameter[member[.componentAdapter]]] return[member[.componentAdapter]] end[}] END[}]
Keyword[public] identifier[ComponentAdapter] identifier[registerComponentInstance] operator[SEP] identifier[Object] identifier[componentKey] , identifier[Object] identifier[componentInstance] operator[SEP] Keyword[throws] identifier[PicoRegistrationException] { Keyword[if] operator[SEP] identifier[componentInstance] Keyword[instanceof] identifier[MutablePicoContainer] operator[SEP] { identifier[MutablePicoContainer] identifier[pc] operator[=] operator[SEP] identifier[MutablePicoContainer] operator[SEP] identifier[componentInstance] operator[SEP] identifier[Object] identifier[contrivedKey] operator[=] Keyword[new] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[contrivedComp] operator[=] literal[String] operator[SEP] identifier[pc] operator[SEP] identifier[registerComponentInstance] operator[SEP] identifier[contrivedKey] , identifier[contrivedComp] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getComponentInstance] operator[SEP] identifier[contrivedKey] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[PicoRegistrationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[pc] operator[SEP] identifier[unregisterComponent] operator[SEP] identifier[contrivedKey] operator[SEP] operator[SEP] } } identifier[ComponentAdapter] identifier[componentAdapter] operator[=] Keyword[new] identifier[InstanceComponentAdapter] operator[SEP] identifier[componentKey] , identifier[componentInstance] operator[SEP] operator[SEP] identifier[registerComponent] operator[SEP] identifier[componentAdapter] operator[SEP] operator[SEP] Keyword[return] identifier[componentAdapter] operator[SEP] }
private static CaseInsensitiveStringMap catalogOptions(String name, SQLConf conf) { Map<String, String> allConfs = mapAsJavaMapConverter(conf.getAllConfs()).asJava(); Pattern prefix = Pattern.compile("^spark\\.sql\\.catalog\\." + name + "\\.(.+)"); HashMap<String, String> options = new HashMap<>(); for (Map.Entry<String, String> entry : allConfs.entrySet()) { Matcher matcher = prefix.matcher(entry.getKey()); if (matcher.matches() && matcher.groupCount() > 0) { options.put(matcher.group(1), entry.getValue()); } } return new CaseInsensitiveStringMap(options); }
class class_name[name] begin[{] method[catalogOptions, return_type[type[CaseInsensitiveStringMap]], modifier[private static], parameter[name, conf]] begin[{] local_variable[type[Map], allConfs] local_variable[type[Pattern], prefix] local_variable[type[HashMap], options] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=prefix, selectors=[], type_arguments=None), name=matcher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=matches, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=groupCount, postfix_operators=[], prefix_operators=[], qualifier=matcher, 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=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=allConfs, 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=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[ClassCreator(arguments=[MemberReference(member=options, 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=CaseInsensitiveStringMap, sub_type=None))] end[}] END[}]
Keyword[private] Keyword[static] identifier[CaseInsensitiveStringMap] identifier[catalogOptions] operator[SEP] identifier[String] identifier[name] , identifier[SQLConf] identifier[conf] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[allConfs] operator[=] identifier[mapAsJavaMapConverter] operator[SEP] identifier[conf] operator[SEP] identifier[getAllConfs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[asJava] operator[SEP] operator[SEP] operator[SEP] identifier[Pattern] identifier[prefix] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[options] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[allConfs] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[prefix] operator[SEP] identifier[matcher] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[&&] identifier[matcher] operator[SEP] identifier[groupCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[options] operator[SEP] identifier[put] operator[SEP] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[CaseInsensitiveStringMap] operator[SEP] identifier[options] operator[SEP] operator[SEP] }
@Override public DescriptorValue calculate(IAtom atom, IAtomContainer container) { IAtom focus = container.getAtom(focusPosition); // could be cached int bondsToAtom = new ShortestPaths(container, atom).distanceTo(focus); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult( bondsToAtom), getDescriptorNames()); }
class class_name[name] begin[{] method[calculate, return_type[type[DescriptorValue]], modifier[public], parameter[atom, container]] begin[{] local_variable[type[IAtom], focus] local_variable[type[int], bondsToAtom] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getSpecification, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getParameterNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), ClassCreator(arguments=[MemberReference(member=bondsToAtom, 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=IntegerResult, sub_type=None)), MethodInvocation(arguments=[], member=getDescriptorNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DescriptorValue, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DescriptorValue] identifier[calculate] operator[SEP] identifier[IAtom] identifier[atom] , identifier[IAtomContainer] identifier[container] operator[SEP] { identifier[IAtom] identifier[focus] operator[=] identifier[container] operator[SEP] identifier[getAtom] operator[SEP] identifier[focusPosition] operator[SEP] operator[SEP] Keyword[int] identifier[bondsToAtom] operator[=] Keyword[new] identifier[ShortestPaths] operator[SEP] identifier[container] , identifier[atom] operator[SEP] operator[SEP] identifier[distanceTo] operator[SEP] identifier[focus] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DescriptorValue] operator[SEP] identifier[getSpecification] operator[SEP] operator[SEP] , identifier[getParameterNames] operator[SEP] operator[SEP] , identifier[getParameters] operator[SEP] operator[SEP] , Keyword[new] identifier[IntegerResult] operator[SEP] identifier[bondsToAtom] operator[SEP] , identifier[getDescriptorNames] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void deleteRSAKeys() { try { KeyStore keyStore = KeyStore.getInstance(ANDROID_KEY_STORE); keyStore.load(null); keyStore.deleteEntry(KEY_ALIAS); Log.d(TAG, "Deleting the existing RSA key pair from the KeyStore."); } catch (KeyStoreException | CertificateException | IOException | NoSuchAlgorithmException e) { Log.e(TAG, "Failed to remove the RSA KeyEntry from the Android KeyStore.", e); } }
class class_name[name] begin[{] method[deleteRSAKeys, return_type[void], modifier[private], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ANDROID_KEY_STORE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=KeyStore, selectors=[], type_arguments=None), name=keyStore)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KeyStore, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=load, postfix_operators=[], prefix_operators=[], qualifier=keyStore, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=KEY_ALIAS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteEntry, postfix_operators=[], prefix_operators=[], qualifier=keyStore, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Deleting the existing RSA key pair from the KeyStore.")], member=d, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to remove the RSA KeyEntry from the Android KeyStore."), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=e, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['KeyStoreException', 'CertificateException', 'IOException', 'NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[deleteRSAKeys] operator[SEP] operator[SEP] { Keyword[try] { identifier[KeyStore] identifier[keyStore] operator[=] identifier[KeyStore] operator[SEP] identifier[getInstance] operator[SEP] identifier[ANDROID_KEY_STORE] operator[SEP] operator[SEP] identifier[keyStore] operator[SEP] identifier[load] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[keyStore] operator[SEP] identifier[deleteEntry] operator[SEP] identifier[KEY_ALIAS] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[KeyStoreException] operator[|] identifier[CertificateException] operator[|] identifier[IOException] operator[|] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public String getRFC2253Name(Map<String, String> oidMap) { /* check for and return cached name */ if (oidMap.isEmpty()) { if (rfc2253Dn != null) { return rfc2253Dn; } else { rfc2253Dn = generateRFC2253DN(oidMap); return rfc2253Dn; } } return generateRFC2253DN(oidMap); }
class class_name[name] begin[{] method[getRFC2253Name, return_type[type[String]], modifier[public], parameter[oidMap]] begin[{] if[call[oidMap.isEmpty, parameter[]]] begin[{] if[binary_operation[member[.rfc2253Dn], !=, literal[null]]] begin[{] return[member[.rfc2253Dn]] else begin[{] assign[member[.rfc2253Dn], call[.generateRFC2253DN, parameter[member[.oidMap]]]] return[member[.rfc2253Dn]] end[}] else begin[{] None end[}] return[call[.generateRFC2253DN, parameter[member[.oidMap]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getRFC2253Name] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[oidMap] operator[SEP] { Keyword[if] operator[SEP] identifier[oidMap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[rfc2253Dn] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[rfc2253Dn] operator[SEP] } Keyword[else] { identifier[rfc2253Dn] operator[=] identifier[generateRFC2253DN] operator[SEP] identifier[oidMap] operator[SEP] operator[SEP] Keyword[return] identifier[rfc2253Dn] operator[SEP] } } Keyword[return] identifier[generateRFC2253DN] operator[SEP] identifier[oidMap] operator[SEP] operator[SEP] }
private Double fetchInstancesOnlineRatio(ObjectId collectorItemId) { int totalInstances = 0, totalInstancesOnline = 0; Double instancesOnlineScore = null; List<EnvironmentStatus> statuses = environmentStatusRepository .findByCollectorItemId(collectorItemId); if (null == statuses || statuses.isEmpty()) { return null; } for (EnvironmentStatus environmentStatus : statuses) { totalInstances++; if (environmentStatus.isOnline()) { totalInstancesOnline++; } } instancesOnlineScore = ((totalInstancesOnline * 100) / (double) totalInstances); LOGGER.info("totalInstances " + totalInstances + " totalInstancesOnline " + totalInstancesOnline + " instancesOnlineScore " + instancesOnlineScore); return instancesOnlineScore; }
class class_name[name] begin[{] method[fetchInstancesOnlineRatio, return_type[type[Double]], modifier[private], parameter[collectorItemId]] begin[{] local_variable[type[int], totalInstances] local_variable[type[Double], instancesOnlineScore] local_variable[type[List], statuses] if[binary_operation[binary_operation[literal[null], ==, member[.statuses]], ||, call[statuses.isEmpty, parameter[]]]] begin[{] return[literal[null]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=totalInstances, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isOnline, postfix_operators=[], prefix_operators=[], qualifier=environmentStatus, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=totalInstancesOnline, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=statuses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=environmentStatus)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EnvironmentStatus, sub_type=None))), label=None) assign[member[.instancesOnlineScore], binary_operation[binary_operation[member[.totalInstancesOnline], *, literal[100]], /, Cast(expression=MemberReference(member=totalInstances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double))]] call[LOGGER.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["totalInstances "], +, member[.totalInstances]], +, literal[" totalInstancesOnline "]], +, member[.totalInstancesOnline]], +, literal[" instancesOnlineScore "]], +, member[.instancesOnlineScore]]]] return[member[.instancesOnlineScore]] end[}] END[}]
Keyword[private] identifier[Double] identifier[fetchInstancesOnlineRatio] operator[SEP] identifier[ObjectId] identifier[collectorItemId] operator[SEP] { Keyword[int] identifier[totalInstances] operator[=] Other[0] , identifier[totalInstancesOnline] operator[=] Other[0] operator[SEP] identifier[Double] identifier[instancesOnlineScore] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[EnvironmentStatus] operator[>] identifier[statuses] operator[=] identifier[environmentStatusRepository] operator[SEP] identifier[findByCollectorItemId] operator[SEP] identifier[collectorItemId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[statuses] operator[||] identifier[statuses] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[for] operator[SEP] identifier[EnvironmentStatus] identifier[environmentStatus] operator[:] identifier[statuses] operator[SEP] { identifier[totalInstances] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[environmentStatus] operator[SEP] identifier[isOnline] operator[SEP] operator[SEP] operator[SEP] { identifier[totalInstancesOnline] operator[++] operator[SEP] } } identifier[instancesOnlineScore] operator[=] operator[SEP] operator[SEP] identifier[totalInstancesOnline] operator[*] Other[100] operator[SEP] operator[/] operator[SEP] Keyword[double] operator[SEP] identifier[totalInstances] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[totalInstances] operator[+] literal[String] operator[+] identifier[totalInstancesOnline] operator[+] literal[String] operator[+] identifier[instancesOnlineScore] operator[SEP] operator[SEP] Keyword[return] identifier[instancesOnlineScore] operator[SEP] }
private static char[] toChars(StringBuilder bufSentence) { char[] chs = new char[bufSentence.length()]; bufSentence.getChars(0, bufSentence.length(), chs, 0); return chs; }
class class_name[name] begin[{] method[toChars, return_type[type[char]], modifier[private static], parameter[bufSentence]] begin[{] local_variable[type[char], chs] call[bufSentence.getChars, parameter[literal[0], call[bufSentence.length, parameter[]], member[.chs], literal[0]]] return[member[.chs]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[char] operator[SEP] operator[SEP] identifier[toChars] operator[SEP] identifier[StringBuilder] identifier[bufSentence] operator[SEP] { Keyword[char] operator[SEP] operator[SEP] identifier[chs] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[bufSentence] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bufSentence] operator[SEP] identifier[getChars] operator[SEP] Other[0] , identifier[bufSentence] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[chs] , Other[0] operator[SEP] operator[SEP] Keyword[return] identifier[chs] operator[SEP] }
private Versioned<Object> convertStringToObject(String key, Versioned<String> value) { Object valueObject = null; if(CLUSTER_KEY.equals(key)) { valueObject = clusterMapper.readCluster(new StringReader(value.getValue())); } else if(STORES_KEY.equals(key)) { valueObject = storeMapper.readStoreList(new StringReader(value.getValue())); } else if(SERVER_STATE_KEY.equals(key)) { valueObject = VoldemortState.valueOf(value.getValue()); } else if(NODE_ID_KEY.equals(key)) { valueObject = Integer.parseInt(value.getValue()); } else if(SLOP_STREAMING_ENABLED_KEY.equals(key) || PARTITION_STREAMING_ENABLED_KEY.equals(key) || READONLY_FETCH_ENABLED_KEY.equals(key) || QUOTA_ENFORCEMENT_ENABLED_KEY.equals(key)) { valueObject = Boolean.parseBoolean(value.getValue()); } else if(REBALANCING_STEAL_INFO.equals(key)) { String valueString = value.getValue(); if(valueString.startsWith("[")) { valueObject = RebalancerState.create(valueString); } else { valueObject = new RebalancerState(Arrays.asList(RebalanceTaskInfo.create(valueString))); } } else if(REBALANCING_SOURCE_CLUSTER_XML.equals(key)) { if(value.getValue() != null && value.getValue().length() > 0) { valueObject = clusterMapper.readCluster(new StringReader(value.getValue())); } } else if(REBALANCING_SOURCE_STORES_XML.equals(key)) { if(value.getValue() != null && value.getValue().length() > 0) { valueObject = storeMapper.readStoreList(new StringReader(value.getValue())); } } else { throw new VoldemortException("Unhandled key:'" + key + "' for String to Object serialization."); } return new Versioned<Object>(valueObject, value.getVersion()); }
class class_name[name] begin[{] method[convertStringToObject, return_type[type[Versioned]], modifier[private], parameter[key, value]] begin[{] local_variable[type[Object], valueObject] if[call[CLUSTER_KEY.equals, parameter[member[.key]]]] begin[{] assign[member[.valueObject], call[clusterMapper.readCluster, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringReader, sub_type=None))]]] else begin[{] if[call[STORES_KEY.equals, parameter[member[.key]]]] begin[{] assign[member[.valueObject], call[storeMapper.readStoreList, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringReader, sub_type=None))]]] else begin[{] if[call[SERVER_STATE_KEY.equals, parameter[member[.key]]]] begin[{] assign[member[.valueObject], call[VoldemortState.valueOf, parameter[call[value.getValue, parameter[]]]]] else begin[{] if[call[NODE_ID_KEY.equals, parameter[member[.key]]]] begin[{] assign[member[.valueObject], call[Integer.parseInt, parameter[call[value.getValue, parameter[]]]]] else begin[{] if[binary_operation[binary_operation[binary_operation[call[SLOP_STREAMING_ENABLED_KEY.equals, parameter[member[.key]]], ||, call[PARTITION_STREAMING_ENABLED_KEY.equals, parameter[member[.key]]]], ||, call[READONLY_FETCH_ENABLED_KEY.equals, parameter[member[.key]]]], ||, call[QUOTA_ENFORCEMENT_ENABLED_KEY.equals, parameter[member[.key]]]]] begin[{] assign[member[.valueObject], call[Boolean.parseBoolean, parameter[call[value.getValue, parameter[]]]]] else begin[{] if[call[REBALANCING_STEAL_INFO.equals, parameter[member[.key]]]] begin[{] local_variable[type[String], valueString] if[call[valueString.startsWith, parameter[literal["["]]]] begin[{] assign[member[.valueObject], call[RebalancerState.create, parameter[member[.valueString]]]] else begin[{] assign[member[.valueObject], ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=valueString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=RebalanceTaskInfo, selectors=[], type_arguments=None)], 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=None, dimensions=None, name=RebalancerState, sub_type=None))] end[}] else begin[{] if[call[REBALANCING_SOURCE_CLUSTER_XML.equals, parameter[member[.key]]]] begin[{] if[binary_operation[binary_operation[call[value.getValue, parameter[]], !=, literal[null]], &&, binary_operation[call[value.getValue, parameter[]], >, literal[0]]]] begin[{] assign[member[.valueObject], call[clusterMapper.readCluster, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringReader, sub_type=None))]]] else begin[{] None end[}] else begin[{] if[call[REBALANCING_SOURCE_STORES_XML.equals, parameter[member[.key]]]] begin[{] if[binary_operation[binary_operation[call[value.getValue, parameter[]], !=, literal[null]], &&, binary_operation[call[value.getValue, parameter[]], >, literal[0]]]] begin[{] assign[member[.valueObject], call[storeMapper.readStoreList, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringReader, sub_type=None))]]] else begin[{] None end[}] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unhandled key:'"), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' for String to Object serialization."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VoldemortException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] return[ClassCreator(arguments=[MemberReference(member=valueObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getVersion, postfix_operators=[], prefix_operators=[], qualifier=value, 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=Object, sub_type=None))], dimensions=None, name=Versioned, sub_type=None))] end[}] END[}]
Keyword[private] identifier[Versioned] operator[<] identifier[Object] operator[>] identifier[convertStringToObject] operator[SEP] identifier[String] identifier[key] , identifier[Versioned] operator[<] identifier[String] operator[>] identifier[value] operator[SEP] { identifier[Object] identifier[valueObject] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[CLUSTER_KEY] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[SEP] { identifier[valueObject] operator[=] identifier[clusterMapper] operator[SEP] identifier[readCluster] operator[SEP] Keyword[new] identifier[StringReader] operator[SEP] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[STORES_KEY] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[SEP] { identifier[valueObject] operator[=] identifier[storeMapper] operator[SEP] identifier[readStoreList] operator[SEP] Keyword[new] identifier[StringReader] operator[SEP] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[SERVER_STATE_KEY] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[SEP] { identifier[valueObject] operator[=] identifier[VoldemortState] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[NODE_ID_KEY] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[SEP] { identifier[valueObject] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[SLOP_STREAMING_ENABLED_KEY] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[||] identifier[PARTITION_STREAMING_ENABLED_KEY] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[||] identifier[READONLY_FETCH_ENABLED_KEY] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[||] identifier[QUOTA_ENFORCEMENT_ENABLED_KEY] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[SEP] { identifier[valueObject] operator[=] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[REBALANCING_STEAL_INFO] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[SEP] { identifier[String] identifier[valueString] operator[=] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[valueString] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[valueObject] operator[=] identifier[RebalancerState] operator[SEP] identifier[create] operator[SEP] identifier[valueString] operator[SEP] operator[SEP] } Keyword[else] { identifier[valueObject] operator[=] Keyword[new] identifier[RebalancerState] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[RebalanceTaskInfo] operator[SEP] identifier[create] operator[SEP] identifier[valueString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[REBALANCING_SOURCE_CLUSTER_XML] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[valueObject] operator[=] identifier[clusterMapper] operator[SEP] identifier[readCluster] operator[SEP] Keyword[new] identifier[StringReader] operator[SEP] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[REBALANCING_SOURCE_STORES_XML] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[valueObject] operator[=] identifier[storeMapper] operator[SEP] identifier[readStoreList] operator[SEP] Keyword[new] identifier[StringReader] operator[SEP] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[throw] Keyword[new] identifier[VoldemortException] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Versioned] operator[<] identifier[Object] operator[>] operator[SEP] identifier[valueObject] , identifier[value] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static void disableCaching(final WebResponse response) { response.setLastModifiedTime(Time.now()); final HttpServletResponse httpServletResponse = getHttpServletResponse(response); if (httpServletResponse != null) { httpServletResponse.addHeader("Cache-Control", "max-age=0"); httpServletResponse.setDateHeader("Expires", 0); } }
class class_name[name] begin[{] method[disableCaching, return_type[void], modifier[public static], parameter[response]] begin[{] call[response.setLastModifiedTime, parameter[call[Time.now, parameter[]]]] local_variable[type[HttpServletResponse], httpServletResponse] if[binary_operation[member[.httpServletResponse], !=, literal[null]]] begin[{] call[httpServletResponse.addHeader, parameter[literal["Cache-Control"], literal["max-age=0"]]] call[httpServletResponse.setDateHeader, parameter[literal["Expires"], literal[0]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[disableCaching] operator[SEP] Keyword[final] identifier[WebResponse] identifier[response] operator[SEP] { identifier[response] operator[SEP] identifier[setLastModifiedTime] operator[SEP] identifier[Time] operator[SEP] identifier[now] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[HttpServletResponse] identifier[httpServletResponse] operator[=] identifier[getHttpServletResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[httpServletResponse] operator[!=] Other[null] operator[SEP] { identifier[httpServletResponse] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[httpServletResponse] operator[SEP] identifier[setDateHeader] operator[SEP] literal[String] , Other[0] operator[SEP] operator[SEP] } }
public static WeekDay getMonthlyOffset(final Calendar cal) { return new WeekDay(getDay(cal.get(Calendar.DAY_OF_WEEK)), cal.get(Calendar.DAY_OF_WEEK_IN_MONTH)); }
class class_name[name] begin[{] method[getMonthlyOffset, return_type[type[WeekDay]], modifier[public static], parameter[cal]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=DAY_OF_WEEK, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None)], member=getDay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=DAY_OF_WEEK_IN_MONTH, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WeekDay, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[WeekDay] identifier[getMonthlyOffset] operator[SEP] Keyword[final] identifier[Calendar] identifier[cal] operator[SEP] { Keyword[return] Keyword[new] identifier[WeekDay] operator[SEP] identifier[getDay] operator[SEP] identifier[cal] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_WEEK] operator[SEP] operator[SEP] , identifier[cal] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_WEEK_IN_MONTH] operator[SEP] operator[SEP] operator[SEP] }
protected FaihyFailureErrorPart createJsonistaError(ApiFailureResource resource, String field, String clientManaged, String dataDelimiter, String serverManaged) { final String code = Srl.substringFirstFront(clientManaged, dataDelimiter).trim(); // e.g. LENGTH final String json = "{" + Srl.substringFirstRear(clientManaged, dataDelimiter).trim() + "}"; // e.g. {min:{min}, max:{max}} final Map<String, Object> jsonistaData = filterDataParserHeadache(parseJsonistaData(resource, field, code, json)); return newFailureErrorPart(field, code, jsonistaData, filterServerManagedMessage(serverManaged, jsonistaData)); }
class class_name[name] begin[{] method[createJsonistaError, return_type[type[FaihyFailureErrorPart]], modifier[protected], parameter[resource, field, clientManaged, dataDelimiter, serverManaged]] begin[{] local_variable[type[String], code] local_variable[type[String], json] local_variable[type[Map], jsonistaData] return[call[.newFailureErrorPart, parameter[member[.field], member[.code], member[.jsonistaData], call[.filterServerManagedMessage, parameter[member[.serverManaged], member[.jsonistaData]]]]]] end[}] END[}]
Keyword[protected] identifier[FaihyFailureErrorPart] identifier[createJsonistaError] operator[SEP] identifier[ApiFailureResource] identifier[resource] , identifier[String] identifier[field] , identifier[String] identifier[clientManaged] , identifier[String] identifier[dataDelimiter] , identifier[String] identifier[serverManaged] operator[SEP] { Keyword[final] identifier[String] identifier[code] operator[=] identifier[Srl] operator[SEP] identifier[substringFirstFront] operator[SEP] identifier[clientManaged] , identifier[dataDelimiter] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[json] operator[=] literal[String] operator[+] identifier[Srl] operator[SEP] identifier[substringFirstRear] operator[SEP] identifier[clientManaged] , identifier[dataDelimiter] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[jsonistaData] operator[=] identifier[filterDataParserHeadache] operator[SEP] identifier[parseJsonistaData] operator[SEP] identifier[resource] , identifier[field] , identifier[code] , identifier[json] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[newFailureErrorPart] operator[SEP] identifier[field] , identifier[code] , identifier[jsonistaData] , identifier[filterServerManagedMessage] operator[SEP] identifier[serverManaged] , identifier[jsonistaData] operator[SEP] operator[SEP] operator[SEP] }
@Override public DeleteVpcLinkResult deleteVpcLink(DeleteVpcLinkRequest request) { request = beforeClientExecution(request); return executeDeleteVpcLink(request); }
class class_name[name] begin[{] method[deleteVpcLink, return_type[type[DeleteVpcLinkResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDeleteVpcLink, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DeleteVpcLinkResult] identifier[deleteVpcLink] operator[SEP] identifier[DeleteVpcLinkRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDeleteVpcLink] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
private static Record createRecord(String data) { return new Record().withData(ByteBuffer.wrap(data.getBytes())); }
class class_name[name] begin[{] method[createRecord, return_type[type[Record]], modifier[private static], parameter[data]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None)], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=ByteBuffer, selectors=[], type_arguments=None)], member=withData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Record, sub_type=None))] end[}] END[}]
Keyword[private] Keyword[static] identifier[Record] identifier[createRecord] operator[SEP] identifier[String] identifier[data] operator[SEP] { Keyword[return] Keyword[new] identifier[Record] operator[SEP] operator[SEP] operator[SEP] identifier[withData] operator[SEP] identifier[ByteBuffer] operator[SEP] identifier[wrap] operator[SEP] identifier[data] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected void loadOptionalExecutor(final String executorBinder) { try { final Method bindExecutor = RepositoryModule.class.getDeclaredMethod("bindExecutor", Class.class); bindExecutor.setAccessible(true); try { Class.forName(executorBinder) .getConstructor(RepositoryModule.class, Method.class) .newInstance(this, bindExecutor); } finally { bindExecutor.setAccessible(false); } } catch (Exception ignore) { if (logger.isTraceEnabled()) { logger.trace("Failed to process executor loader " + executorBinder, ignore); } } }
class class_name[name] begin[{] method[loadOptionalExecutor, return_type[void], modifier[protected], parameter[executorBinder]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bindExecutor"), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))], member=getDeclaredMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=RepositoryModule, sub_type=None)), name=bindExecutor)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=bindExecutor, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=executorBinder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RepositoryModule, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Method, sub_type=None))], member=getConstructor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=bindExecutor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=bindExecutor, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isTraceEnabled, 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="Failed to process executor loader "), operandr=MemberReference(member=executorBinder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=ignore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[loadOptionalExecutor] operator[SEP] Keyword[final] identifier[String] identifier[executorBinder] operator[SEP] { Keyword[try] { Keyword[final] identifier[Method] identifier[bindExecutor] operator[=] identifier[RepositoryModule] operator[SEP] Keyword[class] operator[SEP] identifier[getDeclaredMethod] operator[SEP] literal[String] , identifier[Class] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[bindExecutor] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[try] { identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[executorBinder] operator[SEP] operator[SEP] identifier[getConstructor] operator[SEP] identifier[RepositoryModule] operator[SEP] Keyword[class] , identifier[Method] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] Keyword[this] , identifier[bindExecutor] operator[SEP] operator[SEP] } Keyword[finally] { identifier[bindExecutor] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[ignore] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[executorBinder] , identifier[ignore] operator[SEP] operator[SEP] } } }
public void store(Writer writer, String comments) throws IOException { store0((writer instanceof BufferedWriter)?(BufferedWriter)writer : new BufferedWriter(writer), comments, false); }
class class_name[name] begin[{] method[store, return_type[void], modifier[public], parameter[writer, comments]] begin[{] call[.store0, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=BufferedWriter, sub_type=None), operator=instanceof), if_false=ClassCreator(arguments=[MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedWriter, sub_type=None)), if_true=Cast(expression=MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BufferedWriter, sub_type=None))), member[.comments], literal[false]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[store] operator[SEP] identifier[Writer] identifier[writer] , identifier[String] identifier[comments] operator[SEP] Keyword[throws] identifier[IOException] { identifier[store0] operator[SEP] operator[SEP] identifier[writer] Keyword[instanceof] identifier[BufferedWriter] operator[SEP] operator[?] operator[SEP] identifier[BufferedWriter] operator[SEP] identifier[writer] operator[:] Keyword[new] identifier[BufferedWriter] operator[SEP] identifier[writer] operator[SEP] , identifier[comments] , literal[boolean] operator[SEP] operator[SEP] }
@Override public Set<ScriptArchive> getScriptArchives(Set<ModuleId> moduleIds) throws IOException { Set<ScriptArchive> archives = new LinkedHashSet<ScriptArchive>(moduleIds.size()*2); Path archiveOuputDir = getConfig().getArchiveOutputDirectory(); List<ModuleId> moduleIdList = new LinkedList<ModuleId>(moduleIds); int batchSize = getConfig().getArchiveFetchBatchSize(); int start = 0; try { while (start < moduleIdList.size()) { int end = Math.min(moduleIdList.size(), start + batchSize); List<ModuleId> batchModuleIds = moduleIdList.subList(start, end); List<String> rowKeys = new ArrayList<String>(batchModuleIds.size()); for (ModuleId batchModuleId:batchModuleIds) { rowKeys.add(batchModuleId.toString()); } Rows<String, String> rows = cassandra.getRows(rowKeys.toArray(new String[0])); for (Row<String, String> row : rows) { String moduleId = row.getKey(); ColumnList<String> columns = row.getColumns(); Column<String> lastUpdateColumn = columns.getColumnByName(Columns.last_update.name()); Column<String> hashColumn = columns.getColumnByName(Columns.archive_content_hash.name()); Column<String> contentColumn = columns.getColumnByName(Columns.archive_content.name()); if (lastUpdateColumn == null || hashColumn == null || contentColumn == null) { continue; } ScriptModuleSpec moduleSpec = getModuleSpec(columns); long lastUpdateTime = lastUpdateColumn.getLongValue(); byte[] hash = hashColumn.getByteArrayValue(); byte[] content = contentColumn.getByteArrayValue(); // verify the hash if (hash != null && hash.length > 0 && !verifyHash(hash, content)) { logger.warn("Content hash validation failed for moduleId {}. size: {}", moduleId, content.length); continue; } String fileName = new StringBuilder().append(moduleId).append("-").append(lastUpdateTime).append(".jar").toString(); Path jarFile = archiveOuputDir.resolve(fileName); Files.write(jarFile, content); JarScriptArchive scriptArchive = new JarScriptArchive.Builder(jarFile) .setModuleSpec(moduleSpec) .setCreateTime(lastUpdateTime) .build(); archives.add(scriptArchive); } start = end; } } catch (Exception e) { throw new IOException(e); } return archives; }
class class_name[name] begin[{] method[getScriptArchives, return_type[type[Set]], modifier[public], parameter[moduleIds]] begin[{] local_variable[type[Set], archives] local_variable[type[Path], archiveOuputDir] local_variable[type[List], moduleIdList] local_variable[type[int], batchSize] local_variable[type[int], start] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=moduleIdList, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=batchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=end)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=subList, postfix_operators=[], prefix_operators=[], qualifier=moduleIdList, selectors=[], type_arguments=None), name=batchModuleIds)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ModuleId, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=batchModuleIds, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=rowKeys)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=batchModuleId, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=rowKeys, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=batchModuleIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=batchModuleId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModuleId, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=rowKeys, selectors=[], type_arguments=None)], member=getRows, postfix_operators=[], prefix_operators=[], qualifier=cassandra, selectors=[], type_arguments=None), name=rows)], 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=String, sub_type=None))], dimensions=[], name=Rows, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), name=moduleId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), name=columns)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=ColumnList, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=Columns.last_update, selectors=[], type_arguments=None)], member=getColumnByName, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[], type_arguments=None), name=lastUpdateColumn)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Column, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=Columns.archive_content_hash, selectors=[], type_arguments=None)], member=getColumnByName, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[], type_arguments=None), name=hashColumn)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Column, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=Columns.archive_content, selectors=[], type_arguments=None)], member=getColumnByName, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[], type_arguments=None), name=contentColumn)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Column, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lastUpdateColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=hashColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=contentColumn, 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=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getModuleSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=moduleSpec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ScriptModuleSpec, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLongValue, postfix_operators=[], prefix_operators=[], qualifier=lastUpdateColumn, selectors=[], type_arguments=None), name=lastUpdateTime)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getByteArrayValue, postfix_operators=[], prefix_operators=[], qualifier=hashColumn, selectors=[], type_arguments=None), name=hash)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getByteArrayValue, postfix_operators=[], prefix_operators=[], qualifier=contentColumn, selectors=[], type_arguments=None), name=content)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=hash, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=verifyHash, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Content hash validation failed for moduleId {}. size: {}"), MemberReference(member=moduleId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=content, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), 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=moduleId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=lastUpdateTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".jar")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=fileName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=archiveOuputDir, selectors=[], type_arguments=None), name=jarFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=jarFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=jarFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=moduleSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setModuleSpec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=lastUpdateTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCreateTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JarScriptArchive, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None))), name=scriptArchive)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JarScriptArchive, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=scriptArchive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=archives, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Row, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=moduleIdList, selectors=[], type_arguments=None), operator=<), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[member[.archives]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[ScriptArchive] operator[>] identifier[getScriptArchives] operator[SEP] identifier[Set] operator[<] identifier[ModuleId] operator[>] identifier[moduleIds] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Set] operator[<] identifier[ScriptArchive] operator[>] identifier[archives] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[ScriptArchive] operator[>] operator[SEP] identifier[moduleIds] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[*] Other[2] operator[SEP] operator[SEP] identifier[Path] identifier[archiveOuputDir] operator[=] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getArchiveOutputDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ModuleId] operator[>] identifier[moduleIdList] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[ModuleId] operator[>] operator[SEP] identifier[moduleIds] operator[SEP] operator[SEP] Keyword[int] identifier[batchSize] operator[=] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getArchiveFetchBatchSize] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[start] operator[=] Other[0] operator[SEP] Keyword[try] { Keyword[while] operator[SEP] identifier[start] operator[<] identifier[moduleIdList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[end] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[moduleIdList] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[start] operator[+] identifier[batchSize] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ModuleId] operator[>] identifier[batchModuleIds] operator[=] identifier[moduleIdList] operator[SEP] identifier[subList] operator[SEP] identifier[start] , identifier[end] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[rowKeys] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[batchModuleIds] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ModuleId] identifier[batchModuleId] operator[:] identifier[batchModuleIds] operator[SEP] { identifier[rowKeys] operator[SEP] identifier[add] operator[SEP] identifier[batchModuleId] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Rows] operator[<] identifier[String] , identifier[String] operator[>] identifier[rows] operator[=] identifier[cassandra] operator[SEP] identifier[getRows] operator[SEP] identifier[rowKeys] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Row] operator[<] identifier[String] , identifier[String] operator[>] identifier[row] operator[:] identifier[rows] operator[SEP] { identifier[String] identifier[moduleId] operator[=] identifier[row] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[ColumnList] operator[<] identifier[String] operator[>] identifier[columns] operator[=] identifier[row] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] identifier[Column] operator[<] identifier[String] operator[>] identifier[lastUpdateColumn] operator[=] identifier[columns] operator[SEP] identifier[getColumnByName] operator[SEP] identifier[Columns] operator[SEP] identifier[last_update] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Column] operator[<] identifier[String] operator[>] identifier[hashColumn] operator[=] identifier[columns] operator[SEP] identifier[getColumnByName] operator[SEP] identifier[Columns] operator[SEP] identifier[archive_content_hash] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Column] operator[<] identifier[String] operator[>] identifier[contentColumn] operator[=] identifier[columns] operator[SEP] identifier[getColumnByName] operator[SEP] identifier[Columns] operator[SEP] identifier[archive_content] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastUpdateColumn] operator[==] Other[null] operator[||] identifier[hashColumn] operator[==] Other[null] operator[||] identifier[contentColumn] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[ScriptModuleSpec] identifier[moduleSpec] operator[=] identifier[getModuleSpec] operator[SEP] identifier[columns] operator[SEP] operator[SEP] Keyword[long] identifier[lastUpdateTime] operator[=] identifier[lastUpdateColumn] operator[SEP] identifier[getLongValue] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[hash] operator[=] identifier[hashColumn] operator[SEP] identifier[getByteArrayValue] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[content] operator[=] identifier[contentColumn] operator[SEP] identifier[getByteArrayValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hash] operator[!=] Other[null] operator[&&] identifier[hash] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] operator[!] identifier[verifyHash] operator[SEP] identifier[hash] , identifier[content] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[moduleId] , identifier[content] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[String] identifier[fileName] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[moduleId] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[lastUpdateTime] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[jarFile] operator[=] identifier[archiveOuputDir] operator[SEP] identifier[resolve] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] identifier[Files] operator[SEP] identifier[write] operator[SEP] identifier[jarFile] , identifier[content] operator[SEP] operator[SEP] identifier[JarScriptArchive] identifier[scriptArchive] operator[=] Keyword[new] identifier[JarScriptArchive] operator[SEP] identifier[Builder] operator[SEP] identifier[jarFile] operator[SEP] operator[SEP] identifier[setModuleSpec] operator[SEP] identifier[moduleSpec] operator[SEP] operator[SEP] identifier[setCreateTime] operator[SEP] identifier[lastUpdateTime] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[archives] operator[SEP] identifier[add] operator[SEP] identifier[scriptArchive] operator[SEP] operator[SEP] } identifier[start] operator[=] identifier[end] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[archives] operator[SEP] }
protected static void rewriteInSubqueryAsExists( ParsedSelectStmt selectStmt, AbstractExpression inListExpr) { List<AbstractExpression> whereList = new ArrayList<>(); List<AbstractExpression> havingList = new ArrayList<>(); // multi-column IN expression is a RowSubqueryExpression // where each arg represents an individual column List<AbstractExpression> inExprList = null; if (inListExpr instanceof RowSubqueryExpression) { inExprList = inListExpr.getArgs(); } else { inExprList = new ArrayList<>(); inExprList.add(inListExpr); } int idx = 0; assert(inExprList.size() == selectStmt.m_displayColumns.size()); selectStmt.m_aggregationList = new ArrayList<>(); // Iterate over the columns from the IN list // and the subquery output schema // For each pair create a new equality expression. // If the output column is part of the aggregate expression, the // new expression must be added to the subquery's HAVING expressions. // If not, it should be added to the WHERE expressions for (AbstractExpression expr : inExprList) { ParsedColInfo colInfo = selectStmt.m_displayColumns.get(idx++); assert(colInfo.m_expression != null); // The TVE and the aggregated expressions from the IN clause will // be parameters to the child select statement once the IN // expression is replaced with the EXISTS one. expr = selectStmt.replaceExpressionsWithPve(expr); // Finalize the expression. The subquery's own expressions // are already finalized but not the expressions from the IN list ExpressionUtil.finalizeValueTypes(expr); // Create new compare equal expression AbstractExpression equalityExpr = new ComparisonExpression(ExpressionType.COMPARE_EQUAL, expr, colInfo.m_expression.clone()); // Check if this column contains aggregate expression if (ExpressionUtil.containsAggregateExpression(colInfo.m_expression)) { // We are not creating any new aggregate expressions so // the aggregation list doen't need to be updated. // Only the HAVING expression itself havingList.add(equalityExpr); } else { whereList.add(equalityExpr); } } // Add new WHERE expressions if ( ! whereList.isEmpty()) { if (selectStmt.m_joinTree.getWhereExpression() != null) { whereList.add(selectStmt.m_joinTree.getWhereExpression()); } selectStmt.m_joinTree.setWhereExpression( ExpressionUtil.combinePredicates(whereList)); } // Add new HAVING expressions if (!havingList.isEmpty()) { if (selectStmt.m_having != null) { havingList.add(selectStmt.m_having); } selectStmt.m_having = ExpressionUtil.combinePredicates(havingList); // reprocess HAVING expressions ExpressionUtil.finalizeValueTypes(selectStmt.m_having); } selectStmt.m_aggregationList = null; if (selectStmt.needComplexAggregation()) { selectStmt.fillUpAggResultColumns(); } else { selectStmt.m_aggResultColumns = selectStmt.m_displayColumns; } selectStmt.placeTVEsinColumns(); }
class class_name[name] begin[{] method[rewriteInSubqueryAsExists, return_type[void], modifier[static protected], parameter[selectStmt, inListExpr]] begin[{] local_variable[type[List], whereList] local_variable[type[List], havingList] local_variable[type[List], inExprList] if[binary_operation[member[.inListExpr], instanceof, type[RowSubqueryExpression]]] begin[{] assign[member[.inExprList], call[inListExpr.getArgs, parameter[]]] else begin[{] assign[member[.inExprList], 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))] call[inExprList.add, parameter[member[.inListExpr]]] end[}] local_variable[type[int], idx] AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=inExprList, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=selectStmt.m_displayColumns, selectors=[], type_arguments=None), operator===), label=None, value=None) assign[member[selectStmt.m_aggregationList], 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))] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=idx, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=selectStmt.m_displayColumns, selectors=[], type_arguments=None), name=colInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ParsedColInfo, sub_type=None)), AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=m_expression, postfix_operators=[], prefix_operators=[], qualifier=colInfo, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=replaceExpressionsWithPve, postfix_operators=[], prefix_operators=[], qualifier=selectStmt, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=finalizeValueTypes, postfix_operators=[], prefix_operators=[], qualifier=ExpressionUtil, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=COMPARE_EQUAL, postfix_operators=[], prefix_operators=[], qualifier=ExpressionType, selectors=[]), MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=colInfo.m_expression, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ComparisonExpression, sub_type=None)), name=equalityExpr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractExpression, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=m_expression, postfix_operators=[], prefix_operators=[], qualifier=colInfo, selectors=[])], member=containsAggregateExpression, postfix_operators=[], prefix_operators=[], qualifier=ExpressionUtil, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=equalityExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=whereList, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=equalityExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=havingList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=inExprList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=expr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractExpression, sub_type=None))), label=None) if[call[whereList.isEmpty, parameter[]]] begin[{] if[binary_operation[call[selectStmt.m_joinTree.getWhereExpression, parameter[]], !=, literal[null]]] begin[{] call[whereList.add, parameter[call[selectStmt.m_joinTree.getWhereExpression, parameter[]]]] else begin[{] None end[}] call[selectStmt.m_joinTree.setWhereExpression, parameter[call[ExpressionUtil.combinePredicates, parameter[member[.whereList]]]]] else begin[{] None end[}] if[call[havingList.isEmpty, parameter[]]] begin[{] if[binary_operation[member[selectStmt.m_having], !=, literal[null]]] begin[{] call[havingList.add, parameter[member[selectStmt.m_having]]] else begin[{] None end[}] assign[member[selectStmt.m_having], call[ExpressionUtil.combinePredicates, parameter[member[.havingList]]]] call[ExpressionUtil.finalizeValueTypes, parameter[member[selectStmt.m_having]]] else begin[{] None end[}] assign[member[selectStmt.m_aggregationList], literal[null]] if[call[selectStmt.needComplexAggregation, parameter[]]] begin[{] call[selectStmt.fillUpAggResultColumns, parameter[]] else begin[{] assign[member[selectStmt.m_aggResultColumns], member[selectStmt.m_displayColumns]] end[}] call[selectStmt.placeTVEsinColumns, parameter[]] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[void] identifier[rewriteInSubqueryAsExists] operator[SEP] identifier[ParsedSelectStmt] identifier[selectStmt] , identifier[AbstractExpression] identifier[inListExpr] operator[SEP] { identifier[List] operator[<] identifier[AbstractExpression] operator[>] identifier[whereList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[AbstractExpression] operator[>] identifier[havingList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[AbstractExpression] operator[>] identifier[inExprList] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[inListExpr] Keyword[instanceof] identifier[RowSubqueryExpression] operator[SEP] { identifier[inExprList] operator[=] identifier[inListExpr] operator[SEP] identifier[getArgs] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[inExprList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[inExprList] operator[SEP] identifier[add] operator[SEP] identifier[inListExpr] operator[SEP] operator[SEP] } Keyword[int] identifier[idx] operator[=] Other[0] operator[SEP] Keyword[assert] operator[SEP] identifier[inExprList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[selectStmt] operator[SEP] identifier[m_displayColumns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[selectStmt] operator[SEP] identifier[m_aggregationList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AbstractExpression] identifier[expr] operator[:] identifier[inExprList] operator[SEP] { identifier[ParsedColInfo] identifier[colInfo] operator[=] identifier[selectStmt] operator[SEP] identifier[m_displayColumns] operator[SEP] identifier[get] operator[SEP] identifier[idx] operator[++] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[colInfo] operator[SEP] identifier[m_expression] operator[!=] Other[null] operator[SEP] operator[SEP] identifier[expr] operator[=] identifier[selectStmt] operator[SEP] identifier[replaceExpressionsWithPve] operator[SEP] identifier[expr] operator[SEP] operator[SEP] identifier[ExpressionUtil] operator[SEP] identifier[finalizeValueTypes] operator[SEP] identifier[expr] operator[SEP] operator[SEP] identifier[AbstractExpression] identifier[equalityExpr] operator[=] Keyword[new] identifier[ComparisonExpression] operator[SEP] identifier[ExpressionType] operator[SEP] identifier[COMPARE_EQUAL] , identifier[expr] , identifier[colInfo] operator[SEP] identifier[m_expression] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ExpressionUtil] operator[SEP] identifier[containsAggregateExpression] operator[SEP] identifier[colInfo] operator[SEP] identifier[m_expression] operator[SEP] operator[SEP] { identifier[havingList] operator[SEP] identifier[add] operator[SEP] identifier[equalityExpr] operator[SEP] operator[SEP] } Keyword[else] { identifier[whereList] operator[SEP] identifier[add] operator[SEP] identifier[equalityExpr] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[whereList] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[selectStmt] operator[SEP] identifier[m_joinTree] operator[SEP] identifier[getWhereExpression] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[whereList] operator[SEP] identifier[add] operator[SEP] identifier[selectStmt] operator[SEP] identifier[m_joinTree] operator[SEP] identifier[getWhereExpression] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[selectStmt] operator[SEP] identifier[m_joinTree] operator[SEP] identifier[setWhereExpression] operator[SEP] identifier[ExpressionUtil] operator[SEP] identifier[combinePredicates] operator[SEP] identifier[whereList] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[havingList] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[selectStmt] operator[SEP] identifier[m_having] operator[!=] Other[null] operator[SEP] { identifier[havingList] operator[SEP] identifier[add] operator[SEP] identifier[selectStmt] operator[SEP] identifier[m_having] operator[SEP] operator[SEP] } identifier[selectStmt] operator[SEP] identifier[m_having] operator[=] identifier[ExpressionUtil] operator[SEP] identifier[combinePredicates] operator[SEP] identifier[havingList] operator[SEP] operator[SEP] identifier[ExpressionUtil] operator[SEP] identifier[finalizeValueTypes] operator[SEP] identifier[selectStmt] operator[SEP] identifier[m_having] operator[SEP] operator[SEP] } identifier[selectStmt] operator[SEP] identifier[m_aggregationList] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[selectStmt] operator[SEP] identifier[needComplexAggregation] operator[SEP] operator[SEP] operator[SEP] { identifier[selectStmt] operator[SEP] identifier[fillUpAggResultColumns] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[selectStmt] operator[SEP] identifier[m_aggResultColumns] operator[=] identifier[selectStmt] operator[SEP] identifier[m_displayColumns] operator[SEP] } identifier[selectStmt] operator[SEP] identifier[placeTVEsinColumns] operator[SEP] operator[SEP] operator[SEP] }
public OvhOrder cdn_dedicated_serviceName_backend_duration_GET(String serviceName, String duration, Long backend) throws IOException { String qPath = "/order/cdn/dedicated/{serviceName}/backend/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); query(sb, "backend", backend); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhOrder.class); }
class class_name[name] begin[{] method[cdn_dedicated_serviceName_backend_duration_GET, return_type[type[OvhOrder]], modifier[public], parameter[serviceName, duration, backend]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] call[.query, parameter[member[.sb], literal["backend"], member[.backend]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhOrder, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhOrder] identifier[cdn_dedicated_serviceName_backend_duration_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[duration] , identifier[Long] identifier[backend] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[duration] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[backend] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhOrder] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
@Nonnull private static ESuccess _copyFileViaStreams (@Nonnull final File aSrcFile, @Nonnull final File aDestFile) { final InputStream aSrcIS = FileHelper.getInputStream (aSrcFile); if (aSrcIS == null) return ESuccess.FAILURE; try { final OutputStream aDstOS = FileHelper.getOutputStream (aDestFile, EAppend.TRUNCATE); if (aDstOS == null) return ESuccess.FAILURE; try { return StreamHelper.copyInputStreamToOutputStream (aSrcIS, aDstOS); } finally { StreamHelper.close (aDstOS); } } finally { StreamHelper.close (aSrcIS); } }
class class_name[name] begin[{] method[_copyFileViaStreams, return_type[type[ESuccess]], modifier[private static], parameter[aSrcFile, aDestFile]] begin[{] local_variable[type[InputStream], aSrcIS] if[binary_operation[member[.aSrcIS], ==, literal[null]]] begin[{] return[member[ESuccess.FAILURE]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=aDestFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=TRUNCATE, postfix_operators=[], prefix_operators=[], qualifier=EAppend, selectors=[])], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=FileHelper, selectors=[], type_arguments=None), name=aDstOS)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=OutputStream, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aDstOS, 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=ReturnStatement(expression=MemberReference(member=FAILURE, postfix_operators=[], prefix_operators=[], qualifier=ESuccess, selectors=[]), label=None)), TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=aSrcIS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aDstOS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyInputStreamToOutputStream, postfix_operators=[], prefix_operators=[], qualifier=StreamHelper, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aDstOS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=StreamHelper, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aSrcIS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=StreamHelper, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[private] Keyword[static] identifier[ESuccess] identifier[_copyFileViaStreams] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[File] identifier[aSrcFile] , annotation[@] identifier[Nonnull] Keyword[final] identifier[File] identifier[aDestFile] operator[SEP] { Keyword[final] identifier[InputStream] identifier[aSrcIS] operator[=] identifier[FileHelper] operator[SEP] identifier[getInputStream] operator[SEP] identifier[aSrcFile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aSrcIS] operator[==] Other[null] operator[SEP] Keyword[return] identifier[ESuccess] operator[SEP] identifier[FAILURE] operator[SEP] Keyword[try] { Keyword[final] identifier[OutputStream] identifier[aDstOS] operator[=] identifier[FileHelper] operator[SEP] identifier[getOutputStream] operator[SEP] identifier[aDestFile] , identifier[EAppend] operator[SEP] identifier[TRUNCATE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aDstOS] operator[==] Other[null] operator[SEP] Keyword[return] identifier[ESuccess] operator[SEP] identifier[FAILURE] operator[SEP] Keyword[try] { Keyword[return] identifier[StreamHelper] operator[SEP] identifier[copyInputStreamToOutputStream] operator[SEP] identifier[aSrcIS] , identifier[aDstOS] operator[SEP] operator[SEP] } Keyword[finally] { identifier[StreamHelper] operator[SEP] identifier[close] operator[SEP] identifier[aDstOS] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[StreamHelper] operator[SEP] identifier[close] operator[SEP] identifier[aSrcIS] operator[SEP] operator[SEP] } }
public String exit() { agent.send(EXIT); exit.awaitSilent(); agent.close(); return EXITED; }
class class_name[name] begin[{] method[exit, return_type[type[String]], modifier[public], parameter[]] begin[{] call[agent.send, parameter[member[.EXIT]]] call[exit.awaitSilent, parameter[]] call[agent.close, parameter[]] return[member[.EXITED]] end[}] END[}]
Keyword[public] identifier[String] identifier[exit] operator[SEP] operator[SEP] { identifier[agent] operator[SEP] identifier[send] operator[SEP] identifier[EXIT] operator[SEP] operator[SEP] identifier[exit] operator[SEP] identifier[awaitSilent] operator[SEP] operator[SEP] operator[SEP] identifier[agent] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[EXITED] operator[SEP] }
private void deleteTOCTag(SpanManager sm) { // delete all __TOC__ from SRC int temp = 0; while ((temp = sm.indexOf("__TOC__", temp)) != -1) { sm.delete(temp, temp + 2 + 3 + 2); } // delete all __NOTOC__ from SRC temp = 0; while ((temp = sm.indexOf("__NOTOC__", temp)) != -1) { sm.delete(temp, temp + 2 + 5 + 2); } }
class class_name[name] begin[{] method[deleteTOCTag, return_type[void], modifier[private], parameter[sm]] begin[{] local_variable[type[int], temp] while[binary_operation[assign[member[.temp], call[sm.indexOf, parameter[literal["__TOC__"], member[.temp]]]], !=, literal[1]]] begin[{] call[sm.delete, parameter[member[.temp], binary_operation[binary_operation[binary_operation[member[.temp], +, literal[2]], +, literal[3]], +, literal[2]]]] end[}] assign[member[.temp], literal[0]] while[binary_operation[assign[member[.temp], call[sm.indexOf, parameter[literal["__NOTOC__"], member[.temp]]]], !=, literal[1]]] begin[{] call[sm.delete, parameter[member[.temp], binary_operation[binary_operation[binary_operation[member[.temp], +, literal[2]], +, literal[5]], +, literal[2]]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[deleteTOCTag] operator[SEP] identifier[SpanManager] identifier[sm] operator[SEP] { Keyword[int] identifier[temp] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[temp] operator[=] identifier[sm] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[temp] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[sm] operator[SEP] identifier[delete] operator[SEP] identifier[temp] , identifier[temp] operator[+] Other[2] operator[+] Other[3] operator[+] Other[2] operator[SEP] operator[SEP] } identifier[temp] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[temp] operator[=] identifier[sm] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[temp] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[sm] operator[SEP] identifier[delete] operator[SEP] identifier[temp] , identifier[temp] operator[+] Other[2] operator[+] Other[5] operator[+] Other[2] operator[SEP] operator[SEP] } }
public static boolean hasLegacyWebContent(AccessibilityNodeInfoCompat node) { if (node == null) { return false; } if (!supportsWebActions(node)) { return false; } // ChromeVox does not have sub elements, so if the parent element also has web content // this cannot be ChromeVox. AccessibilityNodeInfoCompat parent = node.getParent(); if (supportsWebActions(parent)) { if (parent != null) { parent.recycle(); } return false; } if (parent != null) { parent.recycle(); } // ChromeVox never has child elements return node.getChildCount() == 0; }
class class_name[name] begin[{] method[hasLegacyWebContent, return_type[type[boolean]], modifier[public static], parameter[node]] begin[{] if[binary_operation[member[.node], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[.supportsWebActions, parameter[member[.node]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[AccessibilityNodeInfoCompat], parent] if[call[.supportsWebActions, parameter[member[.parent]]]] begin[{] if[binary_operation[member[.parent], !=, literal[null]]] begin[{] call[parent.recycle, parameter[]] else begin[{] None end[}] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.parent], !=, literal[null]]] begin[{] call[parent.recycle, parameter[]] else begin[{] None end[}] return[binary_operation[call[node.getChildCount, parameter[]], ==, literal[0]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[hasLegacyWebContent] operator[SEP] identifier[AccessibilityNodeInfoCompat] identifier[node] operator[SEP] { Keyword[if] operator[SEP] identifier[node] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[supportsWebActions] operator[SEP] identifier[node] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[AccessibilityNodeInfoCompat] identifier[parent] operator[=] identifier[node] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[supportsWebActions] operator[SEP] identifier[parent] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] { identifier[parent] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] { identifier[parent] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[node] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] }
public static boolean refresh() { boolean changed = false; for (ZoneRulesProvider provider : PROVIDERS) { changed |= provider.provideRefresh(); } return changed; }
class class_name[name] begin[{] method[refresh, return_type[type[boolean]], modifier[public static], parameter[]] begin[{] local_variable[type[boolean], changed] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=MethodInvocation(arguments=[], member=provideRefresh, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=PROVIDERS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=provider)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ZoneRulesProvider, sub_type=None))), label=None) return[member[.changed]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[refresh] operator[SEP] operator[SEP] { Keyword[boolean] identifier[changed] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[ZoneRulesProvider] identifier[provider] operator[:] identifier[PROVIDERS] operator[SEP] { identifier[changed] operator[|=] identifier[provider] operator[SEP] identifier[provideRefresh] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[changed] operator[SEP] }
@Override public UpdateKeyDescriptionResult updateKeyDescription(UpdateKeyDescriptionRequest request) { request = beforeClientExecution(request); return executeUpdateKeyDescription(request); }
class class_name[name] begin[{] method[updateKeyDescription, return_type[type[UpdateKeyDescriptionResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeUpdateKeyDescription, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[UpdateKeyDescriptionResult] identifier[updateKeyDescription] operator[SEP] identifier[UpdateKeyDescriptionRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateKeyDescription] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
protected final void fireVetoableChange(String propertyName, long oldValue, long newValue) throws PropertyVetoException { fireVetoableChange(propertyName, Long.valueOf(oldValue), Long.valueOf(newValue)); }
class class_name[name] begin[{] method[fireVetoableChange, return_type[void], modifier[final protected], parameter[propertyName, oldValue, newValue]] begin[{] call[.fireVetoableChange, parameter[member[.propertyName], call[Long.valueOf, parameter[member[.oldValue]]], call[Long.valueOf, parameter[member[.newValue]]]]] end[}] END[}]
Keyword[protected] Keyword[final] Keyword[void] identifier[fireVetoableChange] operator[SEP] identifier[String] identifier[propertyName] , Keyword[long] identifier[oldValue] , Keyword[long] identifier[newValue] operator[SEP] Keyword[throws] identifier[PropertyVetoException] { identifier[fireVetoableChange] operator[SEP] identifier[propertyName] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[oldValue] operator[SEP] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] operator[SEP] }
private static String analyst(String date) { String style = null; boolean hasDiagonal = false; Replacer r = Replacer.of(checkNotNull(date)); if (hasDiagonal = r.contain("/")) { r.update(r.lookups("/").with("-")); } //ISO if (r.containAll(".", "T")) { style = DateStyle.ISO_FORMAT; } //CST else if (r.contain("CST")) { style = DateStyle.CST_FORMAT; } //GMT else if (r.contain("GMT")) { style = DateStyle.GMT_FORMAT; } //analyst else { switch (date.length()) { case 6: style = "HHmmss"; break; case 8: style = r.contain(":") ? DateStyle.HH_mm_ss : DateStyle.yyyyMMdd; break; case 10: style = DateStyle.yyyy_MM_dd; break; case 14: style = DateStyle.yyyyMMddHHmmss; break; case 19: style = DateStyle.yyyy_MM_dd_HH_mm_ss; break; } } return hasDiagonal ? r.set(style).lookups("-").with("/") : style; }
class class_name[name] begin[{] method[analyst, return_type[type[String]], modifier[private static], parameter[date]] begin[{] local_variable[type[String], style] local_variable[type[boolean], hasDiagonal] local_variable[type[Replacer], r] if[assign[member[.hasDiagonal], call[r.contain, parameter[literal["/"]]]]] begin[{] call[r.update, parameter[call[r.lookups, parameter[literal["/"]]]]] else begin[{] None end[}] if[call[r.containAll, parameter[literal["."], literal["T"]]]] begin[{] assign[member[.style], member[DateStyle.ISO_FORMAT]] else begin[{] if[call[r.contain, parameter[literal["CST"]]]] begin[{] assign[member[.style], member[DateStyle.CST_FORMAT]] else begin[{] if[call[r.contain, parameter[literal["GMT"]]]] begin[{] assign[member[.style], member[DateStyle.GMT_FORMAT]] else begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=style, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="HHmmss")), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=style, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":")], member=contain, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), if_false=MemberReference(member=yyyyMMdd, postfix_operators=[], prefix_operators=[], qualifier=DateStyle, selectors=[]), if_true=MemberReference(member=HH_mm_ss, postfix_operators=[], prefix_operators=[], qualifier=DateStyle, selectors=[]))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=style, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=yyyy_MM_dd, postfix_operators=[], prefix_operators=[], qualifier=DateStyle, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=14)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=style, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=yyyyMMddHHmmss, postfix_operators=[], prefix_operators=[], qualifier=DateStyle, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=19)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=style, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=yyyy_MM_dd_HH_mm_ss, postfix_operators=[], prefix_operators=[], qualifier=DateStyle, selectors=[])), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=date, selectors=[], type_arguments=None), label=None) end[}] end[}] end[}] return[TernaryExpression(condition=MemberReference(member=hasDiagonal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=style, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=style, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=lookups, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=with, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[analyst] operator[SEP] identifier[String] identifier[date] operator[SEP] { identifier[String] identifier[style] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[hasDiagonal] operator[=] literal[boolean] operator[SEP] identifier[Replacer] identifier[r] operator[=] identifier[Replacer] operator[SEP] identifier[of] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[date] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasDiagonal] operator[=] identifier[r] operator[SEP] identifier[contain] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[r] operator[SEP] identifier[update] operator[SEP] identifier[r] operator[SEP] identifier[lookups] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[with] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[r] operator[SEP] identifier[containAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] { identifier[style] operator[=] identifier[DateStyle] operator[SEP] identifier[ISO_FORMAT] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[r] operator[SEP] identifier[contain] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[style] operator[=] identifier[DateStyle] operator[SEP] identifier[CST_FORMAT] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[r] operator[SEP] identifier[contain] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[style] operator[=] identifier[DateStyle] operator[SEP] identifier[GMT_FORMAT] operator[SEP] } Keyword[else] { Keyword[switch] operator[SEP] identifier[date] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] Other[6] operator[:] identifier[style] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[8] operator[:] identifier[style] operator[=] identifier[r] operator[SEP] identifier[contain] operator[SEP] literal[String] operator[SEP] operator[?] identifier[DateStyle] operator[SEP] identifier[HH_mm_ss] operator[:] identifier[DateStyle] operator[SEP] identifier[yyyyMMdd] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[10] operator[:] identifier[style] operator[=] identifier[DateStyle] operator[SEP] identifier[yyyy_MM_dd] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[14] operator[:] identifier[style] operator[=] identifier[DateStyle] operator[SEP] identifier[yyyyMMddHHmmss] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[19] operator[:] identifier[style] operator[=] identifier[DateStyle] operator[SEP] identifier[yyyy_MM_dd_HH_mm_ss] operator[SEP] Keyword[break] operator[SEP] } } Keyword[return] identifier[hasDiagonal] operator[?] identifier[r] operator[SEP] identifier[set] operator[SEP] identifier[style] operator[SEP] operator[SEP] identifier[lookups] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[with] operator[SEP] literal[String] operator[SEP] operator[:] identifier[style] operator[SEP] }