code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static <V> Predicate<TaskContext<V>> ifResult(Predicate<V> predicate) { return ctx -> predicate.test(ctx.getResult()); }
class class_name[name] begin[{] method[ifResult, return_type[type[Predicate]], modifier[public static], parameter[predicate]] begin[{] return[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResult, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None)], member=test, postfix_operators=[], prefix_operators=[], qualifier=predicate, selectors=[], type_arguments=None), parameters=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[V] operator[>] identifier[Predicate] operator[<] identifier[TaskContext] operator[<] identifier[V] operator[>] operator[>] identifier[ifResult] operator[SEP] identifier[Predicate] operator[<] identifier[V] operator[>] identifier[predicate] operator[SEP] { Keyword[return] identifier[ctx] operator[->] identifier[predicate] operator[SEP] identifier[test] operator[SEP] identifier[ctx] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public PreparedStatement getPreparedStatement(Q query, boolean useCaching) { PreparedStatement pStatement = null; if (useCaching) { pStatement = cachedStatement.get(); } if (pStatement == null) { try { RegularStatement stmt = getQueryGen(query).call(); if (LOG.isDebugEnabled()) { LOG.debug("Query: " + stmt.getQueryString()); } pStatement = sessionRef.get().prepare(stmt.getQueryString()); } catch (Exception e) { throw new RuntimeException(e); } } if (useCaching && cachedStatement.get() == null) { cachedStatement.set(pStatement); } return pStatement; }
class class_name[name] begin[{] method[getPreparedStatement, return_type[type[PreparedStatement]], modifier[public], parameter[query, useCaching]] begin[{] local_variable[type[PreparedStatement], pStatement] if[member[.useCaching]] begin[{] assign[member[.pStatement], call[cachedStatement.get, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.pStatement], ==, literal[null]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getQueryGen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=call, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=stmt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RegularStatement, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Query: "), operandr=MethodInvocation(arguments=[], member=getQueryString, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pStatement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=sessionRef, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getQueryString, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None)], member=prepare, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] if[binary_operation[member[.useCaching], &&, binary_operation[call[cachedStatement.get, parameter[]], ==, literal[null]]]] begin[{] call[cachedStatement.set, parameter[member[.pStatement]]] else begin[{] None end[}] return[member[.pStatement]] end[}] END[}]
Keyword[public] identifier[PreparedStatement] identifier[getPreparedStatement] operator[SEP] identifier[Q] identifier[query] , Keyword[boolean] identifier[useCaching] operator[SEP] { identifier[PreparedStatement] identifier[pStatement] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[useCaching] operator[SEP] { identifier[pStatement] operator[=] identifier[cachedStatement] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[pStatement] operator[==] Other[null] operator[SEP] { Keyword[try] { identifier[RegularStatement] identifier[stmt] operator[=] identifier[getQueryGen] operator[SEP] identifier[query] operator[SEP] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[stmt] operator[SEP] identifier[getQueryString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pStatement] operator[=] identifier[sessionRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[prepare] operator[SEP] identifier[stmt] operator[SEP] identifier[getQueryString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[useCaching] operator[&&] identifier[cachedStatement] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[cachedStatement] operator[SEP] identifier[set] operator[SEP] identifier[pStatement] operator[SEP] operator[SEP] } Keyword[return] identifier[pStatement] operator[SEP] }
private OutputStream decorate(OutputStream os) { for (ConsoleLogFilter f : ConsoleLogFilter.all()) { try { os = f.decorateLogger(this,os); } catch (IOException|InterruptedException e) { LOGGER.log(Level.WARNING, "Failed to filter log with "+f, e); } } return os; }
class class_name[name] begin[{] method[decorate, return_type[type[OutputStream]], modifier[private], parameter[os]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=os, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=os, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decorateLogger, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to filter log with "), operandr=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException', 'InterruptedException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=all, postfix_operators=[], prefix_operators=[], qualifier=ConsoleLogFilter, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConsoleLogFilter, sub_type=None))), label=None) return[member[.os]] end[}] END[}]
Keyword[private] identifier[OutputStream] identifier[decorate] operator[SEP] identifier[OutputStream] identifier[os] operator[SEP] { Keyword[for] operator[SEP] identifier[ConsoleLogFilter] identifier[f] operator[:] identifier[ConsoleLogFilter] operator[SEP] identifier[all] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[os] operator[=] identifier[f] operator[SEP] identifier[decorateLogger] operator[SEP] Keyword[this] , identifier[os] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] operator[|] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[f] , identifier[e] operator[SEP] operator[SEP] } } Keyword[return] identifier[os] operator[SEP] }
public ConfigOptionBuilder setCommandLineOptionWithArgument( CommandLineOption commandLineOption, StringConverter converter ) { co.setCommandLineOption( commandLineOption ); return setStringConverter( converter ); }
class class_name[name] begin[{] method[setCommandLineOptionWithArgument, return_type[type[ConfigOptionBuilder]], modifier[public], parameter[commandLineOption, converter]] begin[{] call[co.setCommandLineOption, parameter[member[.commandLineOption]]] return[call[.setStringConverter, parameter[member[.converter]]]] end[}] END[}]
Keyword[public] identifier[ConfigOptionBuilder] identifier[setCommandLineOptionWithArgument] operator[SEP] identifier[CommandLineOption] identifier[commandLineOption] , identifier[StringConverter] identifier[converter] operator[SEP] { identifier[co] operator[SEP] identifier[setCommandLineOption] operator[SEP] identifier[commandLineOption] operator[SEP] operator[SEP] Keyword[return] identifier[setStringConverter] operator[SEP] identifier[converter] operator[SEP] operator[SEP] }
public static void invokeOnRequestLog(RequestLogListener listener, RequestLog log) { try (SafeCloseable ignored = log.context().push()) { listener.onRequestLog(log); } catch (Throwable e) { logger.warn("onRequestLog() failed with an exception:", e); } }
class class_name[name] begin[{] method[invokeOnRequestLog, return_type[void], modifier[public static], parameter[listener, log]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onRequestLog, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="onRequestLog() failed with an exception:"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=ignored, type=ReferenceType(arguments=None, dimensions=[], name=SafeCloseable, sub_type=None), value=MethodInvocation(arguments=[], member=context, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[MethodInvocation(arguments=[], member=push, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))]) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[invokeOnRequestLog] operator[SEP] identifier[RequestLogListener] identifier[listener] , identifier[RequestLog] identifier[log] operator[SEP] { Keyword[try] operator[SEP] identifier[SafeCloseable] identifier[ignored] operator[=] identifier[log] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP] identifier[push] operator[SEP] operator[SEP] operator[SEP] { identifier[listener] operator[SEP] identifier[onRequestLog] operator[SEP] identifier[log] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public static Matrix arbitrariness(Matrix source, Matrix inverse) { Matrix intermediate = inverse.mtimes(source); return DenseDoubleMatrix2D.Factory.eye(intermediate.getRowCount(), intermediate.getColumnCount()).minus(intermediate); }
class class_name[name] begin[{] method[arbitrariness, return_type[type[Matrix]], modifier[public static], parameter[source, inverse]] begin[{] local_variable[type[Matrix], intermediate] return[call[DenseDoubleMatrix2D.Factory.eye, parameter[call[intermediate.getRowCount, parameter[]], call[intermediate.getColumnCount, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Matrix] identifier[arbitrariness] operator[SEP] identifier[Matrix] identifier[source] , identifier[Matrix] identifier[inverse] operator[SEP] { identifier[Matrix] identifier[intermediate] operator[=] identifier[inverse] operator[SEP] identifier[mtimes] operator[SEP] identifier[source] operator[SEP] operator[SEP] Keyword[return] identifier[DenseDoubleMatrix2D] operator[SEP] identifier[Factory] operator[SEP] identifier[eye] operator[SEP] identifier[intermediate] operator[SEP] identifier[getRowCount] operator[SEP] operator[SEP] , identifier[intermediate] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[minus] operator[SEP] identifier[intermediate] operator[SEP] operator[SEP] }
@Override public List<Example> actionCells(Example row) { List<Example> pressRow = new ArrayList<Example>(); pressRow.add(row.at(0, 1)); return pressRow; }
class class_name[name] begin[{] method[actionCells, return_type[type[List]], modifier[public], parameter[row]] begin[{] local_variable[type[List], pressRow] call[pressRow.add, parameter[call[row.at, parameter[literal[0], literal[1]]]]] return[member[.pressRow]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[Example] operator[>] identifier[actionCells] operator[SEP] identifier[Example] identifier[row] operator[SEP] { identifier[List] operator[<] identifier[Example] operator[>] identifier[pressRow] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Example] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[pressRow] operator[SEP] identifier[add] operator[SEP] identifier[row] operator[SEP] identifier[at] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[pressRow] operator[SEP] }
public final <C extends Property> PropertyList<C> getProperties(final String name) { return getProperties().getProperties(name); }
class class_name[name] begin[{] method[getProperties, return_type[type[PropertyList]], modifier[final public], parameter[name]] begin[{] return[call[.getProperties, parameter[]]] end[}] END[}]
Keyword[public] Keyword[final] operator[<] identifier[C] Keyword[extends] identifier[Property] operator[>] identifier[PropertyList] operator[<] identifier[C] operator[>] identifier[getProperties] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] { Keyword[return] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[getProperties] operator[SEP] identifier[name] operator[SEP] operator[SEP] }
public static dnsptrrec get(nitro_service service, String reversedomain) throws Exception{ dnsptrrec obj = new dnsptrrec(); obj.set_reversedomain(reversedomain); dnsptrrec response = (dnsptrrec) obj.get_resource(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[dnsptrrec]], modifier[public static], parameter[service, reversedomain]] begin[{] local_variable[type[dnsptrrec], obj] call[obj.set_reversedomain, parameter[member[.reversedomain]]] local_variable[type[dnsptrrec], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[dnsptrrec] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[reversedomain] operator[SEP] Keyword[throws] identifier[Exception] { identifier[dnsptrrec] identifier[obj] operator[=] Keyword[new] identifier[dnsptrrec] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_reversedomain] operator[SEP] identifier[reversedomain] operator[SEP] operator[SEP] identifier[dnsptrrec] identifier[response] operator[=] operator[SEP] identifier[dnsptrrec] operator[SEP] identifier[obj] operator[SEP] identifier[get_resource] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLDisjointClassesAxiomImpl instance) throws SerializationException { serialize(streamWriter, instance); }
class class_name[name] begin[{] method[serializeInstance, return_type[void], modifier[public], parameter[streamWriter, instance]] begin[{] call[.serialize, parameter[member[.streamWriter], member[.instance]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[serializeInstance] operator[SEP] identifier[SerializationStreamWriter] identifier[streamWriter] , identifier[OWLDisjointClassesAxiomImpl] identifier[instance] operator[SEP] Keyword[throws] identifier[SerializationException] { identifier[serialize] operator[SEP] identifier[streamWriter] , identifier[instance] operator[SEP] operator[SEP] }
public void parseFraction() { // get past . pos++; outer: while (pos < s.length()) { switch (s.charAt(pos)) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': pos++; break; case 'e': case 'E': parseExponent(); break; default: break outer; } } }
class class_name[name] begin[{] method[parseFraction, return_type[void], modifier[public], parameter[]] begin[{] member[.pos] while[binary_operation[member[.pos], <, call[s.length, parameter[]]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='1'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='2'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='3'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='4'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='5'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='6'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='7'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='8'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9')], statements=[StatementExpression(expression=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='e'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='E')], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=parseExponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=outer, label=None)])], expression=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[parseFraction] operator[SEP] operator[SEP] { identifier[pos] operator[++] operator[SEP] identifier[outer] operator[:] Keyword[while] operator[SEP] identifier[pos] operator[<] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[switch] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[SEP] { Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[pos] operator[++] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[parseExponent] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] identifier[outer] operator[SEP] } } }
public OvhVirtualNumber serviceName_virtualNumbers_number_GET(String serviceName, String number) throws IOException { String qPath = "/sms/{serviceName}/virtualNumbers/{number}"; StringBuilder sb = path(qPath, serviceName, number); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhVirtualNumber.class); }
class class_name[name] begin[{] method[serviceName_virtualNumbers_number_GET, return_type[type[OvhVirtualNumber]], modifier[public], parameter[serviceName, number]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhVirtualNumber, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhVirtualNumber] identifier[serviceName_virtualNumbers_number_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[number] 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[number] 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[OvhVirtualNumber] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public double[] positionAt( int col, int row ) { if (isInRaster(col, row)) { GridGeometry2D gridGeometry = getGridGeometry(); Coordinate coordinate = CoverageUtilities.coordinateFromColRow(col, row, gridGeometry); return new double[]{coordinate.x, coordinate.y}; } return null; }
class class_name[name] begin[{] method[positionAt, return_type[type[double]], modifier[public], parameter[col, row]] begin[{] if[call[.isInRaster, parameter[member[.col], member[.row]]]] begin[{] local_variable[type[GridGeometry2D], gridGeometry] local_variable[type[Coordinate], coordinate] return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=coordinate, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=coordinate, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[positionAt] operator[SEP] Keyword[int] identifier[col] , Keyword[int] identifier[row] operator[SEP] { Keyword[if] operator[SEP] identifier[isInRaster] operator[SEP] identifier[col] , identifier[row] operator[SEP] operator[SEP] { identifier[GridGeometry2D] identifier[gridGeometry] operator[=] identifier[getGridGeometry] operator[SEP] operator[SEP] operator[SEP] identifier[Coordinate] identifier[coordinate] operator[=] identifier[CoverageUtilities] operator[SEP] identifier[coordinateFromColRow] operator[SEP] identifier[col] , identifier[row] , identifier[gridGeometry] operator[SEP] operator[SEP] Keyword[return] Keyword[new] Keyword[double] operator[SEP] operator[SEP] { identifier[coordinate] operator[SEP] identifier[x] , identifier[coordinate] operator[SEP] identifier[y] } operator[SEP] } Keyword[return] Other[null] operator[SEP] }
private RelationType getRelationType(int type) { RelationType result; if (type > 0 && type < RELATION_TYPES.length) { result = RELATION_TYPES[type]; } else { result = RelationType.FINISH_START; } return result; }
class class_name[name] begin[{] method[getRelationType, return_type[type[RelationType]], modifier[private], parameter[type]] begin[{] local_variable[type[RelationType], result] if[binary_operation[binary_operation[member[.type], >, literal[0]], &&, binary_operation[member[.type], <, member[RELATION_TYPES.length]]]] begin[{] assign[member[.result], member[.RELATION_TYPES]] else begin[{] assign[member[.result], member[RelationType.FINISH_START]] end[}] return[member[.result]] end[}] END[}]
Keyword[private] identifier[RelationType] identifier[getRelationType] operator[SEP] Keyword[int] identifier[type] operator[SEP] { identifier[RelationType] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[>] Other[0] operator[&&] identifier[type] operator[<] identifier[RELATION_TYPES] operator[SEP] identifier[length] operator[SEP] { identifier[result] operator[=] identifier[RELATION_TYPES] operator[SEP] identifier[type] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[=] identifier[RelationType] operator[SEP] identifier[FINISH_START] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
@Override public RestRepositories getRepositories(Request request) { RestRepositories repositories = new RestRepositories(); for (String repositoryName : getRepositoryManager().getJcrRepositoryNames()) { addRepository(request, repositories, repositoryName); } return repositories; }
class class_name[name] begin[{] method[getRepositories, return_type[type[RestRepositories]], modifier[public], parameter[request]] begin[{] local_variable[type[RestRepositories], repositories] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=repositories, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=repositoryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRepository, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getRepositoryManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getJcrRepositoryNames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=repositoryName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.repositories]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[RestRepositories] identifier[getRepositories] operator[SEP] identifier[Request] identifier[request] operator[SEP] { identifier[RestRepositories] identifier[repositories] operator[=] Keyword[new] identifier[RestRepositories] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[repositoryName] operator[:] identifier[getRepositoryManager] operator[SEP] operator[SEP] operator[SEP] identifier[getJcrRepositoryNames] operator[SEP] operator[SEP] operator[SEP] { identifier[addRepository] operator[SEP] identifier[request] , identifier[repositories] , identifier[repositoryName] operator[SEP] operator[SEP] } Keyword[return] identifier[repositories] operator[SEP] }
public void reset(DataPoint dp) { this.timestamp = dp.timestamp(); this.is_integer = dp.isInteger(); if (is_integer) { this.value = dp.longValue(); } else { this.value = Double.doubleToRawLongBits(dp.doubleValue()); } }
class class_name[name] begin[{] method[reset, return_type[void], modifier[public], parameter[dp]] begin[{] assign[THIS[member[None.timestamp]], call[dp.timestamp, parameter[]]] assign[THIS[member[None.is_integer]], call[dp.isInteger, parameter[]]] if[member[.is_integer]] begin[{] assign[THIS[member[None.value]], call[dp.longValue, parameter[]]] else begin[{] assign[THIS[member[None.value]], call[Double.doubleToRawLongBits, parameter[call[dp.doubleValue, parameter[]]]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[reset] operator[SEP] identifier[DataPoint] identifier[dp] operator[SEP] { Keyword[this] operator[SEP] identifier[timestamp] operator[=] identifier[dp] operator[SEP] identifier[timestamp] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[is_integer] operator[=] identifier[dp] operator[SEP] identifier[isInteger] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[is_integer] operator[SEP] { Keyword[this] operator[SEP] identifier[value] operator[=] identifier[dp] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[value] operator[=] identifier[Double] operator[SEP] identifier[doubleToRawLongBits] operator[SEP] identifier[dp] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public static void setPropertiesFrom(URL propertyFile) throws IOException { final Properties systemProperties = System.getProperties(); try (InputStream stream = propertyFile.openStream()) { systemProperties.load(stream); } }
class class_name[name] begin[{] method[setPropertiesFrom, return_type[void], modifier[public static], parameter[propertyFile]] begin[{] local_variable[type[Properties], systemProperties] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=systemProperties, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=stream, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=MethodInvocation(arguments=[], member=openStream, postfix_operators=[], prefix_operators=[], qualifier=propertyFile, selectors=[], type_arguments=None))]) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setPropertiesFrom] operator[SEP] identifier[URL] identifier[propertyFile] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] identifier[Properties] identifier[systemProperties] operator[=] identifier[System] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[InputStream] identifier[stream] operator[=] identifier[propertyFile] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] operator[SEP] { identifier[systemProperties] operator[SEP] identifier[load] operator[SEP] identifier[stream] operator[SEP] operator[SEP] } }
public void computeMST(double[][] costs, UndirectedGraph graph) throws ContradictionException { g = graph; for (int i = 0; i < n; i++) { Tree.getNeighOf(i).clear(); } this.costs = costs; heap.clear(); inTree.clear(); treeCost = 0; tSize = 0; prim(); }
class class_name[name] begin[{] method[computeMST, return_type[void], modifier[public], parameter[costs, graph]] begin[{] assign[member[.g], member[.graph]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNeighOf, postfix_operators=[], prefix_operators=[], qualifier=Tree, selectors=[MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[THIS[member[None.costs]], member[.costs]] call[heap.clear, parameter[]] call[inTree.clear, parameter[]] assign[member[.treeCost], literal[0]] assign[member[.tSize], literal[0]] call[.prim, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[computeMST] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[costs] , identifier[UndirectedGraph] identifier[graph] operator[SEP] Keyword[throws] identifier[ContradictionException] { identifier[g] operator[=] identifier[graph] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Tree] operator[SEP] identifier[getNeighOf] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[costs] operator[=] identifier[costs] operator[SEP] identifier[heap] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[inTree] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[treeCost] operator[=] Other[0] operator[SEP] identifier[tSize] operator[=] Other[0] operator[SEP] identifier[prim] operator[SEP] operator[SEP] operator[SEP] }
public static JTextComponent textComponentAsLabel(JTextComponent textcomponent) { // Make the text component non editable textcomponent.setEditable(false); // Make the text area look like a label textcomponent.setBackground((Color)UIManager.get("Label.background")); textcomponent.setForeground((Color)UIManager.get("Label.foreground")); textcomponent.setBorder(null); return textcomponent; }
class class_name[name] begin[{] method[textComponentAsLabel, return_type[type[JTextComponent]], modifier[public static], parameter[textcomponent]] begin[{] call[textcomponent.setEditable, parameter[literal[false]]] call[textcomponent.setBackground, parameter[Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Label.background")], member=get, postfix_operators=[], prefix_operators=[], qualifier=UIManager, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Color, sub_type=None))]] call[textcomponent.setForeground, parameter[Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Label.foreground")], member=get, postfix_operators=[], prefix_operators=[], qualifier=UIManager, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Color, sub_type=None))]] call[textcomponent.setBorder, parameter[literal[null]]] return[member[.textcomponent]] end[}] END[}]
Keyword[public] Keyword[static] identifier[JTextComponent] identifier[textComponentAsLabel] operator[SEP] identifier[JTextComponent] identifier[textcomponent] operator[SEP] { identifier[textcomponent] operator[SEP] identifier[setEditable] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[textcomponent] operator[SEP] identifier[setBackground] operator[SEP] operator[SEP] identifier[Color] operator[SEP] identifier[UIManager] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[textcomponent] operator[SEP] identifier[setForeground] operator[SEP] operator[SEP] identifier[Color] operator[SEP] identifier[UIManager] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[textcomponent] operator[SEP] identifier[setBorder] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[textcomponent] operator[SEP] }
static boolean isOperationInGroup(int op) { switch (op) { case PLUS: case PLUS_EQUAL: case MINUS: case MINUS_EQUAL: case MULTIPLY: case MULTIPLY_EQUAL: return true; default: return false; } }
class class_name[name] begin[{] method[isOperationInGroup, return_type[type[boolean]], modifier[static], parameter[op]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['PLUS', 'PLUS_EQUAL', 'MINUS', 'MINUS_EQUAL', 'MULTIPLY', 'MULTIPLY_EQUAL'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])], expression=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[static] Keyword[boolean] identifier[isOperationInGroup] operator[SEP] Keyword[int] identifier[op] operator[SEP] { Keyword[switch] operator[SEP] identifier[op] operator[SEP] { Keyword[case] identifier[PLUS] operator[:] Keyword[case] identifier[PLUS_EQUAL] operator[:] Keyword[case] identifier[MINUS] operator[:] Keyword[case] identifier[MINUS_EQUAL] operator[:] Keyword[case] identifier[MULTIPLY] operator[:] Keyword[case] identifier[MULTIPLY_EQUAL] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[default] operator[:] Keyword[return] literal[boolean] operator[SEP] } }
public JBBPDslBuilder Long(final String name) { final Item item = new Item(BinType.LONG, name, this.byteOrder); this.addItem(item); return this; }
class class_name[name] begin[{] method[Long, return_type[type[JBBPDslBuilder]], modifier[public], parameter[name]] begin[{] local_variable[type[Item], item] THIS[call[None.addItem, parameter[member[.item]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[JBBPDslBuilder] identifier[Long] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] { Keyword[final] identifier[Item] identifier[item] operator[=] Keyword[new] identifier[Item] operator[SEP] identifier[BinType] operator[SEP] identifier[LONG] , identifier[name] , Keyword[this] operator[SEP] identifier[byteOrder] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[addItem] operator[SEP] identifier[item] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static int getDayOfYear(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date); return c.get(Calendar.DAY_OF_YEAR); }
class class_name[name] begin[{] method[getDayOfYear, return_type[type[int]], modifier[public static], parameter[date]] begin[{] local_variable[type[Calendar], c] call[c.setTime, parameter[member[.date]]] return[call[c.get, parameter[member[Calendar.DAY_OF_YEAR]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[getDayOfYear] operator[SEP] identifier[Date] identifier[date] operator[SEP] { identifier[Calendar] identifier[c] operator[=] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[setTime] operator[SEP] identifier[date] operator[SEP] operator[SEP] Keyword[return] identifier[c] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_YEAR] operator[SEP] operator[SEP] }
@Modified protected void modified(Map<String, Object> cfg) { WebContainerConfiguration webconfig = new WebContainerConfiguration(DEFAULT_PORT); webconfig.setDefaultVirtualHostName(DEFAULT_VHOST_NAME); initialize(webconfig, cfg); }
class class_name[name] begin[{] method[modified, return_type[void], modifier[protected], parameter[cfg]] begin[{] local_variable[type[WebContainerConfiguration], webconfig] call[webconfig.setDefaultVirtualHostName, parameter[member[.DEFAULT_VHOST_NAME]]] call[.initialize, parameter[member[.webconfig], member[.cfg]]] end[}] END[}]
annotation[@] identifier[Modified] Keyword[protected] Keyword[void] identifier[modified] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[cfg] operator[SEP] { identifier[WebContainerConfiguration] identifier[webconfig] operator[=] Keyword[new] identifier[WebContainerConfiguration] operator[SEP] identifier[DEFAULT_PORT] operator[SEP] operator[SEP] identifier[webconfig] operator[SEP] identifier[setDefaultVirtualHostName] operator[SEP] identifier[DEFAULT_VHOST_NAME] operator[SEP] operator[SEP] identifier[initialize] operator[SEP] identifier[webconfig] , identifier[cfg] operator[SEP] operator[SEP] }
public static final Function<Short,String> toPercentStr() { return (Function<Short,String>)((Function)FnNumber.toPercentStr()); }
class class_name[name] begin[{] method[toPercentStr, return_type[type[Function]], modifier[final public static], parameter[]] begin[{] return[Cast(expression=Cast(expression=MethodInvocation(arguments=[], member=toPercentStr, postfix_operators=[], prefix_operators=[], qualifier=FnNumber, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Function, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Short, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Function, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] identifier[Function] operator[<] identifier[Short] , identifier[String] operator[>] identifier[toPercentStr] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[Function] operator[<] identifier[Short] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Function] operator[SEP] identifier[FnNumber] operator[SEP] identifier[toPercentStr] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public byte[] to_bytes() { byte[] header_bytes = get_header_bytes(); byte[] annotations_bytes = get_annotations_bytes(); byte[] result = new byte[header_bytes.length + annotations_bytes.length + data.length]; System.arraycopy(header_bytes, 0, result, 0, header_bytes.length); System.arraycopy(annotations_bytes, 0, result, header_bytes.length, annotations_bytes.length); System.arraycopy(data, 0, result, header_bytes.length+annotations_bytes.length, data.length); return result; }
class class_name[name] begin[{] method[to_bytes, return_type[type[byte]], modifier[public], parameter[]] begin[{] local_variable[type[byte], header_bytes] local_variable[type[byte], annotations_bytes] local_variable[type[byte], result] call[System.arraycopy, parameter[member[.header_bytes], literal[0], member[.result], literal[0], member[header_bytes.length]]] call[System.arraycopy, parameter[member[.annotations_bytes], literal[0], member[.result], member[header_bytes.length], member[annotations_bytes.length]]] call[System.arraycopy, parameter[member[.data], literal[0], member[.result], binary_operation[member[header_bytes.length], +, member[annotations_bytes.length]], member[data.length]]] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[to_bytes] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[header_bytes] operator[=] identifier[get_header_bytes] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[annotations_bytes] operator[=] identifier[get_annotations_bytes] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[header_bytes] operator[SEP] identifier[length] operator[+] identifier[annotations_bytes] operator[SEP] identifier[length] operator[+] identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[header_bytes] , Other[0] , identifier[result] , Other[0] , identifier[header_bytes] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[annotations_bytes] , Other[0] , identifier[result] , identifier[header_bytes] operator[SEP] identifier[length] , identifier[annotations_bytes] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[data] , Other[0] , identifier[result] , identifier[header_bytes] operator[SEP] identifier[length] operator[+] identifier[annotations_bytes] operator[SEP] identifier[length] , identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
String unescapeEntities(boolean inAttribute) { StringBuilder builder = StringUtil.borrowBuilder(); while (!reader.isEmpty()) { builder.append(reader.consumeTo('&')); if (reader.matches('&')) { reader.consume(); int[] c = consumeCharacterReference(null, inAttribute); if (c == null || c.length==0) builder.append('&'); else { builder.appendCodePoint(c[0]); if (c.length == 2) builder.appendCodePoint(c[1]); } } } return StringUtil.releaseBuilder(builder); }
class class_name[name] begin[{] method[unescapeEntities, return_type[type[String]], modifier[default], parameter[inAttribute]] begin[{] local_variable[type[StringBuilder], builder] while[call[reader.isEmpty, parameter[]]] begin[{] call[builder.append, parameter[call[reader.consumeTo, parameter[literal['&']]]]] if[call[reader.matches, parameter[literal['&']]]] begin[{] call[reader.consume, parameter[]] local_variable[type[int], c] if[binary_operation[binary_operation[member[.c], ==, literal[null]], ||, binary_operation[member[c.length], ==, literal[0]]]] begin[{] call[builder.append, parameter[literal['&']]] else begin[{] call[builder.appendCodePoint, parameter[member[.c]]] if[binary_operation[member[c.length], ==, literal[2]]] begin[{] call[builder.appendCodePoint, parameter[member[.c]]] else begin[{] None end[}] end[}] else begin[{] None end[}] end[}] return[call[StringUtil.releaseBuilder, parameter[member[.builder]]]] end[}] END[}]
identifier[String] identifier[unescapeEntities] operator[SEP] Keyword[boolean] identifier[inAttribute] operator[SEP] { identifier[StringBuilder] identifier[builder] operator[=] identifier[StringUtil] operator[SEP] identifier[borrowBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[reader] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[reader] operator[SEP] identifier[consumeTo] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reader] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[reader] operator[SEP] identifier[consume] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[consumeCharacterReference] operator[SEP] Other[null] , identifier[inAttribute] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] Other[null] operator[||] identifier[c] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[else] { identifier[builder] operator[SEP] identifier[appendCodePoint] operator[SEP] identifier[c] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] identifier[builder] operator[SEP] identifier[appendCodePoint] operator[SEP] identifier[c] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] identifier[StringUtil] operator[SEP] identifier[releaseBuilder] operator[SEP] identifier[builder] operator[SEP] operator[SEP] }
public final SIBUuid8 getGuaranteedTargetMessagingEngineUUID() { byte[] b = (byte[]) getHdr2().getField(JsHdr2Access.GUARANTEED_SET_TARGETMEUUID); if (b != null) return new SIBUuid8(b); return null; }
class class_name[name] begin[{] method[getGuaranteedTargetMessagingEngineUUID, return_type[type[SIBUuid8]], modifier[final public], parameter[]] begin[{] local_variable[type[byte], b] if[binary_operation[member[.b], !=, literal[null]]] begin[{] return[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))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[final] identifier[SIBUuid8] identifier[getGuaranteedTargetMessagingEngineUUID] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[getHdr2] operator[SEP] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[JsHdr2Access] operator[SEP] identifier[GUARANTEED_SET_TARGETMEUUID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[!=] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[SIBUuid8] operator[SEP] identifier[b] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
public static String updateSetColumns(Class<?> entityClass, String entityName, boolean notNull, boolean notEmpty) { StringBuilder sql = new StringBuilder(); sql.append("<set>"); //获取全部列 Set<EntityColumn> columnSet = EntityHelper.getColumns(entityClass); //对乐观锁的支持 EntityColumn versionColumn = null; // 逻辑删除列 EntityColumn logicDeleteColumn = null; //当某个列有主键策略时,不需要考虑他的属性是否为空,因为如果为空,一定会根据主键策略给他生成一个值 for (EntityColumn column : columnSet) { if (column.getEntityField().isAnnotationPresent(Version.class)) { if (versionColumn != null) { throw new VersionException(entityClass.getCanonicalName() + " 中包含多个带有 @Version 注解的字段,一个类中只能存在一个带有 @Version 注解的字段!"); } versionColumn = column; } if (column.getEntityField().isAnnotationPresent(LogicDelete.class)) { if (logicDeleteColumn != null) { throw new LogicDeleteException(entityClass.getCanonicalName() + " 中包含多个带有 @LogicDelete 注解的字段,一个类中只能存在一个带有 @LogicDelete 注解的字段!"); } logicDeleteColumn = column; } if (!column.isId() && column.isUpdatable()) { if (column == versionColumn) { Version version = versionColumn.getEntityField().getAnnotation(Version.class); String versionClass = version.nextVersion().getCanonicalName(); sql.append("<bind name=\"").append(column.getProperty()).append("Version\" value=\""); //version = ${@tk.mybatis.mapper.version@nextVersionClass("versionClass", version)} sql.append("@tk.mybatis.mapper.version.VersionUtil@nextVersion(") .append("@").append(versionClass).append("@class, "); if (StringUtil.isNotEmpty(entityName)) { sql.append(entityName).append("."); } sql.append(column.getProperty()).append(")\"/>"); sql.append(column.getColumn()).append(" = #{").append(column.getProperty()).append("Version},"); } else if (column == logicDeleteColumn) { sql.append(logicDeleteColumnEqualsValue(column, false)).append(","); } else if (notNull) { sql.append(SqlHelper.getIfNotNull(entityName, column, column.getColumnEqualsHolder(entityName) + ",", notEmpty)); } else { sql.append(column.getColumnEqualsHolder(entityName) + ","); } } } sql.append("</set>"); return sql.toString(); }
class class_name[name] begin[{] method[updateSetColumns, return_type[type[String]], modifier[public static], parameter[entityClass, entityName, notNull, notEmpty]] begin[{] local_variable[type[StringBuilder], sql] call[sql.append, parameter[literal["<set>"]]] local_variable[type[Set], columnSet] local_variable[type[EntityColumn], versionColumn] local_variable[type[EntityColumn], logicDeleteColumn] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getEntityField, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Version, sub_type=None))], member=isAnnotationPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=versionColumn, 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=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=entityClass, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" 中包含多个带有 @Version 注解的字段,一个类中只能存在一个带有 @Version 注解的字段!"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VersionException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=versionColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=getEntityField, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LogicDelete, sub_type=None))], member=isAnnotationPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=logicDeleteColumn, 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=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=entityClass, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" 中包含多个带有 @LogicDelete 注解的字段,一个类中只能存在一个带有 @LogicDelete 注解的字段!"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LogicDeleteException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=logicDeleteColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isId, postfix_operators=[], prefix_operators=['!'], qualifier=column, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isUpdatable, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=versionColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=logicDeleteColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=MemberReference(member=notNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=entityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumnEqualsHolder, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=entityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=entityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumnEqualsHolder, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), MemberReference(member=notEmpty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIfNotNull, postfix_operators=[], prefix_operators=[], qualifier=SqlHelper, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=logicDeleteColumnEqualsValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[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)], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEntityField, postfix_operators=[], prefix_operators=[], qualifier=versionColumn, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Version, sub_type=None))], member=getAnnotation, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=version)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Version, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextVersion, postfix_operators=[], prefix_operators=[], qualifier=version, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=versionClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<bind name=\"")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None)], 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="Version\" value=\"")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="@tk.mybatis.mapper.version.VersionUtil@nextVersion(")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[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=versionClass, 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="@class, ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=entityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNotEmpty, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[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)], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[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)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getColumn, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[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=[MethodInvocation(arguments=[], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None)], 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="Version},")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=columnSet, 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=EntityColumn, sub_type=None))), label=None) call[sql.append, parameter[literal["</set>"]]] return[call[sql.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[updateSetColumns] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[entityClass] , identifier[String] identifier[entityName] , Keyword[boolean] identifier[notNull] , Keyword[boolean] identifier[notEmpty] operator[SEP] { identifier[StringBuilder] identifier[sql] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[EntityColumn] operator[>] identifier[columnSet] operator[=] identifier[EntityHelper] operator[SEP] identifier[getColumns] operator[SEP] identifier[entityClass] operator[SEP] operator[SEP] identifier[EntityColumn] identifier[versionColumn] operator[=] Other[null] operator[SEP] identifier[EntityColumn] identifier[logicDeleteColumn] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[EntityColumn] identifier[column] operator[:] identifier[columnSet] operator[SEP] { Keyword[if] operator[SEP] identifier[column] operator[SEP] identifier[getEntityField] operator[SEP] operator[SEP] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Version] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[versionColumn] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[VersionException] operator[SEP] identifier[entityClass] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[versionColumn] operator[=] identifier[column] operator[SEP] } Keyword[if] operator[SEP] identifier[column] operator[SEP] identifier[getEntityField] operator[SEP] operator[SEP] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[LogicDelete] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[logicDeleteColumn] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[LogicDeleteException] operator[SEP] identifier[entityClass] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[logicDeleteColumn] operator[=] identifier[column] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[column] operator[SEP] identifier[isId] operator[SEP] operator[SEP] operator[&&] identifier[column] operator[SEP] identifier[isUpdatable] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[column] operator[==] identifier[versionColumn] operator[SEP] { identifier[Version] identifier[version] operator[=] identifier[versionColumn] operator[SEP] identifier[getEntityField] operator[SEP] operator[SEP] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[Version] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[String] identifier[versionClass] operator[=] identifier[version] operator[SEP] identifier[nextVersion] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[column] operator[SEP] identifier[getProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sql] 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[versionClass] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtil] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[entityName] operator[SEP] operator[SEP] { identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[entityName] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[column] operator[SEP] identifier[getProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[column] operator[SEP] identifier[getColumn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[column] operator[SEP] identifier[getProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[column] operator[==] identifier[logicDeleteColumn] operator[SEP] { identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[logicDeleteColumnEqualsValue] operator[SEP] identifier[column] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[notNull] operator[SEP] { identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[SqlHelper] operator[SEP] identifier[getIfNotNull] operator[SEP] identifier[entityName] , identifier[column] , identifier[column] operator[SEP] identifier[getColumnEqualsHolder] operator[SEP] identifier[entityName] operator[SEP] operator[+] literal[String] , identifier[notEmpty] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[column] operator[SEP] identifier[getColumnEqualsHolder] operator[SEP] identifier[entityName] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } } } identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sql] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void setTimeUnit(com.google.api.ads.admanager.axis.v201808.TimeUnit timeUnit) { this.timeUnit = timeUnit; }
class class_name[name] begin[{] method[setTimeUnit, return_type[void], modifier[public], parameter[timeUnit]] begin[{] assign[THIS[member[None.timeUnit]], member[.timeUnit]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setTimeUnit] 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[v201808] operator[SEP] identifier[TimeUnit] identifier[timeUnit] operator[SEP] { Keyword[this] operator[SEP] identifier[timeUnit] operator[=] identifier[timeUnit] operator[SEP] }
public static <T> void logFailures(List<Either<T, ExecutionException>> results, Logger useLogger, int atMost) { Logger actualLogger = useLogger == null ? log : useLogger; Iterator<Either<T, ExecutionException>> it = results.iterator(); int printed = 0; while (it.hasNext()) { Either<T, ExecutionException> nextResult = it.next(); if (nextResult instanceof Either.Right) { ExecutionException exc = ((Either.Right<T, ExecutionException>) nextResult).getRight(); actualLogger.error("Iterator executor failure.", exc); printed++; if (printed >= atMost) { return; } } } }
class class_name[name] begin[{] method[logFailures, return_type[void], modifier[public static], parameter[results, useLogger, atMost]] begin[{] local_variable[type[Logger], actualLogger] local_variable[type[Iterator], it] local_variable[type[int], printed] while[call[it.hasNext, parameter[]]] begin[{] local_variable[type[Either], nextResult] if[binary_operation[member[.nextResult], instanceof, type[Either]]] begin[{] local_variable[type[ExecutionException], exc] call[actualLogger.error, parameter[literal["Iterator executor failure."], member[.exc]]] member[.printed] if[binary_operation[member[.printed], >=, member[.atMost]]] begin[{] return[None] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[void] identifier[logFailures] operator[SEP] identifier[List] operator[<] identifier[Either] operator[<] identifier[T] , identifier[ExecutionException] operator[>] operator[>] identifier[results] , identifier[Logger] identifier[useLogger] , Keyword[int] identifier[atMost] operator[SEP] { identifier[Logger] identifier[actualLogger] operator[=] identifier[useLogger] operator[==] Other[null] operator[?] identifier[log] operator[:] identifier[useLogger] operator[SEP] identifier[Iterator] operator[<] identifier[Either] operator[<] identifier[T] , identifier[ExecutionException] operator[>] operator[>] identifier[it] operator[=] identifier[results] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[printed] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Either] operator[<] identifier[T] , identifier[ExecutionException] operator[>] identifier[nextResult] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextResult] Keyword[instanceof] identifier[Either] operator[SEP] identifier[Right] operator[SEP] { identifier[ExecutionException] identifier[exc] operator[=] operator[SEP] operator[SEP] identifier[Either] operator[SEP] identifier[Right] operator[<] identifier[T] , identifier[ExecutionException] operator[>] operator[SEP] identifier[nextResult] operator[SEP] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] identifier[actualLogger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[exc] operator[SEP] operator[SEP] identifier[printed] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[printed] operator[>=] identifier[atMost] operator[SEP] { Keyword[return] operator[SEP] } } } }
public void marshall(DescribeUserStackAssociationsRequest describeUserStackAssociationsRequest, ProtocolMarshaller protocolMarshaller) { if (describeUserStackAssociationsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeUserStackAssociationsRequest.getStackName(), STACKNAME_BINDING); protocolMarshaller.marshall(describeUserStackAssociationsRequest.getUserName(), USERNAME_BINDING); protocolMarshaller.marshall(describeUserStackAssociationsRequest.getAuthenticationType(), AUTHENTICATIONTYPE_BINDING); protocolMarshaller.marshall(describeUserStackAssociationsRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(describeUserStackAssociationsRequest.getNextToken(), NEXTTOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[describeUserStackAssociationsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.describeUserStackAssociationsRequest], ==, 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=getStackName, postfix_operators=[], prefix_operators=[], qualifier=describeUserStackAssociationsRequest, selectors=[], type_arguments=None), MemberReference(member=STACKNAME_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=getUserName, postfix_operators=[], prefix_operators=[], qualifier=describeUserStackAssociationsRequest, selectors=[], type_arguments=None), MemberReference(member=USERNAME_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=getAuthenticationType, postfix_operators=[], prefix_operators=[], qualifier=describeUserStackAssociationsRequest, selectors=[], type_arguments=None), MemberReference(member=AUTHENTICATIONTYPE_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=getMaxResults, postfix_operators=[], prefix_operators=[], qualifier=describeUserStackAssociationsRequest, selectors=[], type_arguments=None), MemberReference(member=MAXRESULTS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNextToken, postfix_operators=[], prefix_operators=[], qualifier=describeUserStackAssociationsRequest, selectors=[], type_arguments=None), MemberReference(member=NEXTTOKEN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DescribeUserStackAssociationsRequest] identifier[describeUserStackAssociationsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[describeUserStackAssociationsRequest] 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[describeUserStackAssociationsRequest] operator[SEP] identifier[getStackName] operator[SEP] operator[SEP] , identifier[STACKNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeUserStackAssociationsRequest] operator[SEP] identifier[getUserName] operator[SEP] operator[SEP] , identifier[USERNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeUserStackAssociationsRequest] operator[SEP] identifier[getAuthenticationType] operator[SEP] operator[SEP] , identifier[AUTHENTICATIONTYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeUserStackAssociationsRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeUserStackAssociationsRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static String parseRemoteHostName(final Channel channel) { if (null == channel) { return StringUtils.EMPTY; } final InetSocketAddress remote = (InetSocketAddress) channel.remoteAddress(); if (remote != null) { return remote.getAddress().getHostName(); } return StringUtils.EMPTY; }
class class_name[name] begin[{] method[parseRemoteHostName, return_type[type[String]], modifier[public static], parameter[channel]] begin[{] if[binary_operation[literal[null], ==, member[.channel]]] begin[{] return[member[StringUtils.EMPTY]] else begin[{] None end[}] local_variable[type[InetSocketAddress], remote] if[binary_operation[member[.remote], !=, literal[null]]] begin[{] return[call[remote.getAddress, parameter[]]] else begin[{] None end[}] return[member[StringUtils.EMPTY]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[parseRemoteHostName] operator[SEP] Keyword[final] identifier[Channel] identifier[channel] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[channel] operator[SEP] { Keyword[return] identifier[StringUtils] operator[SEP] identifier[EMPTY] operator[SEP] } Keyword[final] identifier[InetSocketAddress] identifier[remote] operator[=] operator[SEP] identifier[InetSocketAddress] operator[SEP] identifier[channel] operator[SEP] identifier[remoteAddress] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[remote] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[remote] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[SEP] identifier[getHostName] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[StringUtils] operator[SEP] identifier[EMPTY] operator[SEP] }
private String getRole(final WMenuItem item) { if (!item.isSelectAllowed()) { return null; } MenuSelectContainer selectContainer = WebUtilities.getAncestorOfClass(MenuSelectContainer.class, item); if (selectContainer == null) { return CHECKBOX_ROLE; } return MenuSelectContainer.SelectionMode.MULTIPLE.equals(selectContainer.getSelectionMode()) ? CHECKBOX_ROLE : RADIO_ROLE; }
class class_name[name] begin[{] method[getRole, return_type[type[String]], modifier[private], parameter[item]] begin[{] if[call[item.isSelectAllowed, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[MenuSelectContainer], selectContainer] if[binary_operation[member[.selectContainer], ==, literal[null]]] begin[{] return[member[.CHECKBOX_ROLE]] else begin[{] None end[}] return[TernaryExpression(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSelectionMode, postfix_operators=[], prefix_operators=[], qualifier=selectContainer, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=MenuSelectContainer.SelectionMode.MULTIPLE, selectors=[], type_arguments=None), if_false=MemberReference(member=RADIO_ROLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=CHECKBOX_ROLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[private] identifier[String] identifier[getRole] operator[SEP] Keyword[final] identifier[WMenuItem] identifier[item] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[item] operator[SEP] identifier[isSelectAllowed] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[MenuSelectContainer] identifier[selectContainer] operator[=] identifier[WebUtilities] operator[SEP] identifier[getAncestorOfClass] operator[SEP] identifier[MenuSelectContainer] operator[SEP] Keyword[class] , identifier[item] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selectContainer] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[CHECKBOX_ROLE] operator[SEP] } Keyword[return] identifier[MenuSelectContainer] operator[SEP] identifier[SelectionMode] operator[SEP] identifier[MULTIPLE] operator[SEP] identifier[equals] operator[SEP] identifier[selectContainer] operator[SEP] identifier[getSelectionMode] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[CHECKBOX_ROLE] operator[:] identifier[RADIO_ROLE] operator[SEP] }
public static DeploymentEntry merge(DeploymentEntry deployment1, DeploymentEntry deployment2) { final Map<String, String> mergedProperties = new HashMap<>(deployment1.asMap()); mergedProperties.putAll(deployment2.asMap()); final DescriptorProperties properties = new DescriptorProperties(true); properties.putProperties(mergedProperties); return new DeploymentEntry(properties); }
class class_name[name] begin[{] method[merge, return_type[type[DeploymentEntry]], modifier[public static], parameter[deployment1, deployment2]] begin[{] local_variable[type[Map], mergedProperties] call[mergedProperties.putAll, parameter[call[deployment2.asMap, parameter[]]]] local_variable[type[DescriptorProperties], properties] call[properties.putProperties, parameter[member[.mergedProperties]]] return[ClassCreator(arguments=[MemberReference(member=properties, 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=DeploymentEntry, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[DeploymentEntry] identifier[merge] operator[SEP] identifier[DeploymentEntry] identifier[deployment1] , identifier[DeploymentEntry] identifier[deployment2] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[mergedProperties] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] identifier[deployment1] operator[SEP] identifier[asMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mergedProperties] operator[SEP] identifier[putAll] operator[SEP] identifier[deployment2] operator[SEP] identifier[asMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[DescriptorProperties] identifier[properties] operator[=] Keyword[new] identifier[DescriptorProperties] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[putProperties] operator[SEP] identifier[mergedProperties] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DeploymentEntry] operator[SEP] identifier[properties] operator[SEP] operator[SEP] }
public int findIndexByLayerId(int id) { final ChildDrawable[] layers = mLayerState.mChildren; final int N = mLayerState.mNum; for (int i = 0; i < N; i++) { final ChildDrawable childDrawable = layers[i]; if (childDrawable.mId == id) { return i; } } return -1; }
class class_name[name] begin[{] method[findIndexByLayerId, return_type[type[int]], modifier[public], parameter[id]] begin[{] local_variable[type[ChildDrawable], layers] local_variable[type[int], N] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=layers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=childDrawable)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ChildDrawable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mId, postfix_operators=[], prefix_operators=[], qualifier=childDrawable, selectors=[]), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[1]] end[}] END[}]
Keyword[public] Keyword[int] identifier[findIndexByLayerId] operator[SEP] Keyword[int] identifier[id] operator[SEP] { Keyword[final] identifier[ChildDrawable] operator[SEP] operator[SEP] identifier[layers] operator[=] identifier[mLayerState] operator[SEP] identifier[mChildren] operator[SEP] Keyword[final] Keyword[int] identifier[N] operator[=] identifier[mLayerState] operator[SEP] identifier[mNum] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[N] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] identifier[ChildDrawable] identifier[childDrawable] operator[=] identifier[layers] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[childDrawable] operator[SEP] identifier[mId] operator[==] identifier[id] operator[SEP] { Keyword[return] identifier[i] operator[SEP] } } Keyword[return] operator[-] Other[1] operator[SEP] }
private ByteArrayInputStream generateThumbImageStream(InputStream inputStream, ThumbImage thumbImage) throws IOException { //根据传入配置生成缩略图 if (thumbImage.isDefaultConfig()) { //在中间修改配置,这里不是一个很好的实践,如果有时间再进行优化 thumbImage.setDefaultSize(thumbImageConfig.getWidth(), thumbImageConfig.getHeight()); return generateThumbImageByDefault(inputStream); } else if (thumbImage.getPercent() != 0) { return generateThumbImageByPercent(inputStream, thumbImage); } else { return generateThumbImageBySize(inputStream, thumbImage); } }
class class_name[name] begin[{] method[generateThumbImageStream, return_type[type[ByteArrayInputStream]], modifier[private], parameter[inputStream, thumbImage]] begin[{] if[call[thumbImage.isDefaultConfig, parameter[]]] begin[{] call[thumbImage.setDefaultSize, parameter[call[thumbImageConfig.getWidth, parameter[]], call[thumbImageConfig.getHeight, parameter[]]]] return[call[.generateThumbImageByDefault, parameter[member[.inputStream]]]] else begin[{] if[binary_operation[call[thumbImage.getPercent, parameter[]], !=, literal[0]]] begin[{] return[call[.generateThumbImageByPercent, parameter[member[.inputStream], member[.thumbImage]]]] else begin[{] return[call[.generateThumbImageBySize, parameter[member[.inputStream], member[.thumbImage]]]] end[}] end[}] end[}] END[}]
Keyword[private] identifier[ByteArrayInputStream] identifier[generateThumbImageStream] operator[SEP] identifier[InputStream] identifier[inputStream] , identifier[ThumbImage] identifier[thumbImage] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[thumbImage] operator[SEP] identifier[isDefaultConfig] operator[SEP] operator[SEP] operator[SEP] { identifier[thumbImage] operator[SEP] identifier[setDefaultSize] operator[SEP] identifier[thumbImageConfig] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] , identifier[thumbImageConfig] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[generateThumbImageByDefault] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[thumbImage] operator[SEP] identifier[getPercent] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[return] identifier[generateThumbImageByPercent] operator[SEP] identifier[inputStream] , identifier[thumbImage] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[generateThumbImageBySize] operator[SEP] identifier[inputStream] , identifier[thumbImage] operator[SEP] operator[SEP] } }
public void setIdentity(String name, String email) { if (GitTaskUtils.isNullOrBlankString(name) || GitTaskUtils.isNullOrBlankString(email)) { throw new IllegalArgumentException("Both the username and password must be provided."); } identity = new PersonIdent(name, email); }
class class_name[name] begin[{] method[setIdentity, return_type[void], modifier[public], parameter[name, email]] begin[{] if[binary_operation[call[GitTaskUtils.isNullOrBlankString, parameter[member[.name]]], ||, call[GitTaskUtils.isNullOrBlankString, parameter[member[.email]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Both the username and password must be provided.")], 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[}] assign[member[.identity], ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=email, 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=PersonIdent, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setIdentity] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[email] operator[SEP] { Keyword[if] operator[SEP] identifier[GitTaskUtils] operator[SEP] identifier[isNullOrBlankString] operator[SEP] identifier[name] operator[SEP] operator[||] identifier[GitTaskUtils] operator[SEP] identifier[isNullOrBlankString] operator[SEP] identifier[email] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[identity] operator[=] Keyword[new] identifier[PersonIdent] operator[SEP] identifier[name] , identifier[email] operator[SEP] operator[SEP] }
public static HostAndPort fromString(String hostPort, int defaultPort) { if (hostPort == null) throw new NullPointerException("hostPort == null"); String host = hostPort; int endHostIndex = hostPort.length(); if (hostPort.startsWith("[")) { // Bracketed IPv6 endHostIndex = hostPort.lastIndexOf(']') + 1; host = hostPort.substring(1, endHostIndex == 0 ? 1 : endHostIndex - 1); if (!Endpoint.newBuilder().parseIp(host)) { // reuse our IPv6 validator throw new IllegalArgumentException(hostPort + " contains an invalid IPv6 literal"); } } else { int colonIndex = hostPort.indexOf(':'), nextColonIndex = hostPort.lastIndexOf(':'); if (colonIndex >= 0) { if (colonIndex == nextColonIndex) { // only 1 colon host = hostPort.substring(0, colonIndex); endHostIndex = colonIndex; } else if (!Endpoint.newBuilder().parseIp(hostPort)) { // reuse our IPv6 validator throw new IllegalArgumentException(hostPort + " is an invalid IPv6 literal"); } } } if (host.isEmpty()) throw new IllegalArgumentException(hostPort + " has an empty host"); if (endHostIndex + 1 < hostPort.length() && hostPort.charAt(endHostIndex) == ':') { return new HostAndPort(host, validatePort(hostPort.substring(endHostIndex + 1), hostPort)); } return new HostAndPort(host, defaultPort); }
class class_name[name] begin[{] method[fromString, return_type[type[HostAndPort]], modifier[public static], parameter[hostPort, defaultPort]] begin[{] if[binary_operation[member[.hostPort], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="hostPort == null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], host] local_variable[type[int], endHostIndex] if[call[hostPort.startsWith, parameter[literal["["]]]] begin[{] assign[member[.endHostIndex], binary_operation[call[hostPort.lastIndexOf, parameter[literal[']']]], +, literal[1]]] assign[member[.host], call[hostPort.substring, parameter[literal[1], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=endHostIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=BinaryOperation(operandl=MemberReference(member=endHostIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]]] if[call[Endpoint.newBuilder, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=hostPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" contains an invalid IPv6 literal"), 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[}] else begin[{] local_variable[type[int], colonIndex] if[binary_operation[member[.colonIndex], >=, literal[0]]] begin[{] if[binary_operation[member[.colonIndex], ==, member[.nextColonIndex]]] begin[{] assign[member[.host], call[hostPort.substring, parameter[literal[0], member[.colonIndex]]]] assign[member[.endHostIndex], member[.colonIndex]] else begin[{] if[call[Endpoint.newBuilder, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=hostPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is an invalid IPv6 literal"), 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[}] end[}] else begin[{] None end[}] end[}] if[call[host.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=hostPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has an empty host"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[member[.endHostIndex], +, literal[1]], <, call[hostPort.length, parameter[]]], &&, binary_operation[call[hostPort.charAt, parameter[member[.endHostIndex]]], ==, literal[':']]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=endHostIndex, 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=hostPort, selectors=[], type_arguments=None), MemberReference(member=hostPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validatePort, 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=HostAndPort, sub_type=None))] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=defaultPort, 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=HostAndPort, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[HostAndPort] identifier[fromString] operator[SEP] identifier[String] identifier[hostPort] , Keyword[int] identifier[defaultPort] operator[SEP] { Keyword[if] operator[SEP] identifier[hostPort] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[host] operator[=] identifier[hostPort] operator[SEP] Keyword[int] identifier[endHostIndex] operator[=] identifier[hostPort] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hostPort] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[endHostIndex] operator[=] identifier[hostPort] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] identifier[host] operator[=] identifier[hostPort] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[endHostIndex] operator[==] Other[0] operator[?] Other[1] operator[:] identifier[endHostIndex] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Endpoint] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[parseIp] operator[SEP] identifier[host] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[hostPort] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[int] identifier[colonIndex] operator[=] identifier[hostPort] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] , identifier[nextColonIndex] operator[=] identifier[hostPort] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[colonIndex] operator[>=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[colonIndex] operator[==] identifier[nextColonIndex] operator[SEP] { identifier[host] operator[=] identifier[hostPort] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[colonIndex] operator[SEP] operator[SEP] identifier[endHostIndex] operator[=] identifier[colonIndex] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[Endpoint] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[parseIp] operator[SEP] identifier[hostPort] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[hostPort] operator[+] literal[String] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[host] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[hostPort] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[endHostIndex] operator[+] Other[1] operator[<] identifier[hostPort] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[&&] identifier[hostPort] operator[SEP] identifier[charAt] operator[SEP] identifier[endHostIndex] operator[SEP] operator[==] literal[String] operator[SEP] { Keyword[return] Keyword[new] identifier[HostAndPort] operator[SEP] identifier[host] , identifier[validatePort] operator[SEP] identifier[hostPort] operator[SEP] identifier[substring] operator[SEP] identifier[endHostIndex] operator[+] Other[1] operator[SEP] , identifier[hostPort] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[HostAndPort] operator[SEP] identifier[host] , identifier[defaultPort] operator[SEP] operator[SEP] }
public void marshall(PutReportDefinitionRequest putReportDefinitionRequest, ProtocolMarshaller protocolMarshaller) { if (putReportDefinitionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(putReportDefinitionRequest.getReportDefinition(), REPORTDEFINITION_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[putReportDefinitionRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.putReportDefinitionRequest], ==, 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=getReportDefinition, postfix_operators=[], prefix_operators=[], qualifier=putReportDefinitionRequest, selectors=[], type_arguments=None), MemberReference(member=REPORTDEFINITION_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[PutReportDefinitionRequest] identifier[putReportDefinitionRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[putReportDefinitionRequest] 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[putReportDefinitionRequest] operator[SEP] identifier[getReportDefinition] operator[SEP] operator[SEP] , identifier[REPORTDEFINITION_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 LargeBlockTask getReleaseTask(BlockId blockId) { return new LargeBlockTask() { @Override public LargeBlockResponse call() throws Exception { Exception theException = null; try { LargeBlockManager.getInstance().releaseBlock(blockId); } catch (Exception exc) { theException = exc; } return new LargeBlockResponse(theException); } }; }
class class_name[name] begin[{] method[getReleaseTask, return_type[type[LargeBlockTask]], modifier[public static], parameter[blockId]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=theException)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Exception, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=LargeBlockManager, selectors=[MethodInvocation(arguments=[MemberReference(member=blockId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=releaseBlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=theException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exc, types=['Exception']))], finally_block=None, label=None, resources=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=theException, 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=LargeBlockResponse, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=LargeBlockResponse, sub_type=None), throws=['Exception'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LargeBlockTask, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[LargeBlockTask] identifier[getReleaseTask] operator[SEP] identifier[BlockId] identifier[blockId] operator[SEP] { Keyword[return] Keyword[new] identifier[LargeBlockTask] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[LargeBlockResponse] identifier[call] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Exception] identifier[theException] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[LargeBlockManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[releaseBlock] operator[SEP] identifier[blockId] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[exc] operator[SEP] { identifier[theException] operator[=] identifier[exc] operator[SEP] } Keyword[return] Keyword[new] identifier[LargeBlockResponse] operator[SEP] identifier[theException] operator[SEP] operator[SEP] } } operator[SEP] }
@TargetApi(Build.VERSION_CODES.FROYO) public static File getExternalCacheDir(Context context) { if (Version.hasFroyo()) { File path = context.getExternalCacheDir(); // In some case, even the sd card is mounted, getExternalCacheDir will return null, may be it is nearly full. if (path != null) { return path; } } // Before Froyo or the path is null, we need to construct the external cache folder ourselves final String cacheDir = "/Android/data/" + context.getPackageName() + "/cache/"; return new File(Environment.getExternalStorageDirectory().getPath() + cacheDir); }
class class_name[name] begin[{] method[getExternalCacheDir, return_type[type[File]], modifier[public static], parameter[context]] begin[{] if[call[Version.hasFroyo, parameter[]]] begin[{] local_variable[type[File], path] if[binary_operation[member[.path], !=, literal[null]]] begin[{] return[member[.path]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[String], cacheDir] return[ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getExternalStorageDirectory, postfix_operators=[], prefix_operators=[], qualifier=Environment, selectors=[MethodInvocation(arguments=[], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=cacheDir, 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=File, sub_type=None))] end[}] END[}]
annotation[@] identifier[TargetApi] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[FROYO] operator[SEP] Keyword[public] Keyword[static] identifier[File] identifier[getExternalCacheDir] operator[SEP] identifier[Context] identifier[context] operator[SEP] { Keyword[if] operator[SEP] identifier[Version] operator[SEP] identifier[hasFroyo] operator[SEP] operator[SEP] operator[SEP] { identifier[File] identifier[path] operator[=] identifier[context] operator[SEP] identifier[getExternalCacheDir] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[path] operator[SEP] } } Keyword[final] identifier[String] identifier[cacheDir] operator[=] literal[String] operator[+] identifier[context] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[return] Keyword[new] identifier[File] operator[SEP] identifier[Environment] operator[SEP] identifier[getExternalStorageDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[+] identifier[cacheDir] operator[SEP] operator[SEP] }
protected void registerSpinnerAttributes() { addAttributeProcessor(new SpinnerArrayLmlAttribute(), "items"); addAttributeProcessor(new SpinnerDisabledLmlAttribute(), "disabled", "inputDisabled"); addAttributeProcessor(new SpinnerNameLmlAttribute(), "selectorName", "text"); addAttributeProcessor(new SpinnerPrecisionLmlAttribute(), "precision", "scale"); addAttributeProcessor(new SpinnerProgrammaticChangeEventsLmlAttribute(), "programmaticChangeEvents"); addAttributeProcessor(new SpinnerSelectedLmlAttribute(), "selected"); addAttributeProcessor(new SpinnerTextFieldEventPolicyLmlAttribute(), "textFieldEventPolicy"); addAttributeProcessor(new SpinnerWrapLmlAttribute(), "wrap"); }
class class_name[name] begin[{] method[registerSpinnerAttributes, return_type[void], modifier[protected], parameter[]] begin[{] call[.addAttributeProcessor, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SpinnerArrayLmlAttribute, sub_type=None)), literal["items"]]] call[.addAttributeProcessor, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SpinnerDisabledLmlAttribute, sub_type=None)), literal["disabled"], literal["inputDisabled"]]] call[.addAttributeProcessor, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SpinnerNameLmlAttribute, sub_type=None)), literal["selectorName"], literal["text"]]] call[.addAttributeProcessor, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SpinnerPrecisionLmlAttribute, sub_type=None)), literal["precision"], literal["scale"]]] call[.addAttributeProcessor, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SpinnerProgrammaticChangeEventsLmlAttribute, sub_type=None)), literal["programmaticChangeEvents"]]] call[.addAttributeProcessor, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SpinnerSelectedLmlAttribute, sub_type=None)), literal["selected"]]] call[.addAttributeProcessor, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SpinnerTextFieldEventPolicyLmlAttribute, sub_type=None)), literal["textFieldEventPolicy"]]] call[.addAttributeProcessor, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SpinnerWrapLmlAttribute, sub_type=None)), literal["wrap"]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[registerSpinnerAttributes] operator[SEP] operator[SEP] { identifier[addAttributeProcessor] operator[SEP] Keyword[new] identifier[SpinnerArrayLmlAttribute] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[addAttributeProcessor] operator[SEP] Keyword[new] identifier[SpinnerDisabledLmlAttribute] operator[SEP] operator[SEP] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[addAttributeProcessor] operator[SEP] Keyword[new] identifier[SpinnerNameLmlAttribute] operator[SEP] operator[SEP] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[addAttributeProcessor] operator[SEP] Keyword[new] identifier[SpinnerPrecisionLmlAttribute] operator[SEP] operator[SEP] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[addAttributeProcessor] operator[SEP] Keyword[new] identifier[SpinnerProgrammaticChangeEventsLmlAttribute] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[addAttributeProcessor] operator[SEP] Keyword[new] identifier[SpinnerSelectedLmlAttribute] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[addAttributeProcessor] operator[SEP] Keyword[new] identifier[SpinnerTextFieldEventPolicyLmlAttribute] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[addAttributeProcessor] operator[SEP] Keyword[new] identifier[SpinnerWrapLmlAttribute] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] }
@ConfigArg(0) public void setPath(PathImpl path) { _classDir = path; if (_sourceDir == null) { _sourceDir = path; } }
class class_name[name] begin[{] method[setPath, return_type[void], modifier[public], parameter[path]] begin[{] assign[member[._classDir], member[.path]] if[binary_operation[member[._sourceDir], ==, literal[null]]] begin[{] assign[member[._sourceDir], member[.path]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[ConfigArg] operator[SEP] Other[0] operator[SEP] Keyword[public] Keyword[void] identifier[setPath] operator[SEP] identifier[PathImpl] identifier[path] operator[SEP] { identifier[_classDir] operator[=] identifier[path] operator[SEP] Keyword[if] operator[SEP] identifier[_sourceDir] operator[==] Other[null] operator[SEP] { identifier[_sourceDir] operator[=] identifier[path] operator[SEP] } }
public ExternalLocalTransaction createLocalTransaction() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createLocalTransaction"); ExternalLocalTransaction instance; if (_persistenceSupports1PCOptimisation) { instance = new MSDelegatingLocalTransactionSynchronization(_ms, _persistence, getMaximumTransactionSize()); } else { instance = new MSDelegatingLocalTransaction(_ms, _persistence, getMaximumTransactionSize()); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createLocalTransaction", "return="+instance); return instance; }
class class_name[name] begin[{] method[createLocalTransaction, return_type[type[ExternalLocalTransaction]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["createLocalTransaction"]]] else begin[{] None end[}] local_variable[type[ExternalLocalTransaction], instance] if[member[._persistenceSupports1PCOptimisation]] begin[{] assign[member[.instance], ClassCreator(arguments=[MemberReference(member=_ms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=_persistence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMaximumTransactionSize, 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=MSDelegatingLocalTransactionSynchronization, sub_type=None))] else begin[{] assign[member[.instance], ClassCreator(arguments=[MemberReference(member=_ms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=_persistence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMaximumTransactionSize, 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=MSDelegatingLocalTransaction, sub_type=None))] end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["createLocalTransaction"], binary_operation[literal["return="], +, member[.instance]]]] else begin[{] None end[}] return[member[.instance]] end[}] END[}]
Keyword[public] identifier[ExternalLocalTransaction] identifier[createLocalTransaction] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[ExternalLocalTransaction] identifier[instance] operator[SEP] Keyword[if] operator[SEP] identifier[_persistenceSupports1PCOptimisation] operator[SEP] { identifier[instance] operator[=] Keyword[new] identifier[MSDelegatingLocalTransactionSynchronization] operator[SEP] identifier[_ms] , identifier[_persistence] , identifier[getMaximumTransactionSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[instance] operator[=] Keyword[new] identifier[MSDelegatingLocalTransaction] operator[SEP] identifier[_ms] , identifier[_persistence] , identifier[getMaximumTransactionSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[+] identifier[instance] operator[SEP] operator[SEP] Keyword[return] identifier[instance] operator[SEP] }
public void stop() throws Throwable { shutdown.set(true); if (!isExternal && executorService != null) { executorService.shutdownNow(); executorService = null; } registeredPools.clear(); }
class class_name[name] begin[{] method[stop, return_type[void], modifier[public], parameter[]] begin[{] call[shutdown.set, parameter[literal[true]]] if[binary_operation[member[.isExternal], &&, binary_operation[member[.executorService], !=, literal[null]]]] begin[{] call[executorService.shutdownNow, parameter[]] assign[member[.executorService], literal[null]] else begin[{] None end[}] call[registeredPools.clear, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[stop] operator[SEP] operator[SEP] Keyword[throws] identifier[Throwable] { identifier[shutdown] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isExternal] operator[&&] identifier[executorService] operator[!=] Other[null] operator[SEP] { identifier[executorService] operator[SEP] identifier[shutdownNow] operator[SEP] operator[SEP] operator[SEP] identifier[executorService] operator[=] Other[null] operator[SEP] } identifier[registeredPools] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] }
@Override public String getTitle() { HtmlElement title = htmlElements().find("title"); return title != null ? title.getText() : null; }
class class_name[name] begin[{] method[getTitle, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[HtmlElement], title] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=title, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=title, selectors=[], type_arguments=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getTitle] operator[SEP] operator[SEP] { identifier[HtmlElement] identifier[title] operator[=] identifier[htmlElements] operator[SEP] operator[SEP] operator[SEP] identifier[find] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[title] operator[!=] Other[null] operator[?] identifier[title] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] }
public void setReplyToAddresses(java.util.Collection<String> replyToAddresses) { if (replyToAddresses == null) { this.replyToAddresses = null; return; } this.replyToAddresses = new java.util.ArrayList<String>(replyToAddresses); }
class class_name[name] begin[{] method[setReplyToAddresses, return_type[void], modifier[public], parameter[replyToAddresses]] begin[{] if[binary_operation[member[.replyToAddresses], ==, literal[null]]] begin[{] assign[THIS[member[None.replyToAddresses]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.replyToAddresses]], ClassCreator(arguments=[MemberReference(member=replyToAddresses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setReplyToAddresses] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[replyToAddresses] operator[SEP] { Keyword[if] operator[SEP] identifier[replyToAddresses] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[replyToAddresses] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[replyToAddresses] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[replyToAddresses] operator[SEP] operator[SEP] }
@Override public void addNewConnective() { String factType = getExpressionLeftSide().getPreviousGenericType(); if ( factType == null ) { factType = getExpressionLeftSide().getGenericType(); } String fieldName = getExpressionLeftSide().getFieldName(); String fieldType = getExpressionLeftSide().getGenericType(); if ( this.getConnectives() == null ) { this.setConnectives( new ConnectiveConstraint[]{ new ConnectiveConstraint( factType, fieldName, fieldType ) } ); } else { final ConnectiveConstraint[] newList = new ConnectiveConstraint[ this.getConnectives().length + 1 ]; for ( int i = 0; i < this.getConnectives().length; i++ ) { newList[ i ] = this.getConnectives()[ i ]; } newList[ this.getConnectives().length ] = new ConnectiveConstraint( factType, fieldName, fieldType ); this.setConnectives( newList ); } }
class class_name[name] begin[{] method[addNewConnective, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[String], factType] if[binary_operation[member[.factType], ==, literal[null]]] begin[{] assign[member[.factType], call[.getExpressionLeftSide, parameter[]]] else begin[{] None end[}] local_variable[type[String], fieldName] local_variable[type[String], fieldType] if[binary_operation[THIS[call[None.getConnectives, parameter[]]], ==, literal[null]]] begin[{] THIS[call[None.setConnectives, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassCreator(arguments=[MemberReference(member=factType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fieldType, 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=ConnectiveConstraint, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConnectiveConstraint, sub_type=None))]]] else begin[{] local_variable[type[ConnectiveConstraint], newList] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getConnectives, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getConnectives, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.newList], ClassCreator(arguments=[MemberReference(member=factType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fieldType, 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=ConnectiveConstraint, sub_type=None))] THIS[call[None.setConnectives, parameter[member[.newList]]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addNewConnective] operator[SEP] operator[SEP] { identifier[String] identifier[factType] operator[=] identifier[getExpressionLeftSide] operator[SEP] operator[SEP] operator[SEP] identifier[getPreviousGenericType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[factType] operator[==] Other[null] operator[SEP] { identifier[factType] operator[=] identifier[getExpressionLeftSide] operator[SEP] operator[SEP] operator[SEP] identifier[getGenericType] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[fieldName] operator[=] identifier[getExpressionLeftSide] operator[SEP] operator[SEP] operator[SEP] identifier[getFieldName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[fieldType] operator[=] identifier[getExpressionLeftSide] operator[SEP] operator[SEP] operator[SEP] identifier[getGenericType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getConnectives] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[setConnectives] operator[SEP] Keyword[new] identifier[ConnectiveConstraint] operator[SEP] operator[SEP] { Keyword[new] identifier[ConnectiveConstraint] operator[SEP] identifier[factType] , identifier[fieldName] , identifier[fieldType] operator[SEP] } operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] identifier[ConnectiveConstraint] operator[SEP] operator[SEP] identifier[newList] operator[=] Keyword[new] identifier[ConnectiveConstraint] operator[SEP] Keyword[this] operator[SEP] identifier[getConnectives] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[getConnectives] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[newList] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[this] operator[SEP] identifier[getConnectives] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] } identifier[newList] operator[SEP] Keyword[this] operator[SEP] identifier[getConnectives] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[=] Keyword[new] identifier[ConnectiveConstraint] operator[SEP] identifier[factType] , identifier[fieldName] , identifier[fieldType] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setConnectives] operator[SEP] identifier[newList] operator[SEP] operator[SEP] } }
public static java.util.Date rollDateTime(java.util.Date startDate, int period, int amount) { GregorianCalendar gc = new GregorianCalendar(); gc.setTime(startDate); gc.add(period, amount); return new java.util.Date(gc.getTime().getTime()); }
class class_name[name] begin[{] method[rollDateTime, return_type[type[java]], modifier[public static], parameter[startDate, period, amount]] begin[{] local_variable[type[GregorianCalendar], gc] call[gc.setTime, parameter[member[.startDate]]] call[gc.add, parameter[member[.period], member[.amount]]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=gc, selectors=[MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[static] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Date] identifier[rollDateTime] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Date] identifier[startDate] , Keyword[int] identifier[period] , Keyword[int] identifier[amount] operator[SEP] { identifier[GregorianCalendar] identifier[gc] operator[=] Keyword[new] identifier[GregorianCalendar] operator[SEP] operator[SEP] operator[SEP] identifier[gc] operator[SEP] identifier[setTime] operator[SEP] identifier[startDate] operator[SEP] operator[SEP] identifier[gc] operator[SEP] identifier[add] operator[SEP] identifier[period] , identifier[amount] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Date] operator[SEP] identifier[gc] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void onNext(final JobSubmissionEvent jobSubmissionEvent) { LOG.log(Level.FINEST, "Submitting job: {0}", jobSubmissionEvent); try { this.applicationId = createApplicationId(jobSubmissionEvent); final String folderName = this.azureBatchFileNames.getStorageJobFolder(this.applicationId); LOG.log(Level.FINE, "Creating a job folder on Azure at: {0}.", folderName); final URI jobFolderURL = this.azureStorageClient.getJobSubmissionFolderUri(folderName); LOG.log(Level.FINE, "Getting a shared access signature for {0}.", folderName); final String storageContainerSAS = this.azureStorageClient.createContainerSharedAccessSignature(); LOG.log(Level.FINE, "Assembling Configuration for the Driver."); final Configuration driverConfiguration = makeDriverConfiguration(jobSubmissionEvent, this.applicationId, jobFolderURL); LOG.log(Level.FINE, "Making Job JAR."); final File jobSubmissionJarFile = this.jobJarMaker.createJobSubmissionJAR(jobSubmissionEvent, driverConfiguration); LOG.log(Level.FINE, "Uploading Job JAR to Azure."); final URI jobJarSasUri = this.azureStorageClient.uploadFile(folderName, jobSubmissionJarFile); LOG.log(Level.FINE, "Assembling application submission."); final String command = this.launchCommandBuilder.buildDriverCommand(jobSubmissionEvent); this.azureBatchHelper.submitJob(getApplicationId(), storageContainerSAS, jobJarSasUri, command); } catch (final IOException e) { LOG.log(Level.SEVERE, "Error submitting Azure Batch request: {0}", e); throw new RuntimeException(e); } }
class class_name[name] begin[{] method[onNext, return_type[void], modifier[public], parameter[jobSubmissionEvent]] begin[{] call[LOG.log, parameter[member[Level.FINEST], literal["Submitting job: {0}"], member[.jobSubmissionEvent]]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=applicationId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[MemberReference(member=jobSubmissionEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createApplicationId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=azureBatchFileNames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=applicationId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=getStorageJobFolder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=folderName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Creating a job folder on Azure at: {0}."), MemberReference(member=folderName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=azureStorageClient, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=folderName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJobSubmissionFolderUri, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=jobFolderURL)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Getting a shared access signature for {0}."), MemberReference(member=folderName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=azureStorageClient, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=createContainerSharedAccessSignature, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=storageContainerSAS)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Assembling Configuration for the Driver.")], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=jobSubmissionEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=applicationId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=jobFolderURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=makeDriverConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=driverConfiguration)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Configuration, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Making Job JAR.")], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=jobJarMaker, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=jobSubmissionEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=driverConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createJobSubmissionJAR, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=jobSubmissionJarFile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Uploading Job JAR to Azure.")], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=azureStorageClient, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=folderName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jobSubmissionJarFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=uploadFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=jobJarSasUri)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Assembling application submission.")], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=launchCommandBuilder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=jobSubmissionEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildDriverCommand, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=command)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=azureBatchHelper, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getApplicationId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=storageContainerSAS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jobJarSasUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=submitJob, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error submitting Azure Batch request: {0}"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), 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=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onNext] operator[SEP] Keyword[final] identifier[JobSubmissionEvent] identifier[jobSubmissionEvent] operator[SEP] { identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] , identifier[jobSubmissionEvent] operator[SEP] operator[SEP] Keyword[try] { Keyword[this] operator[SEP] identifier[applicationId] operator[=] identifier[createApplicationId] operator[SEP] identifier[jobSubmissionEvent] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[folderName] operator[=] Keyword[this] operator[SEP] identifier[azureBatchFileNames] operator[SEP] identifier[getStorageJobFolder] operator[SEP] Keyword[this] operator[SEP] identifier[applicationId] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[folderName] operator[SEP] operator[SEP] Keyword[final] identifier[URI] identifier[jobFolderURL] operator[=] Keyword[this] operator[SEP] identifier[azureStorageClient] operator[SEP] identifier[getJobSubmissionFolderUri] operator[SEP] identifier[folderName] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[folderName] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[storageContainerSAS] operator[=] Keyword[this] operator[SEP] identifier[azureStorageClient] operator[SEP] identifier[createContainerSharedAccessSignature] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Configuration] identifier[driverConfiguration] operator[=] identifier[makeDriverConfiguration] operator[SEP] identifier[jobSubmissionEvent] , Keyword[this] operator[SEP] identifier[applicationId] , identifier[jobFolderURL] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[jobSubmissionJarFile] operator[=] Keyword[this] operator[SEP] identifier[jobJarMaker] operator[SEP] identifier[createJobSubmissionJAR] operator[SEP] identifier[jobSubmissionEvent] , identifier[driverConfiguration] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[URI] identifier[jobJarSasUri] operator[=] Keyword[this] operator[SEP] identifier[azureStorageClient] operator[SEP] identifier[uploadFile] operator[SEP] identifier[folderName] , identifier[jobSubmissionJarFile] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[command] operator[=] Keyword[this] operator[SEP] identifier[launchCommandBuilder] operator[SEP] identifier[buildDriverCommand] operator[SEP] identifier[jobSubmissionEvent] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[azureBatchHelper] operator[SEP] identifier[submitJob] operator[SEP] identifier[getApplicationId] operator[SEP] operator[SEP] , identifier[storageContainerSAS] , identifier[jobJarSasUri] , identifier[command] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
private void doGetExtensionInfo() throws PageException { Resource ed = config.getExtensionDirectory(); Struct sct = new StructImpl(); sct.set(KeyConstants._directory, ed.getPath()); sct.set(KeyConstants._enabled, Caster.toBoolean(config.isExtensionEnabled())); pageContext.setVariable(getString("admin", action, "returnVariable"), sct); }
class class_name[name] begin[{] method[doGetExtensionInfo, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[Resource], ed] local_variable[type[Struct], sct] call[sct.set, parameter[member[KeyConstants._directory], call[ed.getPath, parameter[]]]] call[sct.set, parameter[member[KeyConstants._enabled], call[Caster.toBoolean, parameter[call[config.isExtensionEnabled, parameter[]]]]]] call[pageContext.setVariable, parameter[call[.getString, parameter[literal["admin"], member[.action], literal["returnVariable"]]], member[.sct]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[doGetExtensionInfo] operator[SEP] operator[SEP] Keyword[throws] identifier[PageException] { identifier[Resource] identifier[ed] operator[=] identifier[config] operator[SEP] identifier[getExtensionDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[Struct] identifier[sct] operator[=] Keyword[new] identifier[StructImpl] operator[SEP] operator[SEP] operator[SEP] identifier[sct] operator[SEP] identifier[set] operator[SEP] identifier[KeyConstants] operator[SEP] identifier[_directory] , identifier[ed] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sct] operator[SEP] identifier[set] operator[SEP] identifier[KeyConstants] operator[SEP] identifier[_enabled] , identifier[Caster] operator[SEP] identifier[toBoolean] operator[SEP] identifier[config] operator[SEP] identifier[isExtensionEnabled] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pageContext] operator[SEP] identifier[setVariable] operator[SEP] identifier[getString] operator[SEP] literal[String] , identifier[action] , literal[String] operator[SEP] , identifier[sct] operator[SEP] operator[SEP] }
protected void configureEndpointInfoProperties(EndpointInfo libertyEndpointInfo, org.apache.cxf.service.model.EndpointInfo cxfEndpointInfo) { //Disable jaxb validation event handler, as IBM FastPath does not support this, which will finally fallback to RI unmarshall cxfEndpointInfo.setProperty(SET_JAXB_VALIDATION_EVENT_HANDLER, false); // //Set autoRewriteSoapAddressForAllServices with true by default, which will override all the services in the target WSDL file // cxfEndpointInfo.setProperty(WSDLGetUtils.AUTO_REWRITE_ADDRESS_ALL, true); //Set WSDL_DESCRIPTION property // try { // String wsdlLocation = libertyEndpointInfo.getWsdlLocation(); // if (wsdlLocation != null && !(wsdlLocation.isEmpty())) { // URI wsdlDescription = new URI(wsdlLocation); // cxfEndpointInfo.setProperty("URI", wsdlDescription); // } // } catch (URISyntaxException e) { // //donothing // } Map<String, String> endpointProperties = libertyEndpointInfo.getEndpointProperties(); if (endpointProperties != null && !endpointProperties.isEmpty()) { for (Entry<String, String> entry : endpointProperties.entrySet()) { cxfEndpointInfo.setProperty(entry.getKey(), entry.getValue()); } } }
class class_name[name] begin[{] method[configureEndpointInfoProperties, return_type[void], modifier[protected], parameter[libertyEndpointInfo, cxfEndpointInfo]] begin[{] call[cxfEndpointInfo.setProperty, parameter[member[.SET_JAXB_VALIDATION_EVENT_HANDLER], literal[false]]] local_variable[type[Map], endpointProperties] if[binary_operation[binary_operation[member[.endpointProperties], !=, literal[null]], &&, call[endpointProperties.isEmpty, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=cxfEndpointInfo, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=endpointProperties, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[configureEndpointInfoProperties] operator[SEP] identifier[EndpointInfo] identifier[libertyEndpointInfo] , identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[cxf] operator[SEP] identifier[service] operator[SEP] identifier[model] operator[SEP] identifier[EndpointInfo] identifier[cxfEndpointInfo] operator[SEP] { identifier[cxfEndpointInfo] operator[SEP] identifier[setProperty] operator[SEP] identifier[SET_JAXB_VALIDATION_EVENT_HANDLER] , literal[boolean] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[endpointProperties] operator[=] identifier[libertyEndpointInfo] operator[SEP] identifier[getEndpointProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[endpointProperties] operator[!=] Other[null] operator[&&] operator[!] identifier[endpointProperties] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[endpointProperties] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[cxfEndpointInfo] operator[SEP] identifier[setProperty] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
public long rescale(long origValue, Rational origBase, Rational.Rounding rounding) { return VideoJNI.Rational_rescale__SWIG_1(swigCPtr, this, origValue, Rational.getCPtr(origBase), origBase, rounding.swigValue()); }
class class_name[name] begin[{] method[rescale, return_type[type[long]], modifier[public], parameter[origValue, origBase, rounding]] begin[{] return[call[VideoJNI.Rational_rescale__SWIG_1, parameter[member[.swigCPtr], THIS[], member[.origValue], call[Rational.getCPtr, parameter[member[.origBase]]], member[.origBase], call[rounding.swigValue, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[long] identifier[rescale] operator[SEP] Keyword[long] identifier[origValue] , identifier[Rational] identifier[origBase] , identifier[Rational] operator[SEP] identifier[Rounding] identifier[rounding] operator[SEP] { Keyword[return] identifier[VideoJNI] operator[SEP] identifier[Rational_rescale__SWIG_1] operator[SEP] identifier[swigCPtr] , Keyword[this] , identifier[origValue] , identifier[Rational] operator[SEP] identifier[getCPtr] operator[SEP] identifier[origBase] operator[SEP] , identifier[origBase] , identifier[rounding] operator[SEP] identifier[swigValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public Map<String, Collection<String>> profileToRecordTypes() { Map<String, Collection<String>> profileToRecordTypes = new LinkedHashMap<String, Collection<String>>(); profileToRecordTypes.put("roundRobin", basicRecordTypes()); return profileToRecordTypes; }
class class_name[name] begin[{] method[profileToRecordTypes, return_type[type[Map]], modifier[public], parameter[]] begin[{] local_variable[type[Map], profileToRecordTypes] call[profileToRecordTypes.put, parameter[literal["roundRobin"], call[.basicRecordTypes, parameter[]]]] return[member[.profileToRecordTypes]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Collection] operator[<] identifier[String] operator[>] operator[>] identifier[profileToRecordTypes] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Collection] operator[<] identifier[String] operator[>] operator[>] identifier[profileToRecordTypes] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[Collection] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[profileToRecordTypes] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[basicRecordTypes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[profileToRecordTypes] operator[SEP] }
public int getIndex(Object item) { if (!itemIndex.containsKey(item)) { throw new NoSuchElementException("No such item: " + item); } return itemIndex.get(item); }
class class_name[name] begin[{] method[getIndex, return_type[type[int]], modifier[public], parameter[item]] begin[{] if[call[itemIndex.containsKey, parameter[member[.item]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No such item: "), operandr=MemberReference(member=item, 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=NoSuchElementException, sub_type=None)), label=None) else begin[{] None end[}] return[call[itemIndex.get, parameter[member[.item]]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getIndex] operator[SEP] identifier[Object] identifier[item] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[itemIndex] operator[SEP] identifier[containsKey] operator[SEP] identifier[item] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[NoSuchElementException] operator[SEP] literal[String] operator[+] identifier[item] operator[SEP] operator[SEP] } Keyword[return] identifier[itemIndex] operator[SEP] identifier[get] operator[SEP] identifier[item] operator[SEP] operator[SEP] }
public void suspendDelivery(int arg0) throws IllegalArgumentException, IllegalStateException, TransactionRequiredLocalException, SLEEException { suspensionHandlerLazyInit(); suspensionHandler.suspendDelivery(arg0); }
class class_name[name] begin[{] method[suspendDelivery, return_type[void], modifier[public], parameter[arg0]] begin[{] call[.suspensionHandlerLazyInit, parameter[]] call[suspensionHandler.suspendDelivery, parameter[member[.arg0]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[suspendDelivery] operator[SEP] Keyword[int] identifier[arg0] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] , identifier[IllegalStateException] , identifier[TransactionRequiredLocalException] , identifier[SLEEException] { identifier[suspensionHandlerLazyInit] operator[SEP] operator[SEP] operator[SEP] identifier[suspensionHandler] operator[SEP] identifier[suspendDelivery] operator[SEP] identifier[arg0] operator[SEP] operator[SEP] }
public void add(JobScheduleAddParameter cloudJobSchedule, JobScheduleAddOptions jobScheduleAddOptions) { addWithServiceResponseAsync(cloudJobSchedule, jobScheduleAddOptions).toBlocking().single().body(); }
class class_name[name] begin[{] method[add, return_type[void], modifier[public], parameter[cloudJobSchedule, jobScheduleAddOptions]] begin[{] call[.addWithServiceResponseAsync, parameter[member[.cloudJobSchedule], member[.jobScheduleAddOptions]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[JobScheduleAddParameter] identifier[cloudJobSchedule] , identifier[JobScheduleAddOptions] identifier[jobScheduleAddOptions] operator[SEP] { identifier[addWithServiceResponseAsync] operator[SEP] identifier[cloudJobSchedule] , identifier[jobScheduleAddOptions] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
private LoadBalancingPolicy getPolicyInstance(BalancingPolicy policy, Properties conProperties) { LoadBalancingPolicy loadBalancingPolicy = null; String isTokenAware = (String) conProperties.get("isTokenAware"); String isLatencyAware = (String) conProperties.get("isLatencyAware"); String whiteList = (String) conProperties.get("whiteList"); String hostFilterPolicy = (String) conProperties.get("hostFilterPolicy"); // Policy.v switch (policy) { case DCAwareRoundRobinPolicy: String usedHostsPerRemoteDc = (String) conProperties.get("usedHostsPerRemoteDc"); String localdc = (String) conProperties.get("localdc"); String allowRemoteDCsForLocalConsistencyLevel = (String) conProperties .get("allowRemoteDCsForLocalConsistencyLevel"); DCAwareRoundRobinPolicy.Builder policyBuilder = DCAwareRoundRobinPolicy.builder(); policyBuilder.withLocalDc(localdc == null ? "DC1" : localdc); policyBuilder.withUsedHostsPerRemoteDc(usedHostsPerRemoteDc != null ? Integer .parseInt(usedHostsPerRemoteDc) : 0); if (allowRemoteDCsForLocalConsistencyLevel != null && "true".equalsIgnoreCase(allowRemoteDCsForLocalConsistencyLevel)) { policyBuilder.allowRemoteDCsForLocalConsistencyLevel(); } loadBalancingPolicy = policyBuilder.build(); break; // case RoundRobinPolicy: // loadBalancingPolicy = new RoundRobinPolicy(); // break; default: // default is RoundRobinPolicy loadBalancingPolicy = new RoundRobinPolicy(); break; } if (loadBalancingPolicy != null && Boolean.valueOf(isTokenAware)) { loadBalancingPolicy = new TokenAwarePolicy(loadBalancingPolicy); } else if (loadBalancingPolicy != null && Boolean.valueOf(isLatencyAware)) { loadBalancingPolicy = LatencyAwarePolicy.builder(loadBalancingPolicy).build(); } if (loadBalancingPolicy != null && whiteList != null) { Collection<InetSocketAddress> whiteListCollection = buildWhiteListCollection(whiteList); loadBalancingPolicy = new WhiteListPolicy(loadBalancingPolicy, whiteListCollection); } if (loadBalancingPolicy != null && hostFilterPolicy != null) { Predicate<com.datastax.driver.core.Host> predicate = getHostFilterPredicate(hostFilterPolicy); loadBalancingPolicy = new HostFilterPolicy(loadBalancingPolicy, predicate); } return loadBalancingPolicy; }
class class_name[name] begin[{] method[getPolicyInstance, return_type[type[LoadBalancingPolicy]], modifier[private], parameter[policy, conProperties]] begin[{] local_variable[type[LoadBalancingPolicy], loadBalancingPolicy] local_variable[type[String], isTokenAware] local_variable[type[String], isLatencyAware] local_variable[type[String], whiteList] local_variable[type[String], hostFilterPolicy] SwitchStatement(cases=[SwitchStatementCase(case=['DCAwareRoundRobinPolicy'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="usedHostsPerRemoteDc")], member=get, postfix_operators=[], prefix_operators=[], qualifier=conProperties, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=usedHostsPerRemoteDc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="localdc")], member=get, postfix_operators=[], prefix_operators=[], qualifier=conProperties, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=localdc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="allowRemoteDCsForLocalConsistencyLevel")], member=get, postfix_operators=[], prefix_operators=[], qualifier=conProperties, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=allowRemoteDCsForLocalConsistencyLevel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=builder, postfix_operators=[], prefix_operators=[], qualifier=DCAwareRoundRobinPolicy, selectors=[], type_arguments=None), name=policyBuilder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DCAwareRoundRobinPolicy, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None))), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=localdc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=localdc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DC1"))], member=withLocalDc, postfix_operators=[], prefix_operators=[], qualifier=policyBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=usedHostsPerRemoteDc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=MethodInvocation(arguments=[MemberReference(member=usedHostsPerRemoteDc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None))], member=withUsedHostsPerRemoteDc, postfix_operators=[], prefix_operators=[], qualifier=policyBuilder, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=allowRemoteDCsForLocalConsistencyLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=allowRemoteDCsForLocalConsistencyLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="true"), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=allowRemoteDCsForLocalConsistencyLevel, postfix_operators=[], prefix_operators=[], qualifier=policyBuilder, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=loadBalancingPolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=policyBuilder, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=loadBalancingPolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RoundRobinPolicy, sub_type=None))), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=policy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) if[binary_operation[binary_operation[member[.loadBalancingPolicy], !=, literal[null]], &&, call[Boolean.valueOf, parameter[member[.isTokenAware]]]]] begin[{] assign[member[.loadBalancingPolicy], ClassCreator(arguments=[MemberReference(member=loadBalancingPolicy, 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=TokenAwarePolicy, sub_type=None))] else begin[{] if[binary_operation[binary_operation[member[.loadBalancingPolicy], !=, literal[null]], &&, call[Boolean.valueOf, parameter[member[.isLatencyAware]]]]] begin[{] assign[member[.loadBalancingPolicy], call[LatencyAwarePolicy.builder, parameter[member[.loadBalancingPolicy]]]] else begin[{] None end[}] end[}] if[binary_operation[binary_operation[member[.loadBalancingPolicy], !=, literal[null]], &&, binary_operation[member[.whiteList], !=, literal[null]]]] begin[{] local_variable[type[Collection], whiteListCollection] assign[member[.loadBalancingPolicy], ClassCreator(arguments=[MemberReference(member=loadBalancingPolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=whiteListCollection, 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=WhiteListPolicy, sub_type=None))] else begin[{] None end[}] if[binary_operation[binary_operation[member[.loadBalancingPolicy], !=, literal[null]], &&, binary_operation[member[.hostFilterPolicy], !=, literal[null]]]] begin[{] local_variable[type[Predicate], predicate] assign[member[.loadBalancingPolicy], ClassCreator(arguments=[MemberReference(member=loadBalancingPolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=predicate, 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=HostFilterPolicy, sub_type=None))] else begin[{] None end[}] return[member[.loadBalancingPolicy]] end[}] END[}]
Keyword[private] identifier[LoadBalancingPolicy] identifier[getPolicyInstance] operator[SEP] identifier[BalancingPolicy] identifier[policy] , identifier[Properties] identifier[conProperties] operator[SEP] { identifier[LoadBalancingPolicy] identifier[loadBalancingPolicy] operator[=] Other[null] operator[SEP] identifier[String] identifier[isTokenAware] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[conProperties] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[isLatencyAware] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[conProperties] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[whiteList] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[conProperties] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[hostFilterPolicy] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[conProperties] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[policy] operator[SEP] { Keyword[case] identifier[DCAwareRoundRobinPolicy] operator[:] identifier[String] identifier[usedHostsPerRemoteDc] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[conProperties] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[localdc] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[conProperties] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[allowRemoteDCsForLocalConsistencyLevel] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[conProperties] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[DCAwareRoundRobinPolicy] operator[SEP] identifier[Builder] identifier[policyBuilder] operator[=] identifier[DCAwareRoundRobinPolicy] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[policyBuilder] operator[SEP] identifier[withLocalDc] operator[SEP] identifier[localdc] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[localdc] operator[SEP] operator[SEP] identifier[policyBuilder] operator[SEP] identifier[withUsedHostsPerRemoteDc] operator[SEP] identifier[usedHostsPerRemoteDc] operator[!=] Other[null] operator[?] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[usedHostsPerRemoteDc] operator[SEP] operator[:] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[allowRemoteDCsForLocalConsistencyLevel] operator[!=] Other[null] operator[&&] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[allowRemoteDCsForLocalConsistencyLevel] operator[SEP] operator[SEP] { identifier[policyBuilder] operator[SEP] identifier[allowRemoteDCsForLocalConsistencyLevel] operator[SEP] operator[SEP] operator[SEP] } identifier[loadBalancingPolicy] operator[=] identifier[policyBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[loadBalancingPolicy] operator[=] Keyword[new] identifier[RoundRobinPolicy] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[if] operator[SEP] identifier[loadBalancingPolicy] operator[!=] Other[null] operator[&&] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[isTokenAware] operator[SEP] operator[SEP] { identifier[loadBalancingPolicy] operator[=] Keyword[new] identifier[TokenAwarePolicy] operator[SEP] identifier[loadBalancingPolicy] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[loadBalancingPolicy] operator[!=] Other[null] operator[&&] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[isLatencyAware] operator[SEP] operator[SEP] { identifier[loadBalancingPolicy] operator[=] identifier[LatencyAwarePolicy] operator[SEP] identifier[builder] operator[SEP] identifier[loadBalancingPolicy] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[loadBalancingPolicy] operator[!=] Other[null] operator[&&] identifier[whiteList] operator[!=] Other[null] operator[SEP] { identifier[Collection] operator[<] identifier[InetSocketAddress] operator[>] identifier[whiteListCollection] operator[=] identifier[buildWhiteListCollection] operator[SEP] identifier[whiteList] operator[SEP] operator[SEP] identifier[loadBalancingPolicy] operator[=] Keyword[new] identifier[WhiteListPolicy] operator[SEP] identifier[loadBalancingPolicy] , identifier[whiteListCollection] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[loadBalancingPolicy] operator[!=] Other[null] operator[&&] identifier[hostFilterPolicy] operator[!=] Other[null] operator[SEP] { identifier[Predicate] operator[<] identifier[com] operator[SEP] identifier[datastax] operator[SEP] identifier[driver] operator[SEP] identifier[core] operator[SEP] identifier[Host] operator[>] identifier[predicate] operator[=] identifier[getHostFilterPredicate] operator[SEP] identifier[hostFilterPolicy] operator[SEP] operator[SEP] identifier[loadBalancingPolicy] operator[=] Keyword[new] identifier[HostFilterPolicy] operator[SEP] identifier[loadBalancingPolicy] , identifier[predicate] operator[SEP] operator[SEP] } Keyword[return] identifier[loadBalancingPolicy] operator[SEP] }
@Override public GetFolderResult getFolder(GetFolderRequest request) { request = beforeClientExecution(request); return executeGetFolder(request); }
class class_name[name] begin[{] method[getFolder, return_type[type[GetFolderResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetFolder, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetFolderResult] identifier[getFolder] operator[SEP] identifier[GetFolderRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetFolder] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void setFile(File file) { String fileName = file.getName().toLowerCase(Locale.ROOT); if (fileName.matches(".*\\.htm(l)?$")) { method = OutputMethod.HTML; } else { if (fileName.matches(".*\\.jsonp")) { method = OutputMethod.JSONP; } else { method = OutputMethod.JSON; } } this.targetFile = file; }
class class_name[name] begin[{] method[setFile, return_type[void], modifier[public], parameter[file]] begin[{] local_variable[type[String], fileName] if[call[fileName.matches, parameter[literal[".*\\.htm(l)?$"]]]] begin[{] assign[member[.method], member[OutputMethod.HTML]] else begin[{] if[call[fileName.matches, parameter[literal[".*\\.jsonp"]]]] begin[{] assign[member[.method], member[OutputMethod.JSONP]] else begin[{] assign[member[.method], member[OutputMethod.JSON]] end[}] end[}] assign[THIS[member[None.targetFile]], member[.file]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setFile] operator[SEP] identifier[File] identifier[file] operator[SEP] { identifier[String] identifier[fileName] operator[=] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ROOT] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileName] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[method] operator[=] identifier[OutputMethod] operator[SEP] identifier[HTML] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[fileName] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[method] operator[=] identifier[OutputMethod] operator[SEP] identifier[JSONP] operator[SEP] } Keyword[else] { identifier[method] operator[=] identifier[OutputMethod] operator[SEP] identifier[JSON] operator[SEP] } } Keyword[this] operator[SEP] identifier[targetFile] operator[=] identifier[file] operator[SEP] }
public EncodingSchemeIDESidUD createEncodingSchemeIDESidUDFromString(EDataType eDataType, String initialValue) { EncodingSchemeIDESidUD result = EncodingSchemeIDESidUD.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
class class_name[name] begin[{] method[createEncodingSchemeIDESidUDFromString, return_type[type[EncodingSchemeIDESidUD]], modifier[public], parameter[eDataType, initialValue]] begin[{] local_variable[type[EncodingSchemeIDESidUD], result] if[binary_operation[member[.result], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[EncodingSchemeIDESidUD] identifier[createEncodingSchemeIDESidUDFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] { identifier[EncodingSchemeIDESidUD] identifier[result] operator[=] identifier[EncodingSchemeIDESidUD] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
protected void scheduleResize() { if (m_updateSizeTimer != null) { m_updateSizeTimer.cancel(); } m_updateSizeTimer = new Timer() { @Override public void run() { updateContentSize(); } }; m_updateSizeTimer.schedule(300); }
class class_name[name] begin[{] method[scheduleResize, return_type[void], modifier[protected], parameter[]] begin[{] if[binary_operation[member[.m_updateSizeTimer], !=, literal[null]]] begin[{] call[m_updateSizeTimer.cancel, parameter[]] else begin[{] None end[}] assign[member[.m_updateSizeTimer], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=updateContentSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Timer, sub_type=None))] call[m_updateSizeTimer.schedule, parameter[literal[300]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[scheduleResize] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_updateSizeTimer] operator[!=] Other[null] operator[SEP] { identifier[m_updateSizeTimer] operator[SEP] identifier[cancel] operator[SEP] operator[SEP] operator[SEP] } identifier[m_updateSizeTimer] operator[=] Keyword[new] identifier[Timer] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[updateContentSize] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] identifier[m_updateSizeTimer] operator[SEP] identifier[schedule] operator[SEP] Other[300] operator[SEP] operator[SEP] }
boolean validate(StringBuilder out) { this.isValid = true; // If log from construction has content, append to validation output msg. if (this.msgLog.length() > 0) { out.append(this.msgLog); } // Check that name is not null (it can be an empty string). if (this.getName() == null) { this.isValid = false; out.append(" ** DatasetNamer (1): null value for name is not valid."); } // Check that addLevel is not null. // boolean can't be null //if ( this.getAddLevel() == null) //{ // this.isValid = false; // out.append(" ** DatasetNamer (2): null value for addLevel is not valid."); //} // Check that type is not null. if (this.getType() == null) { this.isValid = false; out.append(" ** DatasetNamer (3): null value for type is not valid (set with bad string?)."); } if ( this.getType() == DatasetNamerType.REGULAR_EXPRESSION && ( this.getMatchPattern() == null || this.getSubstitutePattern() == null )) { this.isValid = false; out.append(" ** DatasetNamer (4): invalid datasetNamer <" + this.getName() + ">;" + " type is " + this.getType().toString() + ": matchPattern(" + this.getMatchPattern() + ") and substitutionPattern(" + this.getSubstitutePattern() + ") " + "must not be null."); } if ( this.getType() == DatasetNamerType.DODS_ATTRIBUTE && ( this.getAttribContainer() == null || this.getAttribName() == null ) ) { this.isValid = false; out.append(" ** DatasetNamer (5): invalid datasetNamer <" + this.getName() + ">;" + " type is " + this.getType().toString() + ": attriuteContainer(" + this.getAttribContainer() + ") and attributeName(" + this.getAttribName() + ") must not be null."); } return (this.isValid); }
class class_name[name] begin[{] method[validate, return_type[type[boolean]], modifier[default], parameter[out]] begin[{] assign[THIS[member[None.isValid]], literal[true]] if[binary_operation[THIS[member[None.msgLog]call[None.length, parameter[]]], >, literal[0]]] begin[{] call[out.append, parameter[THIS[member[None.msgLog]]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getName, parameter[]]], ==, literal[null]]] begin[{] assign[THIS[member[None.isValid]], literal[false]] call[out.append, parameter[literal[" ** DatasetNamer (1): null value for name is not valid."]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getType, parameter[]]], ==, literal[null]]] begin[{] assign[THIS[member[None.isValid]], literal[false]] call[out.append, parameter[literal[" ** DatasetNamer (3): null value for type is not valid (set with bad string?)."]]] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[call[None.getType, parameter[]]], ==, member[DatasetNamerType.REGULAR_EXPRESSION]], &&, binary_operation[binary_operation[THIS[call[None.getMatchPattern, parameter[]]], ==, literal[null]], ||, binary_operation[THIS[call[None.getSubstitutePattern, parameter[]]], ==, literal[null]]]]] begin[{] assign[THIS[member[None.isValid]], literal[false]] call[out.append, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal[" ** DatasetNamer (4): invalid datasetNamer <"], +, THIS[call[None.getName, parameter[]]]], +, literal[">;"]], +, literal[" type is "]], +, THIS[call[None.getType, parameter[]]call[None.toString, parameter[]]]], +, literal[": matchPattern("]], +, THIS[call[None.getMatchPattern, parameter[]]]], +, literal[") and substitutionPattern("]], +, THIS[call[None.getSubstitutePattern, parameter[]]]], +, literal[") "]], +, literal["must not be null."]]]] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[call[None.getType, parameter[]]], ==, member[DatasetNamerType.DODS_ATTRIBUTE]], &&, binary_operation[binary_operation[THIS[call[None.getAttribContainer, parameter[]]], ==, literal[null]], ||, binary_operation[THIS[call[None.getAttribName, parameter[]]], ==, literal[null]]]]] begin[{] assign[THIS[member[None.isValid]], literal[false]] call[out.append, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal[" ** DatasetNamer (5): invalid datasetNamer <"], +, THIS[call[None.getName, parameter[]]]], +, literal[">;"]], +, literal[" type is "]], +, THIS[call[None.getType, parameter[]]call[None.toString, parameter[]]]], +, literal[": attriuteContainer("]], +, THIS[call[None.getAttribContainer, parameter[]]]], +, literal[") and attributeName("]], +, THIS[call[None.getAttribName, parameter[]]]], +, literal[") must not be null."]]]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[boolean] identifier[validate] operator[SEP] identifier[StringBuilder] identifier[out] operator[SEP] { Keyword[this] operator[SEP] identifier[isValid] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[msgLog] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[out] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[msgLog] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[isValid] operator[=] literal[boolean] operator[SEP] identifier[out] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[isValid] operator[=] literal[boolean] operator[SEP] identifier[out] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[DatasetNamerType] operator[SEP] identifier[REGULAR_EXPRESSION] operator[&&] operator[SEP] Keyword[this] operator[SEP] identifier[getMatchPattern] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[getSubstitutePattern] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[isValid] operator[=] literal[boolean] operator[SEP] identifier[out] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getMatchPattern] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getSubstitutePattern] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[DatasetNamerType] operator[SEP] identifier[DODS_ATTRIBUTE] operator[&&] operator[SEP] Keyword[this] operator[SEP] identifier[getAttribContainer] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[getAttribName] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[isValid] operator[=] literal[boolean] operator[SEP] identifier[out] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getAttribContainer] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getAttribName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] Keyword[this] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] }
public void performImplicitDoubleStep(int x1, int x2 , double real , double img ) { double a11 = A.get(x1,x1); double a21 = A.get(x1+1,x1); double a12 = A.get(x1,x1+1); double a22 = A.get(x1+1,x1+1); double a32 = A.get(x1+2,x1+1); double p_plus_t = 2.0*real; double p_times_t = real*real + img*img; double b11,b21,b31; if( useStandardEq ) { b11 = (a11*a11 - p_plus_t*a11+p_times_t)/a21 + a12; b21 = a11+a22-p_plus_t; b31 = a32; } else { // this is different from the version in the book and seems in my testing to be more resilient to // over flow issues b11 = (a11*a11 - p_plus_t*a11+p_times_t) + a12*a21; b21 = (a11+a22-p_plus_t)*a21; b31 = a32*a21; } performImplicitDoubleStep(x1, x2, b11, b21, b31); }
class class_name[name] begin[{] method[performImplicitDoubleStep, return_type[void], modifier[public], parameter[x1, x2, real, img]] begin[{] local_variable[type[double], a11] local_variable[type[double], a21] local_variable[type[double], a12] local_variable[type[double], a22] local_variable[type[double], a32] local_variable[type[double], p_plus_t] local_variable[type[double], p_times_t] local_variable[type[double], b11] if[member[.useStandardEq]] begin[{] assign[member[.b11], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.a11], *, member[.a11]], -, binary_operation[member[.p_plus_t], *, member[.a11]]], +, member[.p_times_t]], /, member[.a21]], +, member[.a12]]] assign[member[.b21], binary_operation[binary_operation[member[.a11], +, member[.a22]], -, member[.p_plus_t]]] assign[member[.b31], member[.a32]] else begin[{] assign[member[.b11], binary_operation[binary_operation[binary_operation[binary_operation[member[.a11], *, member[.a11]], -, binary_operation[member[.p_plus_t], *, member[.a11]]], +, member[.p_times_t]], +, binary_operation[member[.a12], *, member[.a21]]]] assign[member[.b21], binary_operation[binary_operation[binary_operation[member[.a11], +, member[.a22]], -, member[.p_plus_t]], *, member[.a21]]] assign[member[.b31], binary_operation[member[.a32], *, member[.a21]]] end[}] call[.performImplicitDoubleStep, parameter[member[.x1], member[.x2], member[.b11], member[.b21], member[.b31]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[performImplicitDoubleStep] operator[SEP] Keyword[int] identifier[x1] , Keyword[int] identifier[x2] , Keyword[double] identifier[real] , Keyword[double] identifier[img] operator[SEP] { Keyword[double] identifier[a11] operator[=] identifier[A] operator[SEP] identifier[get] operator[SEP] identifier[x1] , identifier[x1] operator[SEP] operator[SEP] Keyword[double] identifier[a21] operator[=] identifier[A] operator[SEP] identifier[get] operator[SEP] identifier[x1] operator[+] Other[1] , identifier[x1] operator[SEP] operator[SEP] Keyword[double] identifier[a12] operator[=] identifier[A] operator[SEP] identifier[get] operator[SEP] identifier[x1] , identifier[x1] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[double] identifier[a22] operator[=] identifier[A] operator[SEP] identifier[get] operator[SEP] identifier[x1] operator[+] Other[1] , identifier[x1] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[double] identifier[a32] operator[=] identifier[A] operator[SEP] identifier[get] operator[SEP] identifier[x1] operator[+] Other[2] , identifier[x1] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[double] identifier[p_plus_t] operator[=] literal[Float] operator[*] identifier[real] operator[SEP] Keyword[double] identifier[p_times_t] operator[=] identifier[real] operator[*] identifier[real] operator[+] identifier[img] operator[*] identifier[img] operator[SEP] Keyword[double] identifier[b11] , identifier[b21] , identifier[b31] operator[SEP] Keyword[if] operator[SEP] identifier[useStandardEq] operator[SEP] { identifier[b11] operator[=] operator[SEP] identifier[a11] operator[*] identifier[a11] operator[-] identifier[p_plus_t] operator[*] identifier[a11] operator[+] identifier[p_times_t] operator[SEP] operator[/] identifier[a21] operator[+] identifier[a12] operator[SEP] identifier[b21] operator[=] identifier[a11] operator[+] identifier[a22] operator[-] identifier[p_plus_t] operator[SEP] identifier[b31] operator[=] identifier[a32] operator[SEP] } Keyword[else] { identifier[b11] operator[=] operator[SEP] identifier[a11] operator[*] identifier[a11] operator[-] identifier[p_plus_t] operator[*] identifier[a11] operator[+] identifier[p_times_t] operator[SEP] operator[+] identifier[a12] operator[*] identifier[a21] operator[SEP] identifier[b21] operator[=] operator[SEP] identifier[a11] operator[+] identifier[a22] operator[-] identifier[p_plus_t] operator[SEP] operator[*] identifier[a21] operator[SEP] identifier[b31] operator[=] identifier[a32] operator[*] identifier[a21] operator[SEP] } identifier[performImplicitDoubleStep] operator[SEP] identifier[x1] , identifier[x2] , identifier[b11] , identifier[b21] , identifier[b31] operator[SEP] operator[SEP] }
public Result redirectTemporary(String url) { status(Status.TEMPORARY_REDIRECT); with(HeaderNames.LOCATION, url); return this; }
class class_name[name] begin[{] method[redirectTemporary, return_type[type[Result]], modifier[public], parameter[url]] begin[{] call[.status, parameter[member[Status.TEMPORARY_REDIRECT]]] call[.with, parameter[member[HeaderNames.LOCATION], member[.url]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Result] identifier[redirectTemporary] operator[SEP] identifier[String] identifier[url] operator[SEP] { identifier[status] operator[SEP] identifier[Status] operator[SEP] identifier[TEMPORARY_REDIRECT] operator[SEP] operator[SEP] identifier[with] operator[SEP] identifier[HeaderNames] operator[SEP] identifier[LOCATION] , identifier[url] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public List<DBObject> toArray(final int max) { checkIteratorOrArray(IteratorOrArray.ARRAY); fillArray(max - 1); return all; }
class class_name[name] begin[{] method[toArray, return_type[type[List]], modifier[public], parameter[max]] begin[{] call[.checkIteratorOrArray, parameter[member[IteratorOrArray.ARRAY]]] call[.fillArray, parameter[binary_operation[member[.max], -, literal[1]]]] return[member[.all]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[DBObject] operator[>] identifier[toArray] operator[SEP] Keyword[final] Keyword[int] identifier[max] operator[SEP] { identifier[checkIteratorOrArray] operator[SEP] identifier[IteratorOrArray] operator[SEP] identifier[ARRAY] operator[SEP] operator[SEP] identifier[fillArray] operator[SEP] identifier[max] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[all] operator[SEP] }
private AbstractType<?> getKeyValidator(ColumnFamily columnFamily) { // this is a fix to support backward compatibility // which allows to skip the current key validator // please, take a look onto CASSANDRA-7498 for more details if ("true".equals(System.getProperty("skip.key.validator", "false"))) { return BytesType.instance; } return columnFamily.metadata().getKeyValidator(); }
class class_name[name] begin[{] method[getKeyValidator, return_type[type[AbstractType]], modifier[private], parameter[columnFamily]] begin[{] if[literal["true"]] begin[{] return[member[BytesType.instance]] else begin[{] None end[}] return[call[columnFamily.metadata, parameter[]]] end[}] END[}]
Keyword[private] identifier[AbstractType] operator[<] operator[?] operator[>] identifier[getKeyValidator] operator[SEP] identifier[ColumnFamily] identifier[columnFamily] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[BytesType] operator[SEP] identifier[instance] operator[SEP] } Keyword[return] identifier[columnFamily] operator[SEP] identifier[metadata] operator[SEP] operator[SEP] operator[SEP] identifier[getKeyValidator] operator[SEP] operator[SEP] operator[SEP] }
public FoxHttpRequest build() throws MalformedURLException, FoxHttpRequestException { if (this.url != null) { foxHttpRequest.setUrl(this.url); } return foxHttpRequest; }
class class_name[name] begin[{] method[build, return_type[type[FoxHttpRequest]], modifier[public], parameter[]] begin[{] if[binary_operation[THIS[member[None.url]], !=, literal[null]]] begin[{] call[foxHttpRequest.setUrl, parameter[THIS[member[None.url]]]] else begin[{] None end[}] return[member[.foxHttpRequest]] end[}] END[}]
Keyword[public] identifier[FoxHttpRequest] identifier[build] operator[SEP] operator[SEP] Keyword[throws] identifier[MalformedURLException] , identifier[FoxHttpRequestException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[url] operator[!=] Other[null] operator[SEP] { identifier[foxHttpRequest] operator[SEP] identifier[setUrl] operator[SEP] Keyword[this] operator[SEP] identifier[url] operator[SEP] operator[SEP] } Keyword[return] identifier[foxHttpRequest] operator[SEP] }
public EClass getGCCHST() { if (gcchstEClass == null) { gcchstEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(444); } return gcchstEClass; }
class class_name[name] begin[{] method[getGCCHST, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.gcchstEClass], ==, literal[null]]] begin[{] assign[member[.gcchstEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=444)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.gcchstEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getGCCHST] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[gcchstEClass] operator[==] Other[null] operator[SEP] { identifier[gcchstEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[AfplibPackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[444] operator[SEP] operator[SEP] } Keyword[return] identifier[gcchstEClass] operator[SEP] }
public void purgeFromInvalidateImpl(OutboundConnection connection, boolean notifyPeer) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "purgeFromInvalidateImpl", new Object[] { connection, "" + notifyPeer }); connection.getConnectionData().getConnectionDataGroup().purgeFromInvalidateImpl(connection, notifyPeer); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "purgeFromInvalidateImpl"); }
class class_name[name] begin[{] method[purgeFromInvalidateImpl, return_type[void], modifier[public], parameter[connection, notifyPeer]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["purgeFromInvalidateImpl"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=notifyPeer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] call[connection.getConnectionData, parameter[]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["purgeFromInvalidateImpl"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[purgeFromInvalidateImpl] operator[SEP] identifier[OutboundConnection] identifier[connection] , Keyword[boolean] identifier[notifyPeer] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[connection] , literal[String] operator[+] identifier[notifyPeer] } operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[getConnectionData] operator[SEP] operator[SEP] operator[SEP] identifier[getConnectionDataGroup] operator[SEP] operator[SEP] operator[SEP] identifier[purgeFromInvalidateImpl] operator[SEP] identifier[connection] , identifier[notifyPeer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] }
private void ensureCurrentLayout() { if (!tabPane.isValid()) { tabPane.validate(); } /* * If tabPane doesn't have a peer yet, the validate() call will silently * fail. We handle that by forcing a layout if tabPane is still invalid. * See bug 4237677. */ if (!tabPane.isValid()) { TabbedPaneLayout layout = (TabbedPaneLayout) tabPane.getLayout(); layout.calculateLayoutInfo(); } }
class class_name[name] begin[{] method[ensureCurrentLayout, return_type[void], modifier[private], parameter[]] begin[{] if[call[tabPane.isValid, parameter[]]] begin[{] call[tabPane.validate, parameter[]] else begin[{] None end[}] if[call[tabPane.isValid, parameter[]]] begin[{] local_variable[type[TabbedPaneLayout], layout] call[layout.calculateLayoutInfo, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[ensureCurrentLayout] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[tabPane] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] { identifier[tabPane] operator[SEP] identifier[validate] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[tabPane] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] { identifier[TabbedPaneLayout] identifier[layout] operator[=] operator[SEP] identifier[TabbedPaneLayout] operator[SEP] identifier[tabPane] operator[SEP] identifier[getLayout] operator[SEP] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[calculateLayoutInfo] operator[SEP] operator[SEP] operator[SEP] } }
public void generateAesKeys(int numKeys, int startOffset) throws IOException, KeyStoreException { for (int i = 1; i <= numKeys; i++) { SecretKey key = generateKey(); ks.setEntry(String.valueOf(i + startOffset), new KeyStore.SecretKeyEntry(key), new KeyStore.PasswordProtection(password)); } saveKeystore(); }
class class_name[name] begin[{] method[generateAesKeys, return_type[void], modifier[public], parameter[numKeys, startOffset]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=generateKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SecretKey, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=startOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), ClassCreator(arguments=[MemberReference(member=key, 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=KeyStore, sub_type=ReferenceType(arguments=None, dimensions=None, name=SecretKeyEntry, sub_type=None))), ClassCreator(arguments=[MemberReference(member=password, 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=KeyStore, sub_type=ReferenceType(arguments=None, dimensions=None, name=PasswordProtection, sub_type=None)))], member=setEntry, postfix_operators=[], prefix_operators=[], qualifier=ks, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[.saveKeystore, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[generateAesKeys] operator[SEP] Keyword[int] identifier[numKeys] , Keyword[int] identifier[startOffset] operator[SEP] Keyword[throws] identifier[IOException] , identifier[KeyStoreException] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<=] identifier[numKeys] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[SecretKey] identifier[key] operator[=] identifier[generateKey] operator[SEP] operator[SEP] operator[SEP] identifier[ks] operator[SEP] identifier[setEntry] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[i] operator[+] identifier[startOffset] operator[SEP] , Keyword[new] identifier[KeyStore] operator[SEP] identifier[SecretKeyEntry] operator[SEP] identifier[key] operator[SEP] , Keyword[new] identifier[KeyStore] operator[SEP] identifier[PasswordProtection] operator[SEP] identifier[password] operator[SEP] operator[SEP] operator[SEP] } identifier[saveKeystore] operator[SEP] operator[SEP] operator[SEP] }
private RValue executeConvert(Expr.Cast expr, CallStack frame) { RValue operand = executeExpression(ANY_T, expr.getOperand(), frame); return operand.convert(expr.getType()); }
class class_name[name] begin[{] method[executeConvert, return_type[type[RValue]], modifier[private], parameter[expr, frame]] begin[{] local_variable[type[RValue], operand] return[call[operand.convert, parameter[call[expr.getType, parameter[]]]]] end[}] END[}]
Keyword[private] identifier[RValue] identifier[executeConvert] operator[SEP] identifier[Expr] operator[SEP] identifier[Cast] identifier[expr] , identifier[CallStack] identifier[frame] operator[SEP] { identifier[RValue] identifier[operand] operator[=] identifier[executeExpression] operator[SEP] identifier[ANY_T] , identifier[expr] operator[SEP] identifier[getOperand] operator[SEP] operator[SEP] , identifier[frame] operator[SEP] operator[SEP] Keyword[return] identifier[operand] operator[SEP] identifier[convert] operator[SEP] identifier[expr] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public byte[] getLocalFileDataData() { // CRC will be added later byte[] data = new byte[getLocalFileDataLength().getValue() - WORD]; System.arraycopy(ZipShort.getBytes(getMode()), 0, data, 0, 2); byte[] linkArray = getLinkedFile().getBytes(); // Uses default charset - see class Javadoc // CheckStyle:MagicNumber OFF System.arraycopy(ZipLong.getBytes(linkArray.length), 0, data, 2, WORD); System.arraycopy(ZipShort.getBytes(getUserId()), 0, data, 6, 2); System.arraycopy(ZipShort.getBytes(getGroupId()), 0, data, 8, 2); System.arraycopy(linkArray, 0, data, 10, linkArray.length); // CheckStyle:MagicNumber ON crc.reset(); crc.update(data); long checksum = crc.getValue(); byte[] result = new byte[data.length + WORD]; System.arraycopy(ZipLong.getBytes(checksum), 0, result, 0, WORD); System.arraycopy(data, 0, result, WORD, data.length); return result; }
class class_name[name] begin[{] method[getLocalFileDataData, return_type[type[byte]], modifier[public], parameter[]] begin[{] local_variable[type[byte], data] call[System.arraycopy, parameter[call[ZipShort.getBytes, parameter[call[.getMode, parameter[]]]], literal[0], member[.data], literal[0], literal[2]]] local_variable[type[byte], linkArray] call[System.arraycopy, parameter[call[ZipLong.getBytes, parameter[member[linkArray.length]]], literal[0], member[.data], literal[2], member[.WORD]]] call[System.arraycopy, parameter[call[ZipShort.getBytes, parameter[call[.getUserId, parameter[]]]], literal[0], member[.data], literal[6], literal[2]]] call[System.arraycopy, parameter[call[ZipShort.getBytes, parameter[call[.getGroupId, parameter[]]]], literal[0], member[.data], literal[8], literal[2]]] call[System.arraycopy, parameter[member[.linkArray], literal[0], member[.data], literal[10], member[linkArray.length]]] call[crc.reset, parameter[]] call[crc.update, parameter[member[.data]]] local_variable[type[long], checksum] local_variable[type[byte], result] call[System.arraycopy, parameter[call[ZipLong.getBytes, parameter[member[.checksum]]], literal[0], member[.result], literal[0], member[.WORD]]] call[System.arraycopy, parameter[member[.data], literal[0], member[.result], member[.WORD], member[data.length]]] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[getLocalFileDataData] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[getLocalFileDataLength] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[-] identifier[WORD] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[ZipShort] operator[SEP] identifier[getBytes] operator[SEP] identifier[getMode] operator[SEP] operator[SEP] operator[SEP] , Other[0] , identifier[data] , Other[0] , Other[2] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[linkArray] operator[=] identifier[getLinkedFile] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[ZipLong] operator[SEP] identifier[getBytes] operator[SEP] identifier[linkArray] operator[SEP] identifier[length] operator[SEP] , Other[0] , identifier[data] , Other[2] , identifier[WORD] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[ZipShort] operator[SEP] identifier[getBytes] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] operator[SEP] , Other[0] , identifier[data] , Other[6] , Other[2] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[ZipShort] operator[SEP] identifier[getBytes] operator[SEP] identifier[getGroupId] operator[SEP] operator[SEP] operator[SEP] , Other[0] , identifier[data] , Other[8] , Other[2] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[linkArray] , Other[0] , identifier[data] , Other[10] , identifier[linkArray] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[crc] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[crc] operator[SEP] identifier[update] operator[SEP] identifier[data] operator[SEP] operator[SEP] Keyword[long] identifier[checksum] operator[=] identifier[crc] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[+] identifier[WORD] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[ZipLong] operator[SEP] identifier[getBytes] operator[SEP] identifier[checksum] operator[SEP] , Other[0] , identifier[result] , Other[0] , identifier[WORD] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[data] , Other[0] , identifier[result] , identifier[WORD] , identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
protected final void setDefaultValue() { m_start = null; m_end = null; m_patterntype = PatternType.NONE; m_dayOfMonth = 0; m_exceptions.clear(); m_individualDates.clear(); m_interval = 0; m_isEveryWorkingDay = false; m_isWholeDay = false; m_month = Month.JANUARY; m_seriesEndDate = null; m_seriesOccurrences = 0; m_weekDays.clear(); m_weeksOfMonth.clear(); m_endType = EndType.SINGLE; m_parentSeriesId = null; }
class class_name[name] begin[{] method[setDefaultValue, return_type[void], modifier[final protected], parameter[]] begin[{] assign[member[.m_start], literal[null]] assign[member[.m_end], literal[null]] assign[member[.m_patterntype], member[PatternType.NONE]] assign[member[.m_dayOfMonth], literal[0]] call[m_exceptions.clear, parameter[]] call[m_individualDates.clear, parameter[]] assign[member[.m_interval], literal[0]] assign[member[.m_isEveryWorkingDay], literal[false]] assign[member[.m_isWholeDay], literal[false]] assign[member[.m_month], member[Month.JANUARY]] assign[member[.m_seriesEndDate], literal[null]] assign[member[.m_seriesOccurrences], literal[0]] call[m_weekDays.clear, parameter[]] call[m_weeksOfMonth.clear, parameter[]] assign[member[.m_endType], member[EndType.SINGLE]] assign[member[.m_parentSeriesId], literal[null]] end[}] END[}]
Keyword[protected] Keyword[final] Keyword[void] identifier[setDefaultValue] operator[SEP] operator[SEP] { identifier[m_start] operator[=] Other[null] operator[SEP] identifier[m_end] operator[=] Other[null] operator[SEP] identifier[m_patterntype] operator[=] identifier[PatternType] operator[SEP] identifier[NONE] operator[SEP] identifier[m_dayOfMonth] operator[=] Other[0] operator[SEP] identifier[m_exceptions] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[m_individualDates] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[m_interval] operator[=] Other[0] operator[SEP] identifier[m_isEveryWorkingDay] operator[=] literal[boolean] operator[SEP] identifier[m_isWholeDay] operator[=] literal[boolean] operator[SEP] identifier[m_month] operator[=] identifier[Month] operator[SEP] identifier[JANUARY] operator[SEP] identifier[m_seriesEndDate] operator[=] Other[null] operator[SEP] identifier[m_seriesOccurrences] operator[=] Other[0] operator[SEP] identifier[m_weekDays] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[m_weeksOfMonth] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[m_endType] operator[=] identifier[EndType] operator[SEP] identifier[SINGLE] operator[SEP] identifier[m_parentSeriesId] operator[=] Other[null] operator[SEP] }
private <T> ForkJoinTask<T> externalSubmit(ForkJoinTask<T> task) { Thread t; ForkJoinWorkerThread w; WorkQueue q; if (task == null) throw new NullPointerException(); if (((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) && (w = (ForkJoinWorkerThread)t).pool == this && (q = w.workQueue) != null) q.push(task); else externalPush(task); return task; }
class class_name[name] begin[{] method[externalSubmit, return_type[type[ForkJoinTask]], modifier[private], parameter[task]] begin[{] local_variable[type[Thread], t] local_variable[type[ForkJoinWorkerThread], w] local_variable[type[WorkQueue], q] if[binary_operation[member[.task], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[assign[member[.t], call[Thread.currentThread, parameter[]]], instanceof, type[ForkJoinWorkerThread]], &&, binary_operation[assign[member[.w], Cast(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ForkJoinWorkerThread, sub_type=None))], ==, THIS[]]], &&, binary_operation[assign[member[.q], member[w.workQueue]], !=, literal[null]]]] begin[{] call[q.push, parameter[member[.task]]] else begin[{] call[.externalPush, parameter[member[.task]]] end[}] return[member[.task]] end[}] END[}]
Keyword[private] operator[<] identifier[T] operator[>] identifier[ForkJoinTask] operator[<] identifier[T] operator[>] identifier[externalSubmit] operator[SEP] identifier[ForkJoinTask] operator[<] identifier[T] operator[>] identifier[task] operator[SEP] { identifier[Thread] identifier[t] operator[SEP] identifier[ForkJoinWorkerThread] identifier[w] operator[SEP] identifier[WorkQueue] identifier[q] operator[SEP] Keyword[if] operator[SEP] identifier[task] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[t] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] Keyword[instanceof] identifier[ForkJoinWorkerThread] operator[SEP] operator[&&] operator[SEP] identifier[w] operator[=] operator[SEP] identifier[ForkJoinWorkerThread] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[pool] operator[==] Keyword[this] operator[&&] operator[SEP] identifier[q] operator[=] identifier[w] operator[SEP] identifier[workQueue] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[q] operator[SEP] identifier[push] operator[SEP] identifier[task] operator[SEP] operator[SEP] Keyword[else] identifier[externalPush] operator[SEP] identifier[task] operator[SEP] operator[SEP] Keyword[return] identifier[task] operator[SEP] }
public int read(char cbuf[], int off, int len) throws IOException { synchronized (lock) { ensureOpen(); if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length) || ((off + len) < 0)) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } int n = read1(cbuf, off, len); if (n <= 0) return n; while ((n < len) && in.ready()) { int n1 = read1(cbuf, off + n, len - n); if (n1 <= 0) break; n += n1; } return n; } }
class class_name[name] begin[{] method[read, return_type[type[int]], modifier[public], parameter[cbuf, off, len]] begin[{] SYNCHRONIZED[member[.lock]] BEGIN[{] call[.ensureOpen, parameter[]] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.off], <, literal[0]], ||, binary_operation[member[.off], >, member[cbuf.length]]], ||, binary_operation[member[.len], <, literal[0]]], ||, binary_operation[binary_operation[member[.off], +, member[.len]], >, member[cbuf.length]]], ||, binary_operation[binary_operation[member[.off], +, member[.len]], <, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None) else begin[{] if[binary_operation[member[.len], ==, literal[0]]] begin[{] return[literal[0]] else begin[{] None end[}] end[}] local_variable[type[int], n] if[binary_operation[member[.n], <=, literal[0]]] begin[{] return[member[.n]] else begin[{] None end[}] while[binary_operation[binary_operation[member[.n], <, member[.len]], &&, call[in.ready, parameter[]]]] begin[{] local_variable[type[int], n1] if[binary_operation[member[.n1], <=, literal[0]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.n], member[.n1]] end[}] return[member[.n]] END[}] end[}] END[}]
Keyword[public] Keyword[int] identifier[read] operator[SEP] Keyword[char] identifier[cbuf] operator[SEP] operator[SEP] , Keyword[int] identifier[off] , Keyword[int] identifier[len] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { identifier[ensureOpen] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[off] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] identifier[off] operator[>] identifier[cbuf] operator[SEP] identifier[length] operator[SEP] operator[||] operator[SEP] identifier[len] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[off] operator[+] identifier[len] operator[SEP] operator[>] identifier[cbuf] operator[SEP] identifier[length] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[off] operator[+] identifier[len] operator[SEP] operator[<] Other[0] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[len] operator[==] Other[0] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[int] identifier[n] operator[=] identifier[read1] operator[SEP] identifier[cbuf] , identifier[off] , identifier[len] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[<=] Other[0] operator[SEP] Keyword[return] identifier[n] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[n] operator[<] identifier[len] operator[SEP] operator[&&] identifier[in] operator[SEP] identifier[ready] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[n1] operator[=] identifier[read1] operator[SEP] identifier[cbuf] , identifier[off] operator[+] identifier[n] , identifier[len] operator[-] identifier[n] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n1] operator[<=] Other[0] operator[SEP] Keyword[break] operator[SEP] identifier[n] operator[+=] identifier[n1] operator[SEP] } Keyword[return] identifier[n] operator[SEP] } }
public static SolarTime ofLocation( double latitude, double longitude, int altitude, Calculator calculator ) { String name = calculator.name(); CALCULATORS.putIfAbsent(name, calculator); check(latitude, longitude, altitude, name); return new SolarTime(latitude, longitude, altitude, name, null); }
class class_name[name] begin[{] method[ofLocation, return_type[type[SolarTime]], modifier[public static], parameter[latitude, longitude, altitude, calculator]] begin[{] local_variable[type[String], name] call[CALCULATORS.putIfAbsent, parameter[member[.name], member[.calculator]]] call[.check, parameter[member[.latitude], member[.longitude], member[.altitude], member[.name]]] return[ClassCreator(arguments=[MemberReference(member=latitude, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=longitude, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=altitude, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=SolarTime, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[SolarTime] identifier[ofLocation] operator[SEP] Keyword[double] identifier[latitude] , Keyword[double] identifier[longitude] , Keyword[int] identifier[altitude] , identifier[Calculator] identifier[calculator] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[calculator] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[CALCULATORS] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[name] , identifier[calculator] operator[SEP] operator[SEP] identifier[check] operator[SEP] identifier[latitude] , identifier[longitude] , identifier[altitude] , identifier[name] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[SolarTime] operator[SEP] identifier[latitude] , identifier[longitude] , identifier[altitude] , identifier[name] , Other[null] operator[SEP] operator[SEP] }
public boolean isServerStopping() { String thisMethodName = CLASS_NAME + ".isServerStopping()"; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exit(tc, thisMethodName, new Boolean(_serverStopping)); } return _serverStopping; }
class class_name[name] begin[{] method[isServerStopping, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[String], thisMethodName] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], member[.thisMethodName], THIS[]]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], member[.thisMethodName], ClassCreator(arguments=[MemberReference(member=_serverStopping, 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=Boolean, sub_type=None))]] else begin[{] None end[}] return[member[._serverStopping]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isServerStopping] operator[SEP] operator[SEP] { identifier[String] identifier[thisMethodName] operator[=] identifier[CLASS_NAME] operator[+] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , identifier[thisMethodName] , Keyword[this] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , identifier[thisMethodName] , Keyword[new] identifier[Boolean] operator[SEP] identifier[_serverStopping] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[_serverStopping] operator[SEP] }
@Override public MapEntry<K, V> getDefaultInstanceForType() { return new MapEntry<K, V>(metadata, metadata.defaultKey, metadata.defaultValue); }
class class_name[name] begin[{] method[getDefaultInstanceForType, return_type[type[MapEntry]], modifier[public], parameter[]] begin[{] return[ClassCreator(arguments=[MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=defaultKey, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[]), MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=MapEntry, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[MapEntry] operator[<] identifier[K] , identifier[V] operator[>] identifier[getDefaultInstanceForType] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[MapEntry] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[metadata] , identifier[metadata] operator[SEP] identifier[defaultKey] , identifier[metadata] operator[SEP] identifier[defaultValue] operator[SEP] operator[SEP] }
private static String getHexString(BitSet bitSet) { StringBuilder builder = new StringBuilder(); // Build the hex string. for (byte byteEntry : bitSet.toByteArray()) { // Java bytes are signed, but we want the value as if it were unsigned. int value = UnsignedBytes.toInt(byteEntry); String hexString = Integer.toHexString(value); // Pad string to be two characters (if it isn't already). hexString = Strings.padStart(hexString, 2, '0'); builder.append(hexString); } return builder.toString(); }
class class_name[name] begin[{] method[getHexString, return_type[type[String]], modifier[private static], parameter[bitSet]] begin[{] local_variable[type[StringBuilder], builder] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=byteEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toInt, postfix_operators=[], prefix_operators=[], qualifier=UnsignedBytes, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=hexString)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hexString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=hexString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0')], member=padStart, postfix_operators=[], prefix_operators=[], qualifier=Strings, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=hexString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=bitSet, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=byteEntry)], modifiers=set(), type=BasicType(dimensions=[], name=byte))), label=None) return[call[builder.toString, parameter[]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[getHexString] operator[SEP] identifier[BitSet] identifier[bitSet] operator[SEP] { identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[byte] identifier[byteEntry] operator[:] identifier[bitSet] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[value] operator[=] identifier[UnsignedBytes] operator[SEP] identifier[toInt] operator[SEP] identifier[byteEntry] operator[SEP] operator[SEP] identifier[String] identifier[hexString] operator[=] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[hexString] operator[=] identifier[Strings] operator[SEP] identifier[padStart] operator[SEP] identifier[hexString] , Other[2] , literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[hexString] operator[SEP] operator[SEP] } Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private void setTitleOfLayoutHeader() { titleOfArtifactDetails.setValue(HawkbitCommonUtil.getArtifactoryDetailsLabelId("", i18n)); titleOfArtifactDetails.setContentMode(ContentMode.HTML); }
class class_name[name] begin[{] method[setTitleOfLayoutHeader, return_type[void], modifier[private], parameter[]] begin[{] call[titleOfArtifactDetails.setValue, parameter[call[HawkbitCommonUtil.getArtifactoryDetailsLabelId, parameter[literal[""], member[.i18n]]]]] call[titleOfArtifactDetails.setContentMode, parameter[member[ContentMode.HTML]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setTitleOfLayoutHeader] operator[SEP] operator[SEP] { identifier[titleOfArtifactDetails] operator[SEP] identifier[setValue] operator[SEP] identifier[HawkbitCommonUtil] operator[SEP] identifier[getArtifactoryDetailsLabelId] operator[SEP] literal[String] , identifier[i18n] operator[SEP] operator[SEP] operator[SEP] identifier[titleOfArtifactDetails] operator[SEP] identifier[setContentMode] operator[SEP] identifier[ContentMode] operator[SEP] identifier[HTML] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public E getElem(int index, int xor) { if (xor < (1 << 5)) { // level = 0 return (E) display0[index & 31]; } else if (xor < (1 << 10)) { // level = 1 return (E) ((Object[]) display1[(index >> 5) & 31])[index & 31]; } else if (xor < (1 << 15)) { // level = 2 return (E) ((Object[]) ((Object[]) display2[(index >> 10) & 31])[(index >> 5) & 31])[index & 31]; } else if (xor < (1 << 20)) { // level = 3 return (E) ((Object[]) ((Object[]) ((Object[]) display3[(index >> 15) & 31])[(index >> 10) & 31])[(index >> 5) & 31])[index & 31]; } else if (xor < (1 << 25)) { // level = 4 return (E) ((Object[]) ((Object[]) ((Object[]) ((Object[]) display4[(index >> 20) & 31])[(index >> 15) & 31])[(index >> 10) & 31])[(index >> 5) & 31])[index & 31]; } else if (xor < (1 << 30)) { // level = 5 return (E) ((Object[]) ((Object[]) ((Object[]) ((Object[]) ((Object[]) display5[(index >> 25) & 31])[(index >> 20) & 31])[(index >> 15) & 31])[(index >> 10) & 31])[(index >> 5) & 31])[index & 31]; } else { // level = 6 throw new IllegalArgumentException(); } }
class class_name[name] begin[{] method[getElem, return_type[type[E]], modifier[public], parameter[index, xor]] begin[{] if[binary_operation[member[.xor], <, binary_operation[literal[1], <<, literal[5]]]] begin[{] return[Cast(expression=MemberReference(member=display0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=31), operator=&))]), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))] else begin[{] if[binary_operation[member[.xor], <, binary_operation[literal[1], <<, literal[10]]]] begin[{] return[Cast(expression=Cast(expression=MemberReference(member=display1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=31), operator=&))]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))] else begin[{] if[binary_operation[member[.xor], <, binary_operation[literal[1], <<, literal[15]]]] begin[{] return[Cast(expression=Cast(expression=Cast(expression=MemberReference(member=display2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=31), operator=&))]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))] else begin[{] if[binary_operation[member[.xor], <, binary_operation[literal[1], <<, literal[20]]]] begin[{] return[Cast(expression=Cast(expression=Cast(expression=Cast(expression=MemberReference(member=display3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=15), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=31), operator=&))]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))] else begin[{] if[binary_operation[member[.xor], <, binary_operation[literal[1], <<, literal[25]]]] begin[{] return[Cast(expression=Cast(expression=Cast(expression=Cast(expression=Cast(expression=MemberReference(member=display4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=20), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=31), operator=&))]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))] else begin[{] if[binary_operation[member[.xor], <, binary_operation[literal[1], <<, literal[30]]]] begin[{] return[Cast(expression=Cast(expression=Cast(expression=Cast(expression=Cast(expression=Cast(expression=MemberReference(member=display5, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=25), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=31), operator=&))]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] end[}] end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[E] identifier[getElem] operator[SEP] Keyword[int] identifier[index] , Keyword[int] identifier[xor] operator[SEP] { Keyword[if] operator[SEP] identifier[xor] operator[<] operator[SEP] Other[1] operator[<<] Other[5] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[E] operator[SEP] identifier[display0] operator[SEP] identifier[index] operator[&] Other[31] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[xor] operator[<] operator[SEP] Other[1] operator[<<] Other[10] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[E] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[display1] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[5] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[&] Other[31] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[xor] operator[<] operator[SEP] Other[1] operator[<<] Other[15] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[E] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[display2] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[10] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[5] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[&] Other[31] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[xor] operator[<] operator[SEP] Other[1] operator[<<] Other[20] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[E] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[display3] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[15] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[10] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[5] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[&] Other[31] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[xor] operator[<] operator[SEP] Other[1] operator[<<] Other[25] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[E] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[display4] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[20] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[15] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[10] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[5] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[&] Other[31] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[xor] operator[<] operator[SEP] Other[1] operator[<<] Other[30] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[E] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[display5] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[25] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[20] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[15] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[10] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[>] operator[>] Other[5] operator[SEP] operator[&] Other[31] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[&] Other[31] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] } }
@Override public synchronized Table<String> setSize(TerminalSize size) { setVisibleRows(size.getRows() - 1); return super.setSize(size); }
class class_name[name] begin[{] method[setSize, return_type[type[Table]], modifier[synchronized public], parameter[size]] begin[{] call[.setVisibleRows, parameter[binary_operation[call[size.getRows, parameter[]], -, literal[1]]]] return[SuperMethodInvocation(arguments=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSize, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] identifier[Table] operator[<] identifier[String] operator[>] identifier[setSize] operator[SEP] identifier[TerminalSize] identifier[size] operator[SEP] { identifier[setVisibleRows] operator[SEP] identifier[size] operator[SEP] identifier[getRows] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[return] Keyword[super] operator[SEP] identifier[setSize] operator[SEP] identifier[size] operator[SEP] operator[SEP] }
public Map<String,String> getMapForEntrancePI(SamzaEntranceProcessingItem epi, String filename, String filesystem) { Map<String,String> map = getBasicSystemConfig(); // Set job name, task class (from SamzaEntranceProcessingItem) setJobName(map, epi.getName()); setTaskClass(map, SamzaEntranceProcessingItem.class.getName()); // Input for the entrance task (from our custom consumer) setTaskInputs(map, SYSTEM_NAME+"."+epi.getName()); // Output from entrance task // Since entrancePI should have only 1 output stream // there is no need for checking the batch size, setting different system names // The custom consumer (samoa system) does not suuport reading from a specific index // => no need for checkpointing SamzaStream outputStream = (SamzaStream)epi.getOutputStream(); // Set samoa system factory setValue(map, "systems."+SYSTEM_NAME+".samza.factory", SamoaSystemFactory.class.getName()); // Set Kafka system (only if there is an output stream) if (outputStream != null) setKafkaSystem(map, outputStream.getSystemName(), this.zookeeper, this.kafkaBrokerList, outputStream.getBatchSize()); // Processor file setFileName(map, filename); setFileSystem(map, filesystem); // Number of containers setNumberOfContainers(map, 1, this.piPerContainerRatio); return map; }
class class_name[name] begin[{] method[getMapForEntrancePI, return_type[type[Map]], modifier[public], parameter[epi, filename, filesystem]] begin[{] local_variable[type[Map], map] call[.setJobName, parameter[member[.map], call[epi.getName, parameter[]]]] call[.setTaskClass, parameter[member[.map], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SamzaEntranceProcessingItem, sub_type=None))]] call[.setTaskInputs, parameter[member[.map], binary_operation[binary_operation[member[.SYSTEM_NAME], +, literal["."]], +, call[epi.getName, parameter[]]]]] local_variable[type[SamzaStream], outputStream] call[.setValue, parameter[member[.map], binary_operation[binary_operation[literal["systems."], +, member[.SYSTEM_NAME]], +, literal[".samza.factory"]], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SamoaSystemFactory, sub_type=None))]] if[binary_operation[member[.outputStream], !=, literal[null]]] begin[{] call[.setKafkaSystem, parameter[member[.map], call[outputStream.getSystemName, parameter[]], THIS[member[None.zookeeper]], THIS[member[None.kafkaBrokerList]], call[outputStream.getBatchSize, parameter[]]]] else begin[{] None end[}] call[.setFileName, parameter[member[.map], member[.filename]]] call[.setFileSystem, parameter[member[.map], member[.filesystem]]] call[.setNumberOfContainers, parameter[member[.map], literal[1], THIS[member[None.piPerContainerRatio]]]] return[member[.map]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getMapForEntrancePI] operator[SEP] identifier[SamzaEntranceProcessingItem] identifier[epi] , identifier[String] identifier[filename] , identifier[String] identifier[filesystem] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[=] identifier[getBasicSystemConfig] operator[SEP] operator[SEP] operator[SEP] identifier[setJobName] operator[SEP] identifier[map] , identifier[epi] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setTaskClass] operator[SEP] identifier[map] , identifier[SamzaEntranceProcessingItem] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setTaskInputs] operator[SEP] identifier[map] , identifier[SYSTEM_NAME] operator[+] literal[String] operator[+] identifier[epi] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SamzaStream] identifier[outputStream] operator[=] operator[SEP] identifier[SamzaStream] operator[SEP] identifier[epi] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[map] , literal[String] operator[+] identifier[SYSTEM_NAME] operator[+] literal[String] , identifier[SamoaSystemFactory] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[outputStream] operator[!=] Other[null] operator[SEP] identifier[setKafkaSystem] operator[SEP] identifier[map] , identifier[outputStream] operator[SEP] identifier[getSystemName] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[zookeeper] , Keyword[this] operator[SEP] identifier[kafkaBrokerList] , identifier[outputStream] operator[SEP] identifier[getBatchSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setFileName] operator[SEP] identifier[map] , identifier[filename] operator[SEP] operator[SEP] identifier[setFileSystem] operator[SEP] identifier[map] , identifier[filesystem] operator[SEP] operator[SEP] identifier[setNumberOfContainers] operator[SEP] identifier[map] , Other[1] , Keyword[this] operator[SEP] identifier[piPerContainerRatio] operator[SEP] operator[SEP] Keyword[return] identifier[map] operator[SEP] }
public SubsequentAddressMessage createSAM(int cic) { SubsequentAddressMessage msg = createSAM(); CircuitIdentificationCode code = this.parameterFactory.createCircuitIdentificationCode(); code.setCIC(cic); msg.setCircuitIdentificationCode(code); return msg; }
class class_name[name] begin[{] method[createSAM, return_type[type[SubsequentAddressMessage]], modifier[public], parameter[cic]] begin[{] local_variable[type[SubsequentAddressMessage], msg] local_variable[type[CircuitIdentificationCode], code] call[code.setCIC, parameter[member[.cic]]] call[msg.setCircuitIdentificationCode, parameter[member[.code]]] return[member[.msg]] end[}] END[}]
Keyword[public] identifier[SubsequentAddressMessage] identifier[createSAM] operator[SEP] Keyword[int] identifier[cic] operator[SEP] { identifier[SubsequentAddressMessage] identifier[msg] operator[=] identifier[createSAM] operator[SEP] operator[SEP] operator[SEP] identifier[CircuitIdentificationCode] identifier[code] operator[=] Keyword[this] operator[SEP] identifier[parameterFactory] operator[SEP] identifier[createCircuitIdentificationCode] operator[SEP] operator[SEP] operator[SEP] identifier[code] operator[SEP] identifier[setCIC] operator[SEP] identifier[cic] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[setCircuitIdentificationCode] operator[SEP] identifier[code] operator[SEP] operator[SEP] Keyword[return] identifier[msg] operator[SEP] }
@Override public EClass getIfcMaterialConstituentSet() { if (ifcMaterialConstituentSetEClass == null) { ifcMaterialConstituentSetEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(359); } return ifcMaterialConstituentSetEClass; }
class class_name[name] begin[{] method[getIfcMaterialConstituentSet, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcMaterialConstituentSetEClass], ==, literal[null]]] begin[{] assign[member[.ifcMaterialConstituentSetEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=359)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcMaterialConstituentSetEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcMaterialConstituentSet] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcMaterialConstituentSetEClass] operator[==] Other[null] operator[SEP] { identifier[ifcMaterialConstituentSetEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[359] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcMaterialConstituentSetEClass] operator[SEP] }
public String getLevel() { try { LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); return loggerContext.getLogger("root").getLevel().toString(); } catch (Exception e) { e.printStackTrace(); return ""; } }
class class_name[name] begin[{] method[getLevel, return_type[type[String]], modifier[public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getILoggerFactory, postfix_operators=[], prefix_operators=[], qualifier=LoggerFactory, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=LoggerContext, sub_type=None)), name=loggerContext)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LoggerContext, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="root")], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=loggerContext, selectors=[MethodInvocation(arguments=[], member=getLevel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), 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] identifier[String] identifier[getLevel] operator[SEP] operator[SEP] { Keyword[try] { identifier[LoggerContext] identifier[loggerContext] operator[=] operator[SEP] identifier[LoggerContext] operator[SEP] identifier[LoggerFactory] operator[SEP] identifier[getILoggerFactory] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[loggerContext] operator[SEP] identifier[getLogger] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] } }
public void setFileShareARNList(java.util.Collection<String> fileShareARNList) { if (fileShareARNList == null) { this.fileShareARNList = null; return; } this.fileShareARNList = new com.amazonaws.internal.SdkInternalList<String>(fileShareARNList); }
class class_name[name] begin[{] method[setFileShareARNList, return_type[void], modifier[public], parameter[fileShareARNList]] begin[{] if[binary_operation[member[.fileShareARNList], ==, literal[null]]] begin[{] assign[THIS[member[None.fileShareARNList]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.fileShareARNList]], ClassCreator(arguments=[MemberReference(member=fileShareARNList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setFileShareARNList] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[fileShareARNList] operator[SEP] { Keyword[if] operator[SEP] identifier[fileShareARNList] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[fileShareARNList] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[fileShareARNList] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[fileShareARNList] operator[SEP] operator[SEP] }
public <T extends Evaluation> T evaluateMDS(JavaRDD<MultiDataSet> data) { return evaluateMDS(data, DEFAULT_EVAL_SCORE_BATCH_SIZE); }
class class_name[name] begin[{] method[evaluateMDS, return_type[type[T]], modifier[public], parameter[data]] begin[{] return[call[.evaluateMDS, parameter[member[.data], member[.DEFAULT_EVAL_SCORE_BATCH_SIZE]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Evaluation] operator[>] identifier[T] identifier[evaluateMDS] operator[SEP] identifier[JavaRDD] operator[<] identifier[MultiDataSet] operator[>] identifier[data] operator[SEP] { Keyword[return] identifier[evaluateMDS] operator[SEP] identifier[data] , identifier[DEFAULT_EVAL_SCORE_BATCH_SIZE] operator[SEP] operator[SEP] }
@Override public void transferSucceeded(TransferEvent event) { TransferResource resource = event.getResource(); downloads.remove(resource); long contentLength = event.getTransferredBytes(); if (contentLength >= 0) { long duration = System.currentTimeMillis() - resource.getTransferStartTime(); double kbPerSec = (contentLength / 1024.0) / (duration / 1000.0); StringBuilder sb = new StringBuilder().append("Completed") .append(event.getRequestType() == TransferEvent.RequestType.PUT ? " upload of " : " download of ") .append(resource.getResourceName()) .append(event.getRequestType() == TransferEvent.RequestType.PUT ? " into " : " from ") .append(resource.getRepositoryUrl()).append(", transferred ") .append(contentLength >= 1024 ? toKB(contentLength) + " KB" : contentLength + " B").append(" at ") .append(new DecimalFormat("0.0", new DecimalFormatSymbols(Locale.ENGLISH)).format(kbPerSec)) .append("KB/sec"); log.fine(sb.toString()); } }
class class_name[name] begin[{] method[transferSucceeded, return_type[void], modifier[public], parameter[event]] begin[{] local_variable[type[TransferResource], resource] call[downloads.remove, parameter[member[.resource]]] local_variable[type[long], contentLength] if[binary_operation[member[.contentLength], >=, literal[0]]] begin[{] local_variable[type[long], duration] local_variable[type[double], kbPerSec] local_variable[type[StringBuilder], sb] call[log.fine, parameter[call[sb.toString, parameter[]]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[transferSucceeded] operator[SEP] identifier[TransferEvent] identifier[event] operator[SEP] { identifier[TransferResource] identifier[resource] operator[=] identifier[event] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] identifier[downloads] operator[SEP] identifier[remove] operator[SEP] identifier[resource] operator[SEP] operator[SEP] Keyword[long] identifier[contentLength] operator[=] identifier[event] operator[SEP] identifier[getTransferredBytes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[contentLength] operator[>=] Other[0] operator[SEP] { Keyword[long] identifier[duration] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[resource] operator[SEP] identifier[getTransferStartTime] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[kbPerSec] operator[=] operator[SEP] identifier[contentLength] operator[/] literal[Float] operator[SEP] operator[/] operator[SEP] identifier[duration] operator[/] literal[Float] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] 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] identifier[event] operator[SEP] identifier[getRequestType] operator[SEP] operator[SEP] operator[==] identifier[TransferEvent] operator[SEP] identifier[RequestType] operator[SEP] identifier[PUT] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[resource] operator[SEP] identifier[getResourceName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[event] operator[SEP] identifier[getRequestType] operator[SEP] operator[SEP] operator[==] identifier[TransferEvent] operator[SEP] identifier[RequestType] operator[SEP] identifier[PUT] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[resource] operator[SEP] identifier[getRepositoryUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[contentLength] operator[>=] Other[1024] operator[?] identifier[toKB] operator[SEP] identifier[contentLength] operator[SEP] operator[+] literal[String] operator[:] identifier[contentLength] operator[+] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] Keyword[new] identifier[DecimalFormat] operator[SEP] literal[String] , Keyword[new] identifier[DecimalFormatSymbols] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] operator[SEP] operator[SEP] operator[SEP] identifier[format] operator[SEP] identifier[kbPerSec] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[fine] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
protected String changeCase(String originalString, String mode) { String targetString = originalString; // mode is case insensitive, allow upper for example CaseFormatMode changeCaseMode = CaseFormatMode.get(mode.toUpperCase()); if (changeCaseMode != null) { switch (changeCaseMode) { case LOWER_CAMEL_CASE: targetString = camelFormat(originalString, false); break; case UPPER_CAMEL_CASE: targetString = camelFormat(originalString, true); break; case SNAKE_CASE: case LOWER_UNDERSCORE: targetString = caseFormatWithDelimiter(originalString, UNDERSCORE, false, true); break; case KEBAB_CASE: case LISP_CASE: case SPINAL_CASE: case LOWER_HYPHEN: targetString = caseFormatWithDelimiter(originalString, HYPHEN_MINUS, false, true); break; case TRAIN_CASE: targetString = caseFormatWithDelimiter(originalString, HYPHEN_MINUS, true, false); break; case UPPER_UNDERSCORE: targetString = caseFormatWithDelimiter(originalString, UNDERSCORE, true, false); break; default: // default not doing nothing to originalString } } else { LOGGER.error("Unknown mode {}, returning {} unchanged", mode, targetString); } return targetString; }
class class_name[name] begin[{] method[changeCase, return_type[type[String]], modifier[protected], parameter[originalString, mode]] begin[{] local_variable[type[String], targetString] local_variable[type[CaseFormatMode], changeCaseMode] if[binary_operation[member[.changeCaseMode], !=, literal[null]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['LOWER_CAMEL_CASE'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=originalString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=camelFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['UPPER_CAMEL_CASE'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=originalString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=camelFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['SNAKE_CASE', 'LOWER_UNDERSCORE'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=originalString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UNDERSCORE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=caseFormatWithDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['KEBAB_CASE', 'LISP_CASE', 'SPINAL_CASE', 'LOWER_HYPHEN'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=originalString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=HYPHEN_MINUS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=caseFormatWithDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['TRAIN_CASE'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=originalString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=HYPHEN_MINUS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=caseFormatWithDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['UPPER_UNDERSCORE'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=originalString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UNDERSCORE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=caseFormatWithDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[])], expression=MemberReference(member=changeCaseMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] call[LOGGER.error, parameter[literal["Unknown mode {}, returning {} unchanged"], member[.mode], member[.targetString]]] end[}] return[member[.targetString]] end[}] END[}]
Keyword[protected] identifier[String] identifier[changeCase] operator[SEP] identifier[String] identifier[originalString] , identifier[String] identifier[mode] operator[SEP] { identifier[String] identifier[targetString] operator[=] identifier[originalString] operator[SEP] identifier[CaseFormatMode] identifier[changeCaseMode] operator[=] identifier[CaseFormatMode] operator[SEP] identifier[get] operator[SEP] identifier[mode] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[changeCaseMode] operator[!=] Other[null] operator[SEP] { Keyword[switch] operator[SEP] identifier[changeCaseMode] operator[SEP] { Keyword[case] identifier[LOWER_CAMEL_CASE] operator[:] identifier[targetString] operator[=] identifier[camelFormat] operator[SEP] identifier[originalString] , literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[UPPER_CAMEL_CASE] operator[:] identifier[targetString] operator[=] identifier[camelFormat] operator[SEP] identifier[originalString] , literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[SNAKE_CASE] operator[:] Keyword[case] identifier[LOWER_UNDERSCORE] operator[:] identifier[targetString] operator[=] identifier[caseFormatWithDelimiter] operator[SEP] identifier[originalString] , identifier[UNDERSCORE] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[KEBAB_CASE] operator[:] Keyword[case] identifier[LISP_CASE] operator[:] Keyword[case] identifier[SPINAL_CASE] operator[:] Keyword[case] identifier[LOWER_HYPHEN] operator[:] identifier[targetString] operator[=] identifier[caseFormatWithDelimiter] operator[SEP] identifier[originalString] , identifier[HYPHEN_MINUS] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TRAIN_CASE] operator[:] identifier[targetString] operator[=] identifier[caseFormatWithDelimiter] operator[SEP] identifier[originalString] , identifier[HYPHEN_MINUS] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[UPPER_UNDERSCORE] operator[:] identifier[targetString] operator[=] identifier[caseFormatWithDelimiter] operator[SEP] identifier[originalString] , identifier[UNDERSCORE] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] } } Keyword[else] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[mode] , identifier[targetString] operator[SEP] operator[SEP] } Keyword[return] identifier[targetString] operator[SEP] }
public String generateCertificationRequest(String subject, KeyPair pair) throws InvalidArgumentException { try { PKCS10CertificationRequestBuilder p10Builder = new JcaPKCS10CertificationRequestBuilder( new X500Principal("CN=" + subject), pair.getPublic()); JcaContentSignerBuilder csBuilder = new JcaContentSignerBuilder("SHA256withECDSA"); if (null != SECURITY_PROVIDER) { csBuilder.setProvider(SECURITY_PROVIDER); } ContentSigner signer = csBuilder.build(pair.getPrivate()); return certificationRequestToPEM(p10Builder.build(signer)); } catch (Exception e) { logger.error(e); throw new InvalidArgumentException(e); } }
class class_name[name] begin[{] method[generateCertificationRequest, return_type[type[String]], modifier[public], parameter[subject, pair]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CN="), operandr=MemberReference(member=subject, 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=X500Principal, sub_type=None)), MethodInvocation(arguments=[], member=getPublic, postfix_operators=[], prefix_operators=[], qualifier=pair, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JcaPKCS10CertificationRequestBuilder, sub_type=None)), name=p10Builder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PKCS10CertificationRequestBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SHA256withECDSA")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JcaContentSignerBuilder, sub_type=None)), name=csBuilder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JcaContentSignerBuilder, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=SECURITY_PROVIDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SECURITY_PROVIDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProvider, postfix_operators=[], prefix_operators=[], qualifier=csBuilder, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPrivate, postfix_operators=[], prefix_operators=[], qualifier=pair, selectors=[], type_arguments=None)], member=build, postfix_operators=[], prefix_operators=[], qualifier=csBuilder, selectors=[], type_arguments=None), name=signer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ContentSigner, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=signer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=p10Builder, selectors=[], type_arguments=None)], member=certificationRequestToPEM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), 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=InvalidArgumentException, 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] identifier[String] identifier[generateCertificationRequest] operator[SEP] identifier[String] identifier[subject] , identifier[KeyPair] identifier[pair] operator[SEP] Keyword[throws] identifier[InvalidArgumentException] { Keyword[try] { identifier[PKCS10CertificationRequestBuilder] identifier[p10Builder] operator[=] Keyword[new] identifier[JcaPKCS10CertificationRequestBuilder] operator[SEP] Keyword[new] identifier[X500Principal] operator[SEP] literal[String] operator[+] identifier[subject] operator[SEP] , identifier[pair] operator[SEP] identifier[getPublic] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[JcaContentSignerBuilder] identifier[csBuilder] operator[=] Keyword[new] identifier[JcaContentSignerBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[SECURITY_PROVIDER] operator[SEP] { identifier[csBuilder] operator[SEP] identifier[setProvider] operator[SEP] identifier[SECURITY_PROVIDER] operator[SEP] operator[SEP] } identifier[ContentSigner] identifier[signer] operator[=] identifier[csBuilder] operator[SEP] identifier[build] operator[SEP] identifier[pair] operator[SEP] identifier[getPrivate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[certificationRequestToPEM] operator[SEP] identifier[p10Builder] operator[SEP] identifier[build] operator[SEP] identifier[signer] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InvalidArgumentException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public WeakReference<ProfileReport> getReportCurrentThread() { Accumulator acc = getAccForThread(); return acc == null ? null : acc.reportRef; }
class class_name[name] begin[{] method[getReportCurrentThread, return_type[type[WeakReference]], modifier[public], parameter[]] begin[{] local_variable[type[Accumulator], acc] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=acc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=reportRef, postfix_operators=[], prefix_operators=[], qualifier=acc, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[WeakReference] operator[<] identifier[ProfileReport] operator[>] identifier[getReportCurrentThread] operator[SEP] operator[SEP] { identifier[Accumulator] identifier[acc] operator[=] identifier[getAccForThread] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[acc] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[acc] operator[SEP] identifier[reportRef] operator[SEP] }
private String getAndValidateScriptName(JSONObject params) throws ApiException { String scriptName = params.getString(ACTION_PARAM_SCRIPT_NAME); if (extension.getScript(scriptName) == null) { throw new ApiException(ApiException.Type.DOES_NOT_EXIST, ACTION_PARAM_SCRIPT_NAME); } return scriptName; }
class class_name[name] begin[{] method[getAndValidateScriptName, return_type[type[String]], modifier[private], parameter[params]] begin[{] local_variable[type[String], scriptName] if[binary_operation[call[extension.getScript, parameter[member[.scriptName]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=DOES_NOT_EXIST, postfix_operators=[], prefix_operators=[], qualifier=ApiException.Type, selectors=[]), MemberReference(member=ACTION_PARAM_SCRIPT_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=ApiException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.scriptName]] end[}] END[}]
Keyword[private] identifier[String] identifier[getAndValidateScriptName] operator[SEP] identifier[JSONObject] identifier[params] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[String] identifier[scriptName] operator[=] identifier[params] operator[SEP] identifier[getString] operator[SEP] identifier[ACTION_PARAM_SCRIPT_NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[extension] operator[SEP] identifier[getScript] operator[SEP] identifier[scriptName] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ApiException] operator[SEP] identifier[ApiException] operator[SEP] identifier[Type] operator[SEP] identifier[DOES_NOT_EXIST] , identifier[ACTION_PARAM_SCRIPT_NAME] operator[SEP] operator[SEP] } Keyword[return] identifier[scriptName] operator[SEP] }
public void setNewenvironment(final boolean newenv) { this.compilerDef.setNewenvironment(newenv); for (int i = 0; i < this._compilers.size(); i++) { final CompilerDef currentCompilerDef = this._compilers.elementAt(i); currentCompilerDef.setNewenvironment(newenv); } this.linkerDef.setNewenvironment(newenv); }
class class_name[name] begin[{] method[setNewenvironment, return_type[void], modifier[public], parameter[newenv]] begin[{] THIS[member[None.compilerDef]call[None.setNewenvironment, parameter[member[.newenv]]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=_compilers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=currentCompilerDef)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=CompilerDef, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newenv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setNewenvironment, postfix_operators=[], prefix_operators=[], qualifier=currentCompilerDef, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=_compilers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) THIS[member[None.linkerDef]call[None.setNewenvironment, parameter[member[.newenv]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setNewenvironment] operator[SEP] Keyword[final] Keyword[boolean] identifier[newenv] operator[SEP] { Keyword[this] operator[SEP] identifier[compilerDef] operator[SEP] identifier[setNewenvironment] operator[SEP] identifier[newenv] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[_compilers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] identifier[CompilerDef] identifier[currentCompilerDef] operator[=] Keyword[this] operator[SEP] identifier[_compilers] operator[SEP] identifier[elementAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[currentCompilerDef] operator[SEP] identifier[setNewenvironment] operator[SEP] identifier[newenv] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[linkerDef] operator[SEP] identifier[setNewenvironment] operator[SEP] identifier[newenv] operator[SEP] operator[SEP] }
public static Method prefixMethodOfBeanByField(String prefix, Class<?> clazz, Field field, Class<?>... argTypes) { Method method = null; String fieldName = field.getName(); StringBuilder builder = new StringBuilder(prefix); builder.append(fieldName.substring(0, 1).toUpperCase()); builder.append(fieldName.substring(1, fieldName.length())); String methodName = builder.toString(); try { method = clazz.getDeclaredMethod(methodName, argTypes); } catch (SecurityException e) { } catch (NoSuchMethodException e) { } return method; }
class class_name[name] begin[{] method[prefixMethodOfBeanByField, return_type[type[Method]], modifier[public static], parameter[prefix, clazz, field, argTypes]] begin[{] local_variable[type[Method], method] local_variable[type[String], fieldName] local_variable[type[StringBuilder], builder] call[builder.append, parameter[call[fieldName.substring, parameter[literal[0], literal[1]]]]] call[builder.append, parameter[call[fieldName.substring, parameter[literal[1], call[fieldName.length, parameter[]]]]]] local_variable[type[String], methodName] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDeclaredMethod, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SecurityException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None) return[member[.method]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Method] identifier[prefixMethodOfBeanByField] operator[SEP] identifier[String] identifier[prefix] , identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[Field] identifier[field] , identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[argTypes] operator[SEP] { identifier[Method] identifier[method] operator[=] Other[null] operator[SEP] identifier[String] identifier[fieldName] operator[=] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[fieldName] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[fieldName] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[fieldName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[methodName] operator[=] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[method] operator[=] identifier[clazz] operator[SEP] identifier[getDeclaredMethod] operator[SEP] identifier[methodName] , identifier[argTypes] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SecurityException] identifier[e] operator[SEP] { } Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] { } Keyword[return] identifier[method] operator[SEP] }
@Override public ChainableEvent onSuccess(Event onSuccessEvent, Class<? extends IEventService> onSuccessEventService) { this.onSuccessChains.add(new ChainLink() .onSuccess(linkChainIdentifier(onSuccessEvent), onSuccessEventService)); return this; }
class class_name[name] begin[{] method[onSuccess, return_type[type[ChainableEvent]], modifier[public], parameter[onSuccessEvent, onSuccessEventService]] begin[{] THIS[member[None.onSuccessChains]call[None.add, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=onSuccessEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=linkChainIdentifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=onSuccessEventService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onSuccess, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ChainLink, sub_type=None))]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ChainableEvent] identifier[onSuccess] operator[SEP] identifier[Event] identifier[onSuccessEvent] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[IEventService] operator[>] identifier[onSuccessEventService] operator[SEP] { Keyword[this] operator[SEP] identifier[onSuccessChains] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ChainLink] operator[SEP] operator[SEP] operator[SEP] identifier[onSuccess] operator[SEP] identifier[linkChainIdentifier] operator[SEP] identifier[onSuccessEvent] operator[SEP] , identifier[onSuccessEventService] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
static public long getDateTime(String s, String format, boolean useTZ, boolean throwException) { long ret = 0L; SimpleDateFormat df = null; try { if(s!= null && s.length() > 0) { df = formatPool.getFormat(format); if(useTZ) df.setTimeZone(DateUtilities.getCurrentTimeZone()); else df.setTimeZone(TimeZone.getTimeZone("GMT")); Date dt = df.parse(s); ret = dt.getTime(); } } catch(ParseException e) { if(throwException) throw new RuntimeException(e); } if(df != null) formatPool.release(df); return ret; }
class class_name[name] begin[{] method[getDateTime, return_type[type[long]], modifier[public static], parameter[s, format, useTZ, throwException]] begin[{] local_variable[type[long], ret] local_variable[type[SimpleDateFormat], df] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, 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=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFormat, postfix_operators=[], prefix_operators=[], qualifier=formatPool, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=useTZ, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GMT")], member=getTimeZone, postfix_operators=[], prefix_operators=[], qualifier=TimeZone, selectors=[], type_arguments=None)], member=setTimeZone, postfix_operators=[], prefix_operators=[], qualifier=df, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCurrentTimeZone, postfix_operators=[], prefix_operators=[], qualifier=DateUtilities, selectors=[], type_arguments=None)], member=setTimeZone, postfix_operators=[], prefix_operators=[], qualifier=df, selectors=[], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=df, selectors=[], type_arguments=None), name=dt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[IfStatement(condition=MemberReference(member=throwException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=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=['ParseException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.df], !=, literal[null]]] begin[{] call[formatPool.release, parameter[member[.df]]] else begin[{] None end[}] return[member[.ret]] end[}] END[}]
Keyword[static] Keyword[public] Keyword[long] identifier[getDateTime] operator[SEP] identifier[String] identifier[s] , identifier[String] identifier[format] , Keyword[boolean] identifier[useTZ] , Keyword[boolean] identifier[throwException] operator[SEP] { Keyword[long] identifier[ret] operator[=] Other[0L] operator[SEP] identifier[SimpleDateFormat] identifier[df] operator[=] Other[null] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[s] operator[!=] Other[null] operator[&&] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[df] operator[=] identifier[formatPool] operator[SEP] identifier[getFormat] operator[SEP] identifier[format] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[useTZ] operator[SEP] identifier[df] operator[SEP] identifier[setTimeZone] operator[SEP] identifier[DateUtilities] operator[SEP] identifier[getCurrentTimeZone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[df] operator[SEP] identifier[setTimeZone] operator[SEP] identifier[TimeZone] operator[SEP] identifier[getTimeZone] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[Date] identifier[dt] operator[=] identifier[df] operator[SEP] identifier[parse] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[ret] operator[=] identifier[dt] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[ParseException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[throwException] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[df] operator[!=] Other[null] operator[SEP] identifier[formatPool] operator[SEP] identifier[release] operator[SEP] identifier[df] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
private List<T> unmarshallResponseHeaderToList( JsonUnmarshallerContext context) throws Exception { String headerValue = context.readText(); List<T> list = new ArrayList<T>(); String[] headerValues = headerValue.split("[,]"); for (final String headerVal : headerValues) { list.add(itemUnmarshaller.unmarshall(new JsonUnmarshallerContext() { @Override public String readText() { return headerVal; } })); } return list; }
class class_name[name] begin[{] method[unmarshallResponseHeaderToList, return_type[type[List]], modifier[private], parameter[context]] begin[{] local_variable[type[String], headerValue] local_variable[type[List], list] local_variable[type[String], headerValues] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=headerVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=readText, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonUnmarshallerContext, sub_type=None))], member=unmarshall, postfix_operators=[], prefix_operators=[], qualifier=itemUnmarshaller, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=headerValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=headerVal)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.list]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[T] operator[>] identifier[unmarshallResponseHeaderToList] operator[SEP] identifier[JsonUnmarshallerContext] identifier[context] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[headerValue] operator[=] identifier[context] operator[SEP] identifier[readText] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[headerValues] operator[=] identifier[headerValue] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[headerVal] operator[:] identifier[headerValues] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[itemUnmarshaller] operator[SEP] identifier[unmarshall] operator[SEP] Keyword[new] identifier[JsonUnmarshallerContext] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[readText] operator[SEP] operator[SEP] { Keyword[return] identifier[headerVal] operator[SEP] } } operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[list] operator[SEP] }